- name: toyota engine status unique_id: "toyota_engine_status" state: >- {% if as_timestamp(now()) | int > (state.sensor.toyota_torque,'time') | int +60) %} OFF {% else %} ON {% endif %}
The timestamp may not match
- name: toyota engine status unique_id: "toyota_engine_status" state: >- {% if as_timestamp(now()) > (state_attr('sensor.toyota_torque', 'time') | int(0) / 1000) + 60 %} OFF {% else %} ON {% endif %}
thanks help but states Is not correct ,like this Is it timestamp format?
Sorry about that, I didn’t count digits… your timestamp is in milliseconds and now() return seconds. I have corrected the template in the post above.
now()
thank you very much,It’s working very well now