Trigger on Washing Machine finish

Hello,

It work some times and mostly not.
The above code was for test only so I set short times to check settings. Here is my final configuration.

I want to get google home device announce that wash is done. For this I have set following as my understanding.

  1. When machine starts, it takes 2- 5 watts while you set timer etc.
  2. When machine start washing it takes around 190-230 watts until completed.
  3. in between, it takes 6-5 watts again for water drain and refill.

So I have set that if machine take power more than 1 watt for atleast 10 minutes or more. It should trigger and added condition that power must be less than .3 for 30 seconds to run actions.

Because when machine is started, it takes more than 1 watt. and when it complete it takes 0 watts.

Now its not running and I don’t know why. Is there any way to troubleshoot? So I am making any mistake in my configuration?

Please advice.

- id: '1622563811541'
  alias: 'Washing Machine automation '
  description: ''
  trigger:
  - platform: numeric_state
    entity_id: sensor.sonoff_1000000_power
    attribute: power
    for: 00:10:00
    above: '1'
  condition: []
  action:
  - wait_for_trigger:
    - platform: numeric_state
      entity_id: sensor.sonoff_1000000_power
      below: '.3'
      for: 00:00:30
      attribute: power
    continue_on_timeout: false
  - service: media_player.volume_set
    target:
      entity_id:
      - media_player.kitchen_speaker
      - media_player.bedroom_speaker
      - media_player.office_speaker
    data:
      volume_level: 1
  - wait_template: 00:00:15
  - service: tts.google_translate_say
    data:
      message: washing done
      entity_id: media_player.bedroom_speaker
  - service: tts.google_translate_say
    data:
      entity_id: media_player.kitchen_speaker
      message: washing done
  - service: notify.mobile_app_iphone
    data:
      title: Washing is done
      message: Take of the cloths from machine
  - service: switch.turn_off
    target:
      entity_id: switch.sonoff_1000000
  mode: restart

It’s hard to tell.
Note that “above 1 for 10mn” means that the power must not drop under 1W for the whole 10mn to trigger.
Same for “below .3 for 30s”. So if there is only 1 instance of a 1.1W after 9:59, then it won’t trigger.
I’ve not chosen to go this way, but used a larger value (30W) no delay to detect beginning.
And then an higher value (3W) for a longer time (5mn) to detect end of cycle.

Hi, I like your code. But don’t know what is this, another helper?
“service: timer.start
entity_id: timer.wasmachine”
In your write up not find it.

I have a plug with tasmota firmware, which values I have to change to integrate the switch.blitzwolf_shp6?

What “values” are you referring to?

Hey @charliesoap4,
I am a big fan of starting with a state machine, then build actual automations on top of that. A lot cleaner and feasible to maintain and extend over time.

input_select:
  waschmaschine_opstate:
    name: Waschmaschine OpState
    icon: mdi:washing-machine
    options:
      - "Off"
      - "Standby"
      - "Scheduled"
      - "Active"
      - "Finished"
    initial: "Off"
automation:
  - id: "1609362853001"
    alias: Regel Waschmaschine verbraucht 0.04W (Off)
    trigger:
      - platform: numeric_state
        entity_id: sensor.waschmachine_strommessgeraet_power
        below: 0.1
        for: "00:03:00"
    condition:
      condition: not
      conditions:
        - condition: state
          entity_id: input_select.waschmaschine_opstate
          state: "Off"
    action:
      - service: input_select.select_option
        data:
          entity_id: input_select.waschmaschine_opstate
          option: "Off"

  - id: "1609362853002"
    alias: Regel Waschmaschine verbraucht 0.4W (Standby)
    trigger:
      - platform: numeric_state
        entity_id: sensor.waschmachine_strommessgeraet_power
        above: 0.3
        below: 0.5
        for: "00:01:00"
    condition:
      condition: state
      entity_id: input_select.waschmaschine_opstate
      state:
        - "Off"
        - "Scheduled"
    action:
      - service: input_select.select_option
        data:
          entity_id: input_select.waschmaschine_opstate
          option: "Standby"

  - id: "1609362853003"
    alias: Regel Waschmaschine verbraucht 0.4W (Finished)
    trigger:
      - platform: numeric_state
        entity_id: sensor.waschmachine_strommessgeraet_power
        above: 0.3
        below: 0.5
        for: "00:01:00"
    condition:
      condition: state
      entity_id: input_select.waschmaschine_opstate
      state: "Active"
    action:
      - service: input_select.select_option
        data:
          entity_id: input_select.waschmaschine_opstate
          option: "Finished"

  - id: "1609362853004"
    alias: Regel Waschmaschine verbraucht >3W (Active)
    trigger:
      - platform: numeric_state
        entity_id: sensor.waschmachine_strommessgeraet_power
        above: 3.0
        for: "00:01:00"
    condition:
      condition: not
      conditions:
        - condition: state
          entity_id: input_select.waschmaschine_opstate
          state: "Active"
    action:
      - service: input_select.select_option
        data:
          entity_id: input_select.waschmaschine_opstate
          option: "Active"

  - id: "1609362853005"
    alias: Regel Waschmaschine verbraucht 2.9W (Scheduled)
    trigger:
      - platform: numeric_state
        entity_id: sensor.waschmachine_strommessgeraet_power
        above: 2.8
        below: 3.0
        for: "00:05:00"
    condition:
      condition: not
      conditions:
        - condition: state
          entity_id: input_select.waschmaschine_opstate
          state: "Scheduled"
    action:
      - service: input_select.select_option
        data:
          entity_id: input_select.waschmaschine_opstate
          option: "Scheduled"
  - id: "1609362853006"
    alias: Regel Waschmaschine fertig Benachrichtigung
    trigger:
      - platform: state
        entity_id: input_select.waschmaschine_opstate
        from: "Active"
        to: "Finished"
    action:
      - service: notify.mobile_app_thopn
        data:
          message: Die Waschmaschine ist fertig
          data:
            tag: waschmaschine

How to link my switch.blitzwolf_shp6 to your sensor and automation

Try changing this line in the Template Sensor:

        {% set p = states('sensor.washer_power') %}

to this:

        {% set p = states('sensor.blitzwolf_shp6_energy_power') %}

It’s based on the assumption that your switch.blitzwolf_shp6 has an associated entity called sensor.blitzwolf_shp6_energy_power. If it’s called something else then use that name.

1 Like