How to ensure an automation running properly. To feed my cat

I’ve recently installed an automatic cat feeder. Runs on Tuya local, and it’s been running fine for a few days. Here’s the automation:

alias: Paca food schedule
description: ""
trigger:
  - platform: time
    at: "08:00:00"
  - platform: time
    at: "11:00:00"
  - platform: time
    at: "14:00:00"
  - platform: time
    at: "17:00:00"
  - platform: time
    at: "20:00:00"
  - platform: time
    at: "00:00:00"
    id: New day
condition: []
action:
  - choose:
      - conditions:
          - condition: trigger
            id:
              - New day
        sequence:
          - service: counter.reset
            target:
              entity_id: counter.paca_portions
            data: {}
      - conditions:
          - condition: not
            conditions:
              - condition: trigger
                id:
                  - New day
        sequence:
          - service: script.turn_on
            target:
              entity_id: script.feed_paca
            data: {}
mode: single

And here’s the script that it calls:

alias: Feed paca
sequence:
  - service: number.set_value
    target:
      entity_id: number.cat_feeder_manual_feed
    data:
      value: "1"
  - service: counter.increment
    target:
      entity_id: counter.paca_portions
    data: {}
mode: single
icon: fas:cat

The counter is just a helper for us to know how many portions have been fed a day, in case we trigger one manually as extra.

Point is today at 11:00h we didn’t hear the food coming out. We triggered it manually after, and I went to debug why it failed.

Turns out the automation ran fine, and the script ran fine too. The counter had increased, and there were no errors related in HA log.

Automation trace timeline
Script trace timeline
Script trace

As you can see, no errors whatsoever. It’s like everything ran fine. I just didn’t hear food coming out. Integration was connected, no errors. At 11:07 I manually triggered the script and it worked, no issues.

So my concern and question now is:

*** Any way to know what might have failed?**
*** How can I secure and adjust this automation/script so that I’m 100% aware if anything didn’t run as planned? **

Not specifically looking at extra devices. I guess a camera would be a safety check, but I’m looking for automation modifications.

The worry is the cat not being fed. A single portion wouldn’t be an big deal, but if we’re on holiday and it fails for an entire day, I need to know to trigger it manually/debug, or ask the neighbours.

Thanks!

So the feeder operates when number.cat_feeder_manual_feed goes to 1? Does it then reset that number?

Can you have a look at the history for that entity to ensure it was something other than 1 just before 11:00?

It’s actually very weird. It’s a number entity, and only activates when it is “set”. So in terms of logbook and history, there’s no activity at all, since I’m always serving 1 portion. I could server 2 or 20 at once, I just don’t.

Here’s the device integrated. The quick feed button doesn’t do anything. The manual feed number entity is the one that works.

Seems odd that it works by setting the number to the same value it was already. HA’s state machine often ignores non-changes like that.

Can you set it to e.g. 0 then 1?

Nope. 1 is the minimum. I guess it’s a half assed integration from Tuya. I wanted a cheap one that works so I’m happy with it.