Binary noise sensor keeps going unavailable

My noise sensor is kind of a crap shoot on if it is available or not. Every time after a restart I have to check and determine if it is there.

I saw https://github.com/home-assistant/home-assistant/issues/10112 and they said that you need to have an automation restart the sensor when it is detected as down or ‘unavailable’.

How do I make that automation? I searched for how to restart an entity, but couldn’t find a solution.

Thanks

Here is the input from my configuration.yaml

binary_sensor:
  - platform: ffmpeg_noise
    input: 'rtsp://192.168.x.xx:xxxx/unicast'
    name: 'Noise Sensor'

It is the audio of a Wyze Cam that I added the Dafang Hacks to

Try this:

- id: restart_noise_sensor
  alias: 'Restart Noise Sensor'
  trigger:
    entity_id: binary_sensor.noise_sensor
    platform: state
    to: 'unavailable'
    for:
      seconds: 30
  action:
    service: ffmpeg.restart # not sure if this requires any further parameters. It is poorly documented and I know bugger all about it.
1 Like

I’ll give that a shot. I think that looks like it will work, but we’ll see. I’ll mark it as solution if it does! Thanks!!

It hasn’t shut off in a couple days so I’m pretty sure that it’s working.

Thanks!!