Trigger automation from any numeric state

Hi guys,

I have this scenario. I want to monitor when the dishwasher finished by the power consumption from the plug.
Is there is any way to check the following (in human language):

if power_consumption was > 0 and now power_consumption = 0 then "do something"

Perhaps can be done with helpers but I’m still bit newbie on this.

trigger:
  - platform: numeric_state
    entity_id: sensor.power_consumption
    below: 1
2 Likes

You actually just need this part:

power_consumption = 0

It won’t trigger when it keeps being at 0.
Just make sure it actually reaches 0

Don’t think so. I have see in other automations that when looking for a specific value (the example which I had it was below a value) it keeps triggering.

It shouldn’t and I doubt it does.
What you notice is probably because the value has gone above then below again.

The automation will only trigger if the trigger goes from false to true.

in the case of the trigger being power_consumption: 0 once the value equals 0 the the trigger becomes true. it won’t become false again until the value is not equal to 0.

so if the consumption goes to and stays at exactly 0 the automation will only trigger once.

Even a change in the state from 0.0 to 0.000001 will cause the re-trigger.

So if your value fluctuates a bit (which is likely) then use the numeric state < 1 to be sure.