Washing machine power consumption trigger

Hi,

I’m looking for a away to get a notification when my dumb (not smart) washing machine is finished.
I already have serveral sonoffs in my house. I’m thinking about using a pow r2 to do this.
So my idea is to track the power consumption. The trigger would be a falling power value under a certain threshold.

Is someone else here using a sonoff pow to do this? If yes could you post an example of your config?

Better ideas?

Thanks.

1 Like

I have heard of those catching on fire when connected to dryers/washers. I would use a smart plug to do this. I do exactly what you are trying to do with this package.

Sorry this was spose to be a direct link to the appliance package anyway its in there.

Try this one

Here is a link on how I do it with a TP Link HS110 and Appdaemon

Code is here

2 Likes

Are you talking about the one report on this forum? That was more than likely related to the wiring and had nothing to do with the sonoff.

1 Like

Ive done it with a HS110 as well. Ended up having an input_select which contain states like idle/rinse/wash/spin and then using automations to allow the cycle to progress in that order (only in that order). Then notify me only when it gets back to idle from spin.

  state_washingmachine:
    name: Washing Machine state
    options:
      - Switched Off
      - Powered Down
      - Idle
      - Rinse / Spin
      - Wash
    icon: mdi:tumble-dryer

- id: washingmachine_switchedoff
  alias: 'Washing Machine - Change State Switched Off'
  trigger:
    - platform: state
      entity_id: switch.washing_machine
      to: 'off'
  action:
    - service: input_select.select_option
      data:
        entity_id: input_select.state_washingmachine
        option: 'Switched Off'

- id: washingmachine_powereddown
  alias: 'Washing Machine - Change State Powered Down'
  trigger:
    - platform: state
      entity_id: switch.washing_machine
      to: 'on'
    - platform: numeric_state
      entity_id: sensor.washingmachine_powerdraw
      below: 1
      for: '00:01:00'
  condition:
  - condition: state
    entity_id: switch.washing_machine
    state: 'on'
  action:
    - service: input_select.select_option
      data:
        entity_id: input_select.state_washingmachine
        option: 'Powered Down'

- id: washingmachine_idle
  alias: 'Washing Machine - Change State Idle'
  trigger:
    - platform: numeric_state
      entity_id: sensor.washingmachine_powerdraw
      above: 1
      below: 4
      for: '00:01:00'
  condition:
    - condition: state
      entity_id: switch.washing_machine
      state: 'on'
    - condition: or
      conditions:
      - condition: state
        entity_id: input_select.state_washingmachine
        state: 'Powered Down'
      - condition: state
        entity_id: input_select.state_washingmachine
        state: 'Rinse / Spin'
  action:
    - service: input_select.select_option
      data:
        entity_id: input_select.state_washingmachine
        option: 'Idle'

- id: washingmachine_rinsespin
  alias: 'Washing Machine - Change State Rinse Spin'
  trigger:
    - platform: numeric_state
      entity_id: sensor.washingmachine_powerdraw
      above: 10
      below: 550
      for: '00:01:00'
  condition:
    - condition: state
      entity_id: switch.washing_machine
      state: 'on'
    - condition: or
      conditions:
      - condition: state
        entity_id: input_select.state_washingmachine
        state: 'Powered Down'
      - condition: state
        entity_id: input_select.state_washingmachine
        state: 'Idle'
      - condition: state
        entity_id: input_select.state_washingmachine
        state: 'Wash'
  action:
    - service: input_select.select_option
      data:
        entity_id: input_select.state_washingmachine
        option: 'Rinse / Spin'

- id: washingmachine_wash
  alias: 'Washing Machine - Change State Wash'
  trigger:
    - platform: numeric_state
      entity_id: sensor.washingmachine_powerdraw
      above: 1000
      for: '00:01:00'
  condition:
    - condition: state
      entity_id: switch.washing_machine
      state: 'on'
    - condition: or
      conditions:
      - condition: state
        entity_id: input_select.state_washingmachine
        state: 'Powered Down'
      - condition: state
        entity_id: input_select.state_washingmachine
        state: 'Idle'
      - condition: state
        entity_id: input_select.state_washingmachine
        state: 'Rinse / Spin'
  action:
    - service: input_select.select_option
      data:
        entity_id: input_select.state_washingmachine
        option: 'Wash'
7 Likes

One or one hundred would you risk it over saving $15-20 for a device that doesn’t have any c tick approvals so wouldn’t be covered by insurance let alone what else could happen.

Could you also show your automation to notify you?

Any recommendations on which service I could use for the notifications using multiple devices?

this is what I use

## Washing Machine Alerts
  - alias: Send alert when washing machine is finished
    trigger:
      - platform: state
        entity_id: sensor.washing_machine_status
        to: Clean
        for:
          minutes: 1
      - platform: state
        entity_id: device_tracker.admin_samsung
        to: 'home'
        for:
          minutes: 2
      - platform: state
        entity_id: device_tracker.admin_iphone
        to: 'home'
        for:
          minutes: 2
      - platform: time
        at: '20:45:00'
    condition:
      condition: and
      conditions:
        - condition: time
          before: '21:00:00'
          after: '08:30:00'
        - condition: state
          entity_id: group.family
          state: 'home'
        - condition: state
          entity_id: input_select.washing_machine_status
          state: Clean
        - condition: state
          entity_id: input_boolean.disable_washing_machine_notification
          state: 'off'
        - condition: template
          value_template: >
            {% if states.automation.send_alert_when_washing_machine_is_finished.last_triggered is not none %}
              {% if as_timestamp(now()) | int   -  as_timestamp(states.automation.send_alert_when_washing_machine_is_finished.attributes.last_triggered) | int > 1800 %} true {% else %} false
              {% endif %}
            {% else %}
            false
            {% endif %}
    action:
      - service: tts.google_say
        data:
          entity_id: media_player.tts_kodi
          message: 'The washing machine has finished and is ready to be emptied'
      - service: notify.pushbullet
        data:
          message: 'The washing machine has finished and is ready to be emptied'

I trigger an input_boolean, which then is triggered once when set, then every thirty minutes (if I’m home); it notifies me by TTS on my Google Home and via Hangouts. I then turn off this input_boolean through Google Assistant once I empty the appliance. If I’m not home, the input_boolean stores the state till I do get home and it then tells me as part of my arrive home TTS sequence.

- id: appliances_wash_to_idle
  alias: 'Appliances - Toggle Notifications'
  trigger:
    - platform: state
      entity_id: input_select.state_dishwasher
      from: 'Dry'
      to: 'Powered Down'
    - platform: state
      entity_id: input_select.state_washingmachine
      from: 'Rinse / Spin'
      to: 'Idle'
    - platform: state
      entity_id: input_select.state_dryer
      from: 'Tumble'
      to: 'Idle'
  action:
    - service: input_boolean.turn_on
      data_template:
        entity_id: >-
          {%- if (trigger.entity_id == "input_select.state_dishwasher") %}
              input_boolean.empty_dishwasher
          {%- elif (trigger.entity_id == "input_select.state_washingmachine") %}
              input_boolean.empty_washingmachine
          {%- elif (trigger.entity_id == "input_select.state_dryer") %}
              input_boolean.empty_dryer
          {% else %}
          {%- endif %}

- id: empty_appliances_notification
  alias: 'Notification - Empty Washer/Dryer/Dishwasher'
  trigger:
    - platform: time
      minutes: '/30'
      seconds: 00
    - platform: state
      entity_id: input_boolean.empty_dishwasher, input_boolean.empty_washingmachine, input_boolean.empty_dryer
      to: 'on'
  condition:
    - condition: state
      entity_id: group.people_status
      state: 'home'
    - condition: or
      conditions:
      - condition: state
        entity_id: input_boolean.empty_dishwasher
        state: 'on'
      - condition: state
        entity_id: input_boolean.empty_washingmachine
        state: 'on'
      - condition: state
        entity_id: input_boolean.empty_dryer
        state: 'on'
  action:
    - service: script.send_dishwasher_alert
    - delay: '00:00:06'
    - service: script.send_washingmachine_alert
    - delay: '00:00:06'
    - service: script.send_dryer_alert

send_washingmachine_alert:
  sequence:
    - condition: state
      entity_id: input_boolean.empty_washingmachine
      state: 'on'
    - service: tts.google_say
      entity_id: group.google_home_speakers
      data:
        message: "The washing machine's cleaning cycle has finished and it needs to be emptied."
    - service: script.send_hangouts_message
      data_template:
        message: "The washing machine's cleaning cycle has finished and it needs to be emptied."

welcome_home_sequence:
  sequence:
    - service: tts.google_say
      data_template:
        entity_id: >
          {% if source is defined %}
          {{ source }}
          {% else %}
          group.google_home_speakers
          {% endif %}
        message: >
          {{ ["Welcome home","Welcome back","Greetings"] | random }}. {%- if (states.input_boolean.empty_dishwasher.state == 'on') and (states.input_boolean.empty_dryer.state == 'on') and (states.input_boolean.empty_washingmachine.state == 'on') %} The dishwasher, dryer and washing machine completed while you were out and requires to be emptied.
          {%- elif (states.input_boolean.empty_dishwasher.state == 'on') and (states.input_boolean.empty_dryer.state == 'on') %} The dishwasher and dryer completed while you were out and requires to be emptied.
          {%- elif (states.input_boolean.empty_dishwasher.state == 'on') and (states.input_boolean.empty_washingmachine.state == 'on') %} The dishwasher and washing machine completed while you were out and requires to be emptied.
          {%- elif (states.input_boolean.empty_dryer.state == 'on') and (states.input_boolean.empty_washingmachine.state == 'on') %} The dryer and washing machine completed while you were out and requires to be emptied.
          {%- elif (states.input_boolean.empty_dryer.state == 'on') %} The dryer completed while you were out and requires to be emptied.
          {%- elif (states.input_boolean.empty_washingmachine.state == 'on') %} The washing machine completed while you were out and requires to be emptied.
          {%- elif (states.input_boolean.empty_dishwasher.state == 'on') %} The dishwasher completed while you were out and requires to be emptied.
          {%- endif %}

Code is a little bit messy and could be cleaned up but has been about 99% reliable. My dishwasher seems to mix it up sometimes with its power draw so this one is the 1% unreliable :slight_smile:

This should be fairly simple. As trigger you take the power consumption and if it goes to below, say, 2 then you trigger a notification. I do this with my washing machine and dryer and they trigger a notification via simplepush and a TTS message to my Google Home.

Ok thank you all.

Is there a way to do these TTS messages with Alexa or Siri (on Homepod)? I don’t have a Google Home, but I’d love to have those voice notifications too.

LThis is how I did it. Not tested yet. Suggestions are welcome. TP-Link HS110
TTS with Alexa works with this:

automations:
- alias: Notification - washing machine
  initial_state: 'on'
  trigger:
    platform: state
    entity_id: sensor.wash_power
    to: 'False'
    for: '00:03:00'
  action:
    - service: notify.ios_group
      data:
        message: "XYZ"
    - service: media_player.alexa_tts
      data:
        entity_id: media_player.echo_dot__wz
        message: "XYZ"

Is there a way to hold that tts messages until a motion sensor near alexa is fired?

I think I would use a input boolean which is set to on when the washing machine is finished.

In another automation I‘ll use the motion sensor as a trigger and the Input boolean as condition.
In „action“ I would reset the Input boolean and send the tts message.

Is there a bettet way to do it?

Thats the way I’ve done it. I use it to trigger a home TTS message, and a static wait time meant most times I’d miss it. The input-boolean stores the trigger, and then switches off after the script runs.

you can use wait_template: in the action of the automation with the motion sensor being the thing that the automation waits for. very easy. check the docs for wait_template:

As I mentioned before I also used the TP Link HS110.

I also want to collect power consumption data, so I use the attributes “total_energy_kwh” and “today_energy_kwh” to do this.

Today I realized that both values are approxametely the same, which is not possible because total must be a lot bigger.

I checked the kasa app and saw that the provided total value here is plausible.

Than I checked the recieved data in HA again. It seems like HA gets the wrong data for the total value.

Do you have the same problem? Maybe its a translation issue within the software (because my kasa app is in german).

Unbenannt

I’m facing a problem with my washmachine sensor.

I have a really simple setup which looks like this:

binary_sensor:
  - platform: template
    sensors:
      waschmaschine_status:
        friendly_name: "Status"
        # delay_on:
        #   minutes: 1  
        delay_off:
          minutes: 4
        value_template: "{{ states.sensor.waschmaschine_leistung.state | float > 3 }}"

My issue is that in certain washingprograms the energyvalue goes under 3 watts while washing for serval minutes. This triggers my notification, because it is off for more than 4 minutes.

The programs are different, the 1hour program works just fine. The 3hour program has some stops to let the soap sink in.
Any suggestions for this?

Also another question to my former post (right before that one):
Can someone with an english hs110 look into his/her kasa app and compare the provides values with the ones that are listet in home assistant.
I have a german version and the total_energy_kwh value in ha is never equal to any value in the app.

1 Like

You could feed the consumption values into a statistics sensor and use that as trigger. This should smoothen out these kind of issues.

Other possibility is to run a script as soon as value is below 4 watts. The script should then run a times for a few minutes and then check power consumption again. If consumption is still below 4 watts it triggers the automation.

1 Like

Where does this part go? If I put under input_boolean: I get an error with the options part.