Automation triggering based on set value - Tumble Dryer Predicament

Hi!

I have a tumble dryer where I’ve used a Shelly Plug to notify me when the power usage goes below 250W (which is when the tumble dryer is finished). The problem is at this point it starts an hour long Anti Crease program which then, sporadically, runs the drum once or twice again at which point the automation triggers again.

My solution would be the trigger to set a value “Dryer.Done” to “1” at first trigger and then have “Dryer.Done” = “0” as a condition for the very same automation to run in the first place.

I would then have another automation set “Dryer.Done” to “0” when the power usage is >600W or something similar (since this only happens when the dryer is started).

Edit. A simple solution could also be to somehow prevent the trigger from triggering again within 90 minutes of the first trigger… would this be easier? And if so how would this be realized?

How would the above be applied? Or is there an easier solution.

Cheers!
/Kalle

If you know the timing you want to check if the automation has ran in the last x seconds use below in your condition.
This example uses 7200 seconde (2hours).

condition: template
value_template: >-
  {{ (utcnow() | as_timestamp - state_attr('automation.Automation_name', 'last_triggered') | as_timestamp) | default(0) | int > 7200 }}

1 Like

The other solution is to use a threshold sensor, which basically does what you describe. It is one of my most used helpers. The hysteresis helps you to set the limit for on different than for off. So for instance the binary sensor goes on when the power is above 600 and of when below 250. In this case use an upper limit of 425 and a hysteresis of 175. Then the sensor will go on above 425+175 and off below 425-175. Then set the notification to go off when the threshold sensor goes from on to off.

1 Like