I have 2 triggers.
The first should trigger when there is an excess of 2000 W.
The second should be present when a certain time is reached.
If I put both trigger in their own automation, everything works.
But as soon as I make both into an automation, the solar trigger is no longer executed.
That leading underscore is problematic because I would be surprised to learn that Home Assistant created it like that. When creating a slug, it typically removes/converts non-compliant leading characters.
Ah thanks the typo i have to change, but was not the issue
Argh yes the underscore was the issue. Think was an issue with replacement. Added now: sensor.geschirrspuler_porgramm_duration → yes programm i have to fix as well
But it doesn’t work as expected. Once the trigger has been executed, it takes about 10-15 minutes until it is executed again. Is that normal?
A Template Trigger will trigger when its template reports true after having reported false. It will not trigger again until the template reports false first and then changes to true. It’s the change from false to true that serves to trigger it.
What happens if the condition returns false? Does the trigger still have to return false first?
In my example, is this for both triggers together or is each trigger considered individually?
This is impractical for the solar use case. Is there a trick/workaround to reset it periodically every 15 minutes?
My second use case is: I have a group of hygrometers to measure humidity. If one in the group reaches the max value (>60%) a message will be sent. If a second hygrometer in the group reaches this value, no more messages will be sent as long as the 1st value is still over >60%. Do you have a good idea how solve this?
What happens if the condition returns false? Does the trigger still have to return false first?
Yes. What happens in the automation’s condition has no bearing on the Template Trigger’s behavior.
The Time Pattern Trigger may have a fixed interval but the automation can have a condition. It’s the combination of trigger and condition that determines if the automation executes its actions.
Maybe I’ll start from the scratch and describe the use case.
The automation should start when the power grid produces more than 2000 W or a certain target time (depending on the program) is reached.
The “other” conditions are something like: door must be closed, remote control must be on, program must be selected.
I tried to put this in an automation so that I can reuse the “other” condition and not duplicate them.
The solar grid trigger will not work, if it is permanently above -2000, i.e. i need a trigger with time pattern or on the solar grid state change. Therefore the check solar grid -2000 must be a condition and not a trigger. My objective was to reuse this “other” conditions for both cases:
target time reached + other conditions
or
polar grid reached + other conditions
Currently I can only achieve this by duplicating it a)in two automations or b) duplicating in the code condition block.
Is it possible to reuse the other condition somehow?
Is there a completely different approach to my problem?