I am wanting to create an automation that triggers on any state change of a temperature sensor.
This is currently set as a numeric_state platform.
Setting the above and below threasholds to the same sensor does not seem to let this happen, and not setting above/below value returns an error.
How would I get this automation to trigger on any change?
trigger:
- platform: state
entity_id: senor.whatever
to:
if you leave out the “to:” then it will trigger on any change to the state or attributes. leaving it in only triggers on any state change only and ignores changes to the attributes.
Also it’s better to not post screenshots of code. Paste text and use code formatting (``` on line before and after the code).
I will certainly be using this with an escooter I have while it’s charging.
For now I’m using a temperature sensor to test this automation logging to Google sheets.
This does trigger occasionally with attribute changes as you mentioned.
I changed the automation to have a condition for the charger to be power on, multiple readings of the same value constantly is fine.
The screenshot shows it logging every minute even if the wattage is still the same.