Everything seems to be working fine, except for the 5 minute delay on the last automation. What I want to achieve is that the last automation waits 5 minutes to be sure that the washingmachine is indeed done.
I just realized that my “Done” notification doesn’t make much sense without the startup automation, so here’s the whole thing with the Dryer included as well.
I have two Aeotec Smart Plugs and I used the energy states to monitor things. I had to consider that the washer has pauses in it’s sequence that drop the power so I had account for that. I also had to account for the dryer load increasing when you open the door (the light) too.
I ended up creating two template sensors to count for those thresholds:
#
# Automation Templates
#
# True when washer power level is below 3.4 watts, high threshold of resting state
# Default state is true
washer_pwrdn:
value_template: "{{ states('sensor.aeotec_smart_switch_6_power_10_8') | int < 3.4 }}"
# True when Dryer power level is above 8.4 watts, showing dryer is in operation (as opposed to just having the door open)
# Default state is false
dryer_pwrup:
value_template: "{{ states('sensor.aeotec_smart_switch_6_power_11_8') | int > 8.4 }}"
and these are used in the automations, now shown in full:
# Washer Notification Sequence
- alias: 'Washer Start'
trigger:
platform: state
entity_id: sensor.washer_pwrdn
from: 'True'
to: 'False'
action:
service: input_boolean.turn_on
entity_id: input_boolean.washer_switch
- alias: 'Washer Done'
trigger:
platform: state
entity_id: sensor.washer_pwrdn
from: 'False'
to: 'True'
for:
minutes: 3
condition:
condition: state
entity_id: input_boolean.washer_switch
state: 'on'
action:
- service: notify.pushbullet
data:
message: 'Robert, the washer is done.'
- service: input_boolean.turn_off
entity_id: input_boolean.washer_switch
# Dryer Notification Sequence
- alias: 'Dryer Start'
trigger:
platform: state
entity_id: sensor.dryer_pwrup
from: 'False'
to: 'True'
action:
service: input_boolean.turn_on
entity_id: input_boolean.dryer_switch
- alias: 'Dryer Done'
trigger:
platform: state
entity_id: sensor.aeotec_smart_switch_6_power_11_8
state: '0.0'
condition:
condition: state
entity_id: input_boolean.dryer_switch
state: 'on'
action:
- service: notify.pushbullet
data:
message: 'Robert, the dryer is done.'
- service: input_boolean.turn_off
entity_id: input_boolean.dryer_switch
Nice,
I might use something like that coupled with a BLE proximity sensor to tell who started the washer to notify them when their wash is done. That way I don’t have to bug everyone about it.
This could be done with IFTTT. You already have triggers to measure when the washer starts and stops, you could use this to automate timestamping on a Google Spreadsheet using IFTTT. Shouldn’t be too difficult
Not a bad solution, but I think we were both looking to do it within the framework of HA. But appreciate the idea; it may lead to something else. Thanks!
That creates a sensor to display the number of seconds since input_boolean.stopwatch was turned on. I’m sure someone could come up with a custom component that works better, but it was interesting that this is possible with just the components currently available.
You’ll probably want to remove unit_of_measurement then, as it won’t make sense anymore.
As for putting it in a notification, you should be able to just use a template for the message and put the value of the sensor, i.e. {{ states('sensor.stopwatch') }}. Just be sure to use data_template instead of just data.
I’m curious as to what you will learn from getting the elapsed time. Not critical, actually curious what this may yield. If you find anything interesting by monitoring it, it would be great if you could share your findings.