Have you tried the "numeric state" trigger? It lets you trigger an automation if one numeric entity is higher or lower than another one.
homeassistant
Home Assistant is open source home automation that puts local control and privacy first. Powered by a worldwide community of tinkerers and DIY enthusiasts. Perfect to run on a Raspberry Pi or a local server. Available for free at home-assistant.io
I’ll take a look. Thanks for the suggestion!
In isolation a temperature sensor can be “flappy”, so you may want to try and smooth the data to avoid hysteresis. I use the statistics integration to help improve the quality of my sensors.
Have a read of this for inspiration:
https://community.home-assistant.io/t/thermostat-with-hysteresis-smoothing-factor/72729
Using this you would create a calibrated sensor which you would use for automations as SeriousBug suggests.
[email protected] suggested statistics to smooth the numbers out. I can't reply to his comment for some reason, so I'm trying to reply here: Another option to avoid that issue would be to have the automation check that a > b for 2 minutes, or something like that.
I have a similar automation setup to notify when the AC is running while the temperature is cooler outside. You could create an automation with a time based trigger (run every 5 mins) with a value template in the Conditions (along with any other conditions like only in the daytime, if blinds are open, etc):
{{ states('sensor.thermostat_current_temperature')|float>state_attr('weather.home', 'temperature')|float }}
And then in Actions: call service - Notifications: send via mobile app
Mine only differs in that it triggers based off the AC turning on.