Hi,
Back Story - I’ve got HA on a remote site in PNG giving us status updates on a genset using modbus tcp. I am setting up automations for the servicing based on generator runtime. The runtime entity is a string and I initially used the below to trigger the automation for a notification:
{{states('sensor.maingenset_engine_runtime') > '4250'}}
This obviously didn’t work as it rendered true for runtime above 42.5 hours. I amended to the below and in the developer template page it worked well.
{{states('sensor.maingenset_engine_runtime')|int() >= '4250'|int()}}
I did create 10 automations using the first template with differing values. As a result I then edited all the automations to include int(). I then created 10 more automations as “upcoming service” reminders with a slightly reduced runtime value.
The genset hours ticked over 48 last night and I received a notification for the 4750 service due, but not the 4740 reminder. I looked through the traces of the 4750 automation and the template listed in the “Step Details” and “Automation Config” tabs still had the original template (pictured)
even though when I go view the automation in the GUI editor and .yaml the template is shown as correct.
I have checked the int() template above in the developer template tab and it renders as FALSE
My question is: Why did the automation trigger based on the original template is was created with instead of the updated template? Could this be because I did not do a restart?
If so, for future, should it be a .yaml restart or a full restart?
Obviously the 4740 reminder automation has no traces as it did not trigger. The 4740 automation was created with the integer comparator initially, so this is why it leads me to think it was a restart issue.
Any thoughts would be appreciated.