I have a cat feeder integrated, but I wanted some feedback to know the food actually came out to ensure no issues. It's happened sometimes that the cat feeder became unavailable due to a HA crash or other reasons, and it needs an integration reload to reconnect.
I've created a ffmpeg_noise sensor from a nearby camera that I tested and triggers when the food drops.
Wait for trigger works fine as the noise sensor is not instant, so I need a window to wait for it. If noise is detected I want the script to continue and the counter to increment.
If noise is NOT detected, I want it to launch a notification to my phone with a certain delay (to overcome a temporary HA crash) or a few times over the next hours.
How can I achieve this branching out depending on the wait_for_trigger timeout? Using a choose would work for branching, but the condition check is not a wait_for_trigger but an instant check instead.
This is my current script:
alias: Feed paca
sequence:
- target:
entity_id: number.cat_feeder_manual_feed
data:
value: "1"
action: number.set_value
- wait_for_trigger:
- trigger: state
entity_id:
- binary_sensor.ffmpeg_noise
to: "on"
timeout:
hours: 0
minutes: 0
seconds: 10
milliseconds: 0
continue_on_timeout: false
- target:
entity_id: counter.paca_portions
data: {}
action: counter.increment
mode: single
icon: fas:cat