Has the cat been fed?
If, like me, you have a cat, you will be aware that they’re very good at persuading you that they’ve not had breakfast yet, even though you could swear you just fed them 10 minutes ago. To limit overfeeding, I use Home Assistant to log when mine’s been fed, and I have a physical button near his bowl or one on my phone to press every time I feed him, to keep track.
This is Fury, my 9 year old rescue with no eyes and no teeth.
How to
First up, create a helper in Home Assistant. A helper is a small variable, and in this case I’m going to make it a button that can be pressed. From Settings - Helpers - Create Helper:
I call it cat_fed and give it a cat face icon:
This then lets us add a “cat fed” button to the dash. I created a new dash called “Cat” to store all Fury-related information, then Edit Dash - Add Card - Button and select “Cat_fed” as the Entity, set tap action to “Toggle”. You can give the button a name and icon, and if you toggle “Show state?” it will display the time of last press underneath the button:
Now we have a button that will log every time it’s pressed. The first thing I did was to add a Logbook Card to the Cat dashboard, which will show a log of previous presses. Add this from the “Add Card” as usual:
Something else that would be useful would be a counter of how many times the cat has been fed today. Create a new helper like before, this time create a counter and call it something like “Cat fed today”. Give it a nice icon and leave the rest as is.
Next, we make an automation so that when the button is pressed, the counter increments. This is really simple: go to Settings - automations - create new automation. The trigger is “State” and the entity is cat_fed (the button we made at the start); conditions can be left blank, and the Action is to “Call service - counter increment”. Next, select the Target; this will be the entity we made with the helper, the counter “Cat fed today”.
Back on Cat Dashboard, if you add card by entity and type in “cat fed” you should see a few options - one with the robot icon will be a toggle to turn the cat fed counter on and off. Another will be for “Cat Fed Today” and should show the number of times the cat fed button has been pressed.
BUT this will keep counting day in, day out. To get it to reset each day at midnight we need one final automation: When the time is equal to 12:00AM, call a service “Counter: reset” on Cat Fed Today.
Now the counter will reset at midnight. I also added another button to manually reset the count, in case I want to start counting from zero for some reason.
So here’s the final result of what the Cat Dashboard looks like in my Home Assistant:
Now we can do other clever things, such as display the cat fed counter on big display above his food bowl to remind me that he’s already had breakfast. You can add the button as a widget on your phone, or use a physical zigbee button to trigger the “Cat_fed” button.
You can see on my dash that I also have data from his GPS Tractive Collar, which is cool, plus “kitchen buzzer” - this is a physical alarm in the kitchen that sounds if Fury’s GPS collar leaves the wifi zone, which means he’s escaped the garden and is off having an adventure.