Smart washing machine or tumbler (vendor independent)

Another small project I realised at the end of last year was the smartification of our washing machine and dryer as they both stand in the basement of our house and therefore you don’t recognize when the programs are finished.

I will describe only the integration of the washing machine, the integration of the dryer is similar.

First of all I cabled each of the power plugs with a Shelly 1 PM to be able to measure the power load consumption.


I had to use one device per plug and not a Shelly 2.5 PM because they are each on a different circuit.

Next step was to configure mqtt at the Shellies because I am using mqtt for connection to HA.

After this I had to add a sensor in HA:

- platform: mqtt
  name: Waschmaschine Leistung
  state_topic: "shellies/waschraum/waschmaschine/relay/0/power"
  unit_of_measurement: "W"
  device_class: power
  state_class: measurement

Also I had to create a binary helper called waschmaschinenprogramm which is set to on or off depending on the power consumption.

Then there are 2 automations:

  • one for starting the laundry program (the threshold depends on your device, this needs a little bit of experimenting; in my case it was 9W)
alias: Keller Waschprogramm Start
trigger:
  - above: '9'
    entity_id: sensor.waschmaschine_leistung
    platform: numeric_state
condition:
  - condition: state
    entity_id: binary_sensor.waschmaschinenprogramm
    state: 'off'
action:
  - data:
      entity_id: input_boolean.waschmaschinenprogramm
    service: input_boolean.turn_on
  - choose:
      - conditions:
          - condition: template
            value_template: >-
              {{now().timestamp() -
              as_timestamp(strptime(states('sensor.uptime'), "%Y-%m-%d 
              %H:%M:%S")) > 120}}
        sequence:
          - service: notify.telegram_info
            data:
              message: Waschmaschinen-Programm gestartet
              title: Waschmaschine
          - data_template:
              datetime: '{{ now().strftime(''%Y-%m-%d %H:%M:%S'') }}'
            entity_id: input_datetime.start_waschmaschine
            service: input_datetime.set_datetime
    default: []
mode: single

I also added a condition so that the notification is not triggered if I reboot HA, that means the notification is triggered only if HA is up for more than 120 seconds.

  • one for stopping (again, threshold is gathered by trial-and-error and value has to be longer than 5 mins below threshold):
alias: Keller Waschprogramm Stopp
trigger:
  - below: '3'
    entity_id: sensor.waschmaschine_leistung
    for: '00:05:00'
    platform: numeric_state
condition:
  - condition: state
    entity_id: binary_sensor.waschmaschinenprogramm
    state: 'on'
action:
  - data:
      entity_id: input_boolean.waschmaschinenprogramm
    service: input_boolean.turn_off
  - alias: ''
    data:
      message: Waschmaschinen-Programm gestoppt
      title: Waschmaschine
    service: notify.telegram_info
  - condition: state
    entity_id: input_boolean.state_lautlos
    state: 'off'
  - data:
      sound: klingel
    service: rest_command.playsoundondashboard
mode: single

In my case it also triggers

  • a telegram notification
  • a sound on the dashboard in the hall of our main-floor, if the global value for “mute” is not set to on.

This runs now for a year and I can say that the WAF is quite high. :slight_smile:

2 Likes