yes, your assumptions are correct.
The trigger is the thing that fires the automation, so every time the temperature drops below 5°, the automation fires.
However, as you correctly pointed out, the action will only execute if the condition is met.
There are other ways to to the thing you want to achieve, for example you could have the same trigger and condition - but have a wait action after turning on the lamp. You can set the wait template so that it will wait until a temperature threshold is reached (or a timeout is reached) and then turn it off.
If you want to do the whole thing more professionally you can even write a generic thermostat which will give you a nice UI item as well.
In that case Home Assistant will take care of the heating. Using services like climate.turn_on and/or climate.turn_off you can restrict it to certain times as well.
–
Hey, ja, deine Vermutungen sind korrekt.
Der Trigger löst die Automatisierung aus, also jedes mal wenn die Temperatur unter 5° fällt, wird die Automatisierung ausgelöst.
Allerdings, wie du bereits angemerkt hast, die action Befehle werden nur ausgeführt, wenn auch die condition korrekt ist (also nur ab 19:30).
Es gibt auch andere Wege das zu erreichen, bspw. ein wait template, das kannst du nach der ersten action einfügen, sodass Home Assistant wartet bis eine gewisse Temperatur erreicht wird und dann abschaltet.
Wenn du das ganze noch etwas professioneller gestalten willst, kannst du auch ein generic thermostat verwenden, das ist dann wie eine richtige Heizungskontrolle, Home Assistant schaut sich die Temperatur an und schaltet automatisch die Heizung an und aus. Mit Services wie climate.turn_on und climate.turn_off kannst du das ganze mit Automatisierungen auch zeitlich einschränken
condition:
- condition: time
after: '19:00:00'
before: '07:00:00'
- condition: time
weekday:
- mon
- tue
- wed
- thu
- fri
- sat
- sun
assuming you want to do this every day. Remove days not required, if needed.
Your trigger is another issue.
With your current config, HA will test when sensor.shelly_ht_hasenstall_temp changes and only for a duration of 10 mins. I am not sure this is what you want. You will only get a trigger when temp is < 5C and only every 10 mins. The resolution is one trigger at most every 10 minutes (providing temp < 5C) . This may be ok? I dont know what other influences you have that can alter the ambient temp - if it is just the external weather then you will be ok I guess.
All times are relative to midnight. So your condition says that the time has to be (between 1930 and midnight) and also (between midnight and 0700) at the same time. That’s not possible.
you need to make those two time conditions separate and then ‘or’ them:
condition:
- condition: numeric_state
entity_id: sensor.shelly_ht_hasenstall_temp
below: '5'
- condition: or
conditions:
- condition: time
after: '19:30'
- condition: time
before: '07:00'