I recently got the Aqara pet feeder and I want to send a notification to my phone whenever it goes off. As far as I can see the best way to do this is to monitor when cat_feeder_portions_per_day
increases as the actual feeding event doesn’t publish anything to MQTT unfortunately.
alias: Notify cat was fed
description: ""
trigger:
- platform: state
entity_id:
- sensor.cat_feeder_portions_per_day
condition:
- condition: template
value_template: "{{ trigger.from_state.state|int < trigger.to_state.state|int }}"
alias: Only trigger if the value increased (don't notify when it resets at midnight)
action:
- service: notify.mobile_app_pixel_7
data:
message: >-
Meow! Cat was fed "{{ trigger.to_state.state|int - trigger.from_state.state|int }}"
portions!
title: Cat feeder
mode: single
As you can see I want the difference between the new portions_per_day
and the old one to publish as part of the notification, but I’m getting a validation error.
What’s the right syntax?