Hi,
I have an automation that is very noisy. Ie it is continually triggering since I am monitoring if the amount of watts my air condition is using is being updated.
I want to prevent it triggering so often to only once per minute. How do I write a condition that limits execution only at one minute.
Here is my ‘noisy’ automation which keeps an input_boolean on if the wifi is still connected to my current sensor.
Will then prevent this triggering more than once per 5 minutes, as the automation will run for 5 minutes and only one instance will be allowed to run at a time. The max_exceeded: silent line prevents logging of attempts to run more than one instance filling up your log.
Another thing that might help is adding to: null to your state trigger so it only triggers when the state changes, and not on e.g. attribute changes (which can be often)
Thanks, although the idea is for the delay only to time out if the sensor.mr_slim_watts isn’t contactable. So having it as a single rather than reset doesn’t achieve the outcome.
I can live with it but it is noisy in the logbook as it triggers multiple times a minute.
I believe that the “last_triggered” attribute of an automation only gets set when the actions actually run so you could condition your automation on that:
Neither this template or the original one will work correctly with a brand new automation. An automation that has never triggered will lack a last_triggered attribute and cause the subtraction to fail. Given that your automation has already triggered, you won’t encounter this problem (however there is a way to mitigate the issue using a default filter).
2022-10-20 19:55:02.611 ERROR (MainThread) [homeassistant.components.automation] mapping values are not allowed here
in "/config/automations.yaml", line 175, column 19
You cannot use this.automation.livingroom_alexa_notifys_samsung_phone_not_charging.
Use either this.entity_id (I like more) or automation.livingroom_alexa_notifys_samsung_phone_not_charging.