Hi,
I’m trying to create a sensor (sensor.wash_status) to track washing machine status through its power consumption (sensor.wash_power).
I created it as helper + template sensor and added the following code in the State Template Option field:
{% if states(‘sensor.wash_power’)|float(0) == 0 %}
OFF
{% elif states(‘sensor.wash_power’)|float(0) > 0
and
states(‘sensor.wash_status’) == ‘OFF’ %}
STAND-BY
{% elif states(‘sensor.wash_power’)|float(0) > 50
and
states(‘sensor.wash_status’) == ‘STAND-BY’ %}
WASHING
{% else %}
unknown
{% endif %}
I need to add a condition in the bold line so that it is true if power goes above 50 for more than X seconds.
Can you please help?
Thank you very much!
Davide