I’m using triggers that track state change to any value, which during a template reload causes error messages in the log, and a lot of rapid automation executions.
- platform: state
entity_id: sensor.solarnet_power_photovoltaics
to:
There is no from_state.state, but there is a to_state.state. from_state == null
I’ve tried creating a bunch of different combinations to exclude to_state = null, but had no luck because I think these not_to and not_from address to_state.state and from_state.state, not to_state and from_state?
Any suggestions if there is a way to write this without a condition? A condition will still create a lot of executions.
- platform: state
entity_id: sensor.solarnet_power_photovoltaics
not_from: null
- platform: state
entity_id: sensor.solarnet_power_photovoltaics
not_from: 'null'
- platform: state
entity_id: sensor.solarnet_power_photovoltaics
not_from: none
that would only be the case if you position the condition in the action block of the automation.
If you put the condition in the condition block, and it is false, the automation doesn’t not fire the action block, and the last-triggered wont be set.
to rule out the template reload, you can even add that condition
condition: state
entity_id: binary_sensor.template_integration_reloaded
state: 'off'