Using the new Sonoff POW R2 current sensor, we added a new Home Assistant automation to notify via text message on phones and tablets and send audio alerts to our Sonos smart speakers when the washing machine has completed its cleaning cycle.
The Sonoff POWR2 sends updates every 10 seconds via our MQTT server to Home Assistant.
Using the following automation script, we can monitor its current usage and when the sensor.washing_machine_power drops below 5 watts for over two minutes. It sends notifications to our phones, tablets and speakers.
The data below from the sensor shows the mains current in amps throughout three washing cycles starting with a complete cycle, a short cycle with a small washing load and ending with a complete cycle.
The peaks on the graph at 10 amps are the water heating cycles, and the smaller peaks at the end of each cycle are the higher-speed spinning mode.
alias: Washing Machine Cycle finished
- platform: numeric_state
- service: notify.mobile_app_brian_iphone
Alert! The washing machine has finished, please remove the clothes from
the washing machine
- service: script.scriptwashingmachinecomplete
A second script has been added to Home Assistant for the Sonos smart speakers, which makes use of the Sonos snapshot feature to save the current state of the speaker, then sets the volume to 0.3 level, plays a voice alert from local storage with a short delay before restoring the Sonos state and allowing the speaker to continue as before.
This could have been added to the above automation, but I kept it separate for future expansion and added variables to play different files or on the other Sonos speakers in the house.
The audio file was created using a free text-to-speech service from https://ttsmp3.com/
- service: sonos.snapshot
- service: media_player.volume_set
- service: media_player.play_media
- service: sonos.restore