Hey there, no problem.
This is by no means a “best practice” example, or a particularly efficient way of doing things, but it has worked reliably for us the last several months. You don’t need the trigger as a separate script, but it’s handy if you’re planning to trigger the feed from elsewhere like Google Assistant.
Add the following elements to your YAML:
Your input_boolean, which can be used to quickly turn on / off your cat feeder scheduler automations (if you have a few for week days, weekends, evenings etc):
input_boolean:
cat_feed_schedule:
name: Cat Feed Schedule
icon: mdi:fish
Your input_datetime, to configure the start time easily from the Home Assistant UI:
input_datetime:
cat_feed_schedule_weekday_morning:
name: Weekday Morning
has_date: false
has_time: true
Your script, to trigger the feed when called (there’s probably a dedicated button for this in more recent zigbee2mqtt updates but this works ok for me so I haven’t changed it):
script:
cat_feed_manual:
alias: "Cat Feeder Start"
sequence:
- service: mqtt.publish
data:
topic: zigbee2mqtt/Kitchen Cat Feeder/set # note case sensitive
payload: '{"feed": "START"}'
Your automation (remove the weekday conditions, or create additional automations for different days, weekends etc):
automation:
- alias: Cat Feed Schedule Weekday Morning
id: cat_feed_schedule_weekday_morning
initial_state: on
trigger:
- platform: template
value_template: '{{ states.sensor.time.state == states.input_datetime.cat_feed_schedule_weekday_morning.state[0:5] }}'
condition:
condition: and
conditions:
- condition: state
entity_id: input_boolean.cat_feed_schedule
state: 'on'
- condition: time
weekday:
- mon
- tue
- wed
- thu
- fri
action:
- service: script.turn_on # START FEEDER MANUALLY
data:
entity_id: script.cat_feed_manual
You may also want to add some of the feeder sensors to your Home Assistant UI so that you can tell if the feeder has triggered successfully or not - our cat clears the bowl within a minute of the feed, so sometimes you think it hasn’t triggered correctly. Until you check sensor.kitchen_cat_feeder_portions_per_day