Automation time trigger with variable

I would like like to send a notification with a screenshot of my living room camera to check on my cat. We have an automatic feeder that drops food at a given time. The problem is that the machine time is weird. Each week it has about 2 minutes delay. So at some point, the screenshot won’t be in sync anymore. I did a quick math and each day the built-in clock of the feeder adds 8 seconds delay. Is that a way to put this variable in the trigger, so the screenshot will be always when my cat is eating?


You could create a timer helper and set it to 24:00:08. You would have to manually start the timer one day when the food drops. You would then create an automation that triggers on timer.finished. This automation would immediately restart the timer and then take your screenshot.

I assume the feeder is battery-powered? If it plugs into the wall, then maybe there’s enough of a surge at feeding time to detect with a power-monitoring smart plug.


This shouldn’t be in the “blueprint” category.

You could add a configurable delay to the action: create an input_number helper and then:

  - delay: "{{ states('input_number.screenshot_delay')|int(0) }}"

Alternatively, you could have a button that sets an input_datetime helper to the current day when you correct the feeder clock, then each time the automation is run, work out how many days ago that was and add an appropriate delay.

  - delay: "{{ (now() - states('input_datetime.cat_reset')|as_datetime).days * 8 }}"

Sorry. I bounced from the blueprints exchange to here by accident. Moved it again… Doing some clean-up…

1 Like