I have an automation triggering a python script when the temperature changes of a thermometer.
- alias: 'Run tempscript on temp change'
trigger:
platform: state
entity_id: sensor.temp
action:
service: python_script.tempscript
It works, however sometimes the temp-value is right in between two integers and the value changes rapidly between two numbers for a minute or two: 6, 7, 6, 7, 6, 7. I’d like my script to only be run when the value has been steady for a while.
I tried applying the for x minutes
, however that expects a to
value, which I don’t have? Can I do it in some other way?