Hey all,
So I know plety of blueprints and FAQ’s exist to automate your washing machine but they all seem overly complicated. I want a single template called “washing machine status” that has 3 states" running, idle, or change so I can send notifys until it goes to idle. I want it to use 2 sensors, one for power and one for the appliance door. Here is what I have so far in my template.yaml:
sensor:
- name: "Washing Machine Status"
state: >
{% if states('sensor.washer_power')|float > 1 %}
running
{% elif state_attr('sensor.Washing_Machine_Status', 'device_last_run') > state_attr('sensor.Washing_Machine_Status', 'device_last_open') %}
change
{% else %}
idle
{% endif %}
attributes:
device_last_run: >
{{ now() if is_state('sensor.washing_machine_status', 'running') }}
device_last_open: >
{{ as_local(states.binary_sensor.zha_switch_1.last_changed )}}
Everything seems to be working except the device_last_run attribute goes to null after it finishes thus negating the change state. Basically, I just want a template to tell me when I need to change my clothes in as few lines as possible. Thanks for lokking at my code, you guys are awsome!