Help with new Laundry Automations

Hello! I’m fairly new to HA, and I’m looking to replace the automation I was using in my laundry, I had a vibration sensor on the washer lid, and I would detect tilt and play an audio event on my chimes with the Jarvis voice.

I would like to re-create the same style of automation in HA, but I’m a little bit unsure where to start with the automations and the audio.

Will HA Voice Preview play the audio file?

Does anybody have good automations for washers with a power plug meter they would be willing to share? I think I need to move the vibration sensor to the dryer and use it there, it’s a 220 here in the US so a power plug is out. Any automation help would be greatly appreciated.

Hello timmay2t,

It would help if you could to provide some code so we can see what you’ve done so far… We won’t be able to help if all we have is ‘I want to do this thing with this other thing’.
It makes it much easier for us to offer constructive answers if you follow Community Guidelines #9. 11, & 14 by supplying a properly formatted configuration for the automation that you have attempted. Please share the YAML and any errors so we can see what you’ve done.

2 Likes

There are a number of good Blueprints for this kind of thing, here are links to two that I have used:

“Appliance Notifications and Actions…” by Blacky

“Notify or Do Something When an Appliance…” by sbyx


That’s what I do as well. Because the vibration sensor I have can be a little bouncy, I use a Template Binary sensor with delays to avoid false positives

Binary Sensor configuration
template:
  - binary_sensor:
      - name: Dryer Active
        unique_id: dryer_active_0001
        device_class: running
        state: "{{ is_state('binary_sensor.zb_vibration_01', 'on') }}"
        delay_on: "00:00:30"
        delay_off: "00:01:00"
        attributes:
          test: "{{now()}}"

The following is the automation that uses that sensor as its trigger. It includes a template condition to check that the dryer was active for at least 30 minutes to avoid announcements when someone is just using the dryer for a quick de-wrinkle.

alias: Notify - Dryer - Cycle Complete
description: ""
mode: single
triggers:
  - trigger: state
    entity_id:
      - binary_sensor.dryer_active
    from: "on"
    to: "off"
    for: "00:02:00"
    id: complete
conditions:
  - alias: The dryer was previously on for at least 30 minutes
    condition: template
    value_template: >
      {{ now() - trigger.from_state.last_changed >= timedelta(minutes=30) }}
actions:
  - action: assist_satellite.announce
    data:
      preannounce_media_id:
        media_content_id: media-source://media_source/local/Sound_Effects/minuet.mp3
        media_content_type: audio/mpeg
      message: The Dryer has completed its cycle.
    target:
      entity_id: assist_satellite.home_assistant_voice

Yes. It can play an audio file on its own as shown below, or as a preannounce sound as shown in the automation above.

If you have the file locally, make sure it’s in a folder set to be accessible as a media source.

You can also specify a URL for non-local files:

action: media_player.play_media
target:
  entity_id: media_player.home_assistant_voice
data:
  media_content_type: music
  media_content_id: "https://sound-effects-media.bbcrewind.co.uk/mp3/07071033.mp3"
3 Likes

There are the mentioned blueprints, but I use this simple alert based on power plug (ikea inspelning).

alias: Washer Finished
description: ""
triggers:
  - type: power
    device_id: 8a2b779325b951dc1836b239e9d5c965
    entity_id: 30797026b4d8b7b63d2e8d73b9676424
    domain: sensor
    trigger: device
    for:
      hours: 0
      minutes: 6
      seconds: 0
    above: 50
conditions:
  - condition: time
    after: "08:00:00"
    before: "23:00:00"
    weekday:
      - sat
      - fri
      - thu
      - wed
      - tue
      - mon
      - sun
actions:
  - wait_for_trigger:
      - type: power
        device_id: 8a2b779325b951dc1836b239e9d5c965
        entity_id: 30797026b4d8b7b63d2e8d73b9676424
        domain: sensor
        trigger: device
        below: 4
        for:
          hours: 0
          minutes: 5
          seconds: 0
    timeout:
      hours: 1
      minutes: 0
      seconds: 0
      milliseconds: 0
  - action: tts.speak
    metadata: {}
    data:
      cache: true
      media_player_entity_id: media_player.announcement_speakers
      message: Washer is finished
    target:
      entity_id: tts.piper
  - action: light.turn_on
    metadata: {}
    target:
      entity_id: light.led_strip_3
    data:
      color_name: green
mode: restart

I also have an iotawatt on my circuit panel, and monitor the dryer power as well.

alias: Dryer Finished 2
description: ""
triggers:
  - type: power
    device_id: 5a3338c1ec4dd446f7c275538cb2e317
    entity_id: 67b0ffde916a268ffe09a7c28073d80f
    domain: sensor
    trigger: device
    for:
      hours: 0
      minutes: 5
      seconds: 0
    above: 500
conditions: []
actions:
  - wait_for_trigger:
      - type: power
        device_id: 5a3338c1ec4dd446f7c275538cb2e317
        entity_id: 67b0ffde916a268ffe09a7c28073d80f
        domain: sensor
        trigger: device
        below: 10
        for:
          hours: 0
          minutes: 2
          seconds: 0
    timeout:
      hours: 1
      minutes: 20
      seconds: 0
      milliseconds: 0
  - action: tts.speak
    metadata: {}
    data:
      cache: true
      media_player_entity_id: media_player.announcement_speakers
      message: The dryer has finished 2
    target:
      entity_id:
        - tts.piper
  - action: light.turn_on
    metadata: {}
    target:
      entity_id: light.led_strip_3
    data:
      color_name: green
mode: restart

Thanks everybody! I think the primary question I was unsure of was the HA voice capabilities with the local files, I’ll dig in on the rest and figure it out. Much appreciated on the tips for the washer and dryer!