Need ideas on how to recognize a particular melody from washing machine to log an event

My washing machine plays a particular melody while the wash program cycle completes. I need ideas on how to recognise this in home assistant (with help of additional hardware like espHome, RPi, etc).

I want to recognise this event of wash cycle completion in home assistant so as to get notified about it.

Would´t it be much easier to use a smart plug that measures electricity usage? Once usage drops, cycle is finished?

1 Like

This is the easier way to do it and how I do it for my combo, I just setup the automation to monitor the current usage values for each phase of the cycles with the addition if its been on for x time and the door has been closed for the same time to send a notification that the washing is done when I am not home.

Here is the base version that I have saved to work with, folks will just need to adjust the values to what their one is for the main cycle they use:

alias: Washing Machine Automations
description: ""
triggers:
  - type: current
    device_id: 
    entity_id: 
    domain: sensor
    id: Washing Machine Idle
    above: 0.1
    below: 0.5
    for:
      hours: 0
      minutes: 5
      seconds: 0
    trigger: device
  - type: current
    device_id: 
    entity_id: 
    domain: sensor
    id: Washing Machine Running
    above: 2.5
    below: 7
    for:
      hours: 0
      minutes: 5
      seconds: 0
    trigger: device
  - type: current
    device_id: 
    entity_id: 
    domain: sensor
    id: Washing Machine Off
    above: 0
    below: 0.1
    for:
      hours: 0
      minutes: 10
      seconds: 0
    trigger: device
  - type: opened
    device_id: 
    entity_id: 
    domain: binary_sensor
    trigger: device
    id: Washing Machine Door - Opened
  - type: not_opened
    device_id:
    entity_id: 
    domain: binary_sensor
    trigger: device
    id: Washing Machine Door - Closed
conditions: []
actions:
  - choose:
      - conditions:
          - condition: trigger
            id:
              - Washing Machine Idle
        sequence:
          - data:
              title: Washing Machine
              message: Washing is done.
              data:
                notification_icon: mdi:washing-machine
            action: notify.mobile_app_rkphone
      - conditions:
          - condition: trigger
            id:
              - Washing Machine Running
        sequence:
          - data:
              title: Washing Machine
              message: Washing is running.
              data:
                notification_icon: mdi:washing-machine
            action: notify.mobile_app_rkphone
      - conditions:
          - condition: trigger
            id:
              - Washing Machine Off
        sequence:
          - data:
              title: Washing Machine
              message: Washing Needs to be taken out.
              data:
                notification_icon: mdi:washing-machine
            action: notify.mobile_app_rkphone
      - conditions:
          - condition: trigger
            id:
              - Washing Machine Door - Opened
        sequence:
          - type: turn_on
            device_id: 
            entity_id: 
            domain: switch
mode: single

Hi,
Thanks for the reply.
I already did that but that data not very helpful as during some stages like water filing, draining, etc. the power level go down for a good period of time. I had an idea that if I put a timeout, so that the power levels does not risen after that timeout, it would declare that the wash cycle is complete. But this way there will be a long delay to get notified about it.

Furthermore, if I can get melody recognition working then I can get many additional signals from the washing machine like wash program start signal, signal to put softener during rinse cycle, signals on errors, etc.

You can add in a vibration sensor to the mix and say if both the current is below x threshold and there is no vibration from the machine for x time then consider the cycle complete.

The other option is to find a way to mod in a ESP32 setup to grab the data feed from the machine and put it into HA that way when its not a smart one that has the option already.

This will be prohibitively difficult. Audio tone recognition is HARD.

It took Smartmusic YEARS to get this working with a basic microphone to listen to elementary school students practicing recorder (and tbh it’s STILL not 100% great at it source: entire family is music Ed.)

Your only hope at all AFAIK is if you have an LLM that can accept audio files and is trained to listen for tones and return a response and unless you have a decently large model like full gpt4.o it probably won’t do it right. You could train a custom model (something like how microwakeword does it) to listen SPECIFICALLY for that tone but it’s a ride to get that set up to build and train the model.

1 Like

Unhelpful for your present issue, however if you machine plays “Die Forelle” (The Trout), you have a Samsung. :slight_smile: :musical_score:

With some trepidation, I recently bought a new Samsung washer drier, and after unblocking tracking domains briefly only for registration, the SmartThings HA integration works well with all of the rich detail you might need.

The SmartThings integration does go via the Samsung cloud, but AdGuard has most exfiltration blocked (I hope… certainly my Samsung TV doesn’t like not being able to talk to the mother ship).

CES 2025 has shown the first Matter-enabled white goods machines so there is hope for the NEXT machine to be local only.

Is there an LED indicator for each step?
Someone on esphome discord did hook up an esp to those leds to get the current washing state

2 Likes

With esphome. Wire the speaker to the analoge input and measure/log what you get with each melody. Use this high/low pattern for your trigger

Shazam app? Maybe something similar exists?

Thank you everyone for sharing your thoughts and ideas.

Meanwhile, I think I found something here Voice recognition module.
In the product description, they say that the module can be trained to recognise any sound.

anyone ever worked with such module?

Presently deploying this till I get solution for sound recognition.

Thanks.

1 Like

I had a thought of this too but the control and display panel is not easy to tamper. :slightly_frowning_face:

If that module don’t work maybe this is worth a try.
I’m using a esphome adapter version of this to recognize when someone press the door bell intercom
https://iotassistant.io/esp32/smart-door-bell-noise-meter-using-fft-esp32/

its a bit more coding involved but if you want to try it i can clean up my code a bit, this is what i can pick up when i play:
https://www.youtube.com/watch?v=2vMBLxaKYX0

This is the dominant sound frequency with 22627Hz sample rate, this is the bucket number to get the real frequency multiply with 22.

[08:48:53][E][custom:428]: peaks 9,7,7,12,9,9,8,9,13,9
[08:48:53][E][custom:428]: peaks 9,9,8,8,7,5,8,3,14,8
[08:48:53][E][custom:428]: peaks 8,7,8,13,7,10,9,9,11,12
[08:48:53][E][custom:428]: peaks 13,12,13,17,10,6,8,9,10,12
[08:49:06][E][custom:428]: peaks 100,99,99,99,99,99,99,10,10,10
[08:49:06][E][custom:428]: peaks 10,10,11,10,10,11,11,9,13,125
[08:49:06][E][custom:428]: peaks 125,125,125,113,10,112,112,112,100,100
[08:49:06][E][custom:428]: peaks 99,99,99,99,99,99,10,10,10,6
[08:49:06][E][custom:428]: peaks 9,9,83,84,84,84,84,84,84,84
[08:49:06][E][custom:428]: peaks 84,84,84,84,84,84,84,88,88,88
[08:49:08][E][custom:428]: peaks 88,88,99,99,10,10,9,112,11,10
[08:49:08][E][custom:428]: peaks 77,75,75,75,75,83,84,84,84,84
[08:49:08][E][custom:428]: peaks 83,88,84,88,88,83,84,84,84,84
[08:49:08][E][custom:428]: peaks 84,84,84,84,84,84,84,84,84,83
[08:49:08][E][custom:428]: peaks 84,99,99,99,99,99,99,10,10,10
[08:49:08][E][custom:428]: peaks 10,11,10,99,98,99,99,99,99,99
[08:49:11][E][custom:428]: peaks 100,12,10,12,11,10,9,10,9,9
[08:49:11][E][custom:428]: peaks 9,10,125,125,125,125,125,10,112,112
[08:49:11][E][custom:428]: peaks 10,112,10,99,99,99,99,99,99,99
[08:49:11][E][custom:428]: peaks 10,11,10,11,5,10,10,10,11,10
[08:49:11][E][custom:428]: peaks 4,10,134,10,10,10,3,9,11,10
[08:49:11][E][custom:428]: peaks 9,11,10,10,11,150,150,150,150,10
[08:49:14][E][custom:428]: peaks 125,125,125,125,125,11,10,112,11,112
[08:49:14][E][custom:428]: peaks 125,125,125,125,125,11,11,11,10,11
[08:49:14][E][custom:428]: peaks 11,10,134,11,10,10,10,10,9,11
[08:49:14][E][custom:428]: peaks 10,11,10,10,10,10,10,10,10,9
[08:49:14][E][custom:428]: peaks 9,10,10,11,11,10,10,9,10,10

not to hard to write a some code that can recognize some patterns in that.