I have a Sonoff TH-10 with Tasmota installed that I am using to monitor the temperature of my aquarium via MQTT. I want Home Assistant to send an alert to my phone every time the temperature drops below 76.8. This is the automation I have setup:
TRIGGER
Trigger Type: Numeric State
Entity: sensor.basement_aquarium_temperature
Below: 76.8
ACTION
Action Type: Call Service
Service: notify.ios_andrews_iphone_xr
Service Data: { "data": { "push": { "badge": 5 } }, "message": "Check the basement aquarium temperature!", "title": "Basement Aquarium Temperature Alert" }
The same exact Action configuration send notifications for other triggers I have configured. So, I know that part works. I assume there’s an error with my trigger section, but I don’t know what I am doing wrong.
One of two things, your sensors are returning stings instead of numeric number and your below trigger needs a numeric number. Two, I am not sure if the below trigger can handle a float, may only accept and int.
Looks good to me. Doesn’t matter if you have the quotes or not, it attempts to parse whatever you put in above or below as a number. It also accepts floats. Note that the automation won’t trigger unless the temperature actually goes from above that number to below. If it’s already below that number it won’t trigger.
If that’s not the issue, is the automation on and does the action work when you manually execute it?
I just tried to trigger it manually by clicking Execute and I did get a popup on my phone.
I did water change on my aquarium on Saturday, and forgot to turn the header back on. So, this morning I come downstairs and the temperature is 66 degrees in the tank and my phone has never alerted me to the temperature.
Is there a way to get the automation to trigger if the temperature is already below 76.8 when Home Assistant starts up?
You could trigger auto every 5 minutes then condition on temperature. That will have a fixed frequency of checks, but it will also spam you every 5 minutes while temp is low.
It looks strange, but this will trigger when home assistant starts and the sensor is below that temperature OR when the sensor goes from above 76.8 to below 76.8.