Washer says a cycle has finished when I reboot HA

Here’s my automation:

alias: Laveuse - Cycle terminé
description: ''
trigger:
  - type: power
    platform: device
    device_id: 4728b2f034842419b9708bb82572fcb9
    entity_id: sensor.priselaveuse_energy_power
    domain: sensor
    below: 10
    for:
      hours: 0
      minutes: 0
      seconds: 30
condition: []
action:
  - service: media_player.play_media
    data:
      media_content_id: dit lavage terminé
      media_content_type: routine
    entity_id: media_player.echo_du_salon
mode: single

My original issue is every time my HA is restarted, after some times (I would say between 30 minutes and an hour), it plays once by itself and that’s what I’m trying to prevent.

Wait, it triggers 30 minutes after startup? That’s strange. If was triggered specifically by a reset caused by startup I would think it would play the sound around 30 seconds after startup, not 30 minutes.

What does its power usage look like during standby? Does it spike above 10 periodically? Maybe the threshold should be increased a bit?

Another option is you could create a second automation that sets an input_boolean to true when the power level is above 10 for 5-10 minutes (i.e. when you’re definitely sure the washing machine is running). Then add a conditional to your “washing machine done” automation to only trigger when that input boolean is true (and set the input boolean back to off in the action). This is pretty similar to Jason’s suggestion above tbh but if you use a different input_boolean then you don’t have to literally turn off the switch, just turn a virtual switch on and off instead.

sensor.priselaveuse_energy_power reports its value in its state and not in any of its attributes (the definition of the two terms can be found in the documentation for the State Object). Basically, state is mandatory but attributes is optional.

Either of the following two ways can report an entity’s state value. The second one is the preferred way to do it.

{{ states.sensor.priselaveuse_energy_power.state }}

{{ states('sensor.priselaveuse_energy_power') }}

All state values are strings (with a maximum length of 255 characters). That means if you want to use it in a calculation, you must convert it to either an integer or a float (floating point number). For example:

{{ states('sensor.priselaveuse_energy_power') | int * 100 }}

In contrast, an attribute’s value is not limited to being a string and (for all practical purposes) does not have a length limit. An attribute can be an integer, floating point number, string, list, dictionary, etc.

I thought I tried that

{{ states('sensor.priselaveuse_energy_power') }}

and it didn’t work but just tried it and, it works. Must have done something wrong, hence why I come here :smiley:

This automation worked. After a restart, didn’t get a message that a load had finisned…

In configuration.yaml

binary_sensor:
  - platform: template
    sensors:
      laveuse:
        value_template: "{{ states('sensor.priselaveuse_energy_power') | float > 10.0 }}"

In automation.yaml

alias: Laveuse - Cycle terminé
description: ''
trigger:
  - platform: state
    entity_id: binary_sensor.laveuse
    to: 'on'
    for: '00:30:00'
condition: []
action:
  - service: media_player.play_media
    data:
      media_content_id: dit lavage terminé
      media_content_type: routine
    entity_id: media_player.echo_du_salon
mode: single

Thanks all for your help.