I didn’t specify anything in “from” or “to” as I want it triggered when changing from “sunny” to “cloudy”, or “cloudy” to “rainy”, anything basically
The problem is that the sensors seems to be updated every 15 minutes, even if the state is always “cloudy”, so the automation is triggered even if it shouldn’t
Won’t that condition still allow for changes of attribute values?
For example, if the state value remains unchanged, but some attribute’s value changes, it will trigger the State Trigger, the condition will evaluate to true, and the action will be executed.
I’m trying to do something like this but in a template sensor - not an automation. I scrape my alarm status from a website, and want to know when the status (state) last changed. The state can be anyone of about 6 different values, and I want to trigger the template if it changes from anyone of those possible states to anyone different.
Can anyone show me how do this in a template? I see above the coding for an automation - but I’m not sure about doing it in a template. My template so far is shown below (which triggers on restarts as well as changes so doesn’t yet help me):
#
# ALARM STATE LAST CHANGED (TEST TEMPLATE)
- trigger:
- platform: state
entity_id: sensor.home_alarm_status
sensor:
- name: alarm status changed
state: "{{ now() }}"
'''