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.
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.