fbpx

Automatically detect if audio is enjoying

Automatically detect if audio is enjoying

Hi, I’m utilizing dwelling assistant to play sound on my powered audio system linked instantly to three.5mm audio output. I would like to have the ability to flip them on/off when wanted, so I linked them via a sensible plug.
Now the problem is to find out whether or not any sound is popping out of the pc to set off on/off automation.

I discovered this PulseAudio command which supplies me output IDLE or RUNNING:
pactl record | grep State

It works nice, however I’m struggling to get it working in HA.

My plan is to run automation each 5 seconds which is able to verify for IDLE/RUNNING standing and management the good plug accordingly.

I created shell command for that, however every time I run it, it returns an error:

shell_command:
  check_audio_output: /bin/bash -c "pactl record | grep State"

output:

stdout: ""
stderr: "/bin/bash: line 1: pactl: command not discovered"
returncode: 1

Same command works after I run it in terminal.

Anyone has any concepts why does it fail or perhaps there’s a higher approach to verify for sound enjoying?

1 submit – 1 participant

Read full subject

HI-FI News

by way of Home Assistant Community – Latest matters https://ift.tt/Ylk0jUX

March 9, 2024 at 10:11AM

Select your currency