First of all, the first time condition is redundant because the second one already includes all times greater than 06:30:01.
Imagine this scenario:
The time is 05:00 and the temperature is 11.
At 06:00 the temperature decreases to 10.
It triggers the automation which checks the condition. It’s not after 06:30:01 yet so the action is not executed.
The temperature continues to decrease but it doesn’t trigger the automation again. Why not? Because that’s how a Numeric State Trigger works. It only triggers at the moment the value crosses the threshold. If the value continues beyond the threshold, (continues decreasing below 10) it doesn’t cause another trigger. It would have to first rise above 10 then fall below it to cause another trigger.
You will need to redesign your automation to make it work the way you want.
When you manually execute an automation it skips the trigger and the condition and simply runs the action section.
@123,
Yes, I thought about it too.
My idea is to adjust temperature to 24.5C in time periods:
between 17:30 and 23:00 (evening)
and
between 6:30 and 9:30 (morning)
I’ve been trying to desing with different options, but I understand that time it works recursively with mentioned exact time frames.
I can try to bind to sunset+couple of hours (don’t know if it works as I need), but I was wondering if there’s any way to stick to static time.
This one (with fixed time frames) does not work either.
The Default condition is not executed if Time is beyond the set frame in two conditions.
Strange…
It doesn’t work because it is virtually the same logic as the first example (which also failed to work) I suggest you read my explanation again (in my previous post) to understand why it fails. If it’s still unclear, let me know and I’ll help you redesign it.
@123,
I understood. HA treats condition after 6AM and after 7PM as same (after 6AM anyway), but how would you recommend to program my simple task?
Use Input Boolean or timer?
This sensor just triggers automation in cold weather (below 10 degrees). When it’s higher than 10C, - no need to turn off Thermostat at all.
Now it is always below 10C, and Automation triggers everyday at time frames in Condition settings, but is may vary depending on weather/temperature.
The temperature never rises above 10. It’s always below 10. That’s why the Numeric State Trigger is never triggered. It’s not working for precisely the reason I explained in my first post.
It only triggers at the moment the value crosses the threshold . If the value continues beyond the threshold, (continues decreasing below 10) it doesn’t cause another trigger. It would have to first rise above 10 then fall below it to cause another trigger.
Would this help? Trigger every 15 minutes, but with a condition that temperature is below 10. Then handle the time frames in choose conditions. Remember to also handle the case when you get outside your time frame and you need to switch off the heating.
That’s better but if the temperature is below 10 during a time range, it will execute the same service every 15 minutes. Not terrible, but not great either.
Also, your Numeric State Condition isn’t written correctly.
This automation is basically a schedule. At certain times of the day, it sets the thermostat to a specific mode but only if the temperature is below 10. That means the automation simply needs Time Triggers added to the existing Numeric State Trigger.
Writing without HA, so this may need some corrections. Trigger to each start and end time of your time frame. Also trigger to temp going below 10. This way you can switch on your thermostat even when the temp limit was not reached at the start-time of your time frame.
alias: 'Climate: Хоз.спальня, зимнее отопление Вкл вечером и утром'
description: ''
trigger:
- platform: numeric_state
entity_id: sensor.bme280_temperature
below: 10
- platform: time
at: '19:00:00'
- platform: time
at: '22:00:00'
- platform: time
at: '06:00:00'
- platform: time
at: '08:00:00'
condition: []
action:
- choose:
- conditions:
- condition: and
- conditions:
- condition: or
- conditions:
- condition: time
after: '19:00:00'
before: '22:00:00'
- condition: time
after: '06:00:00'
before: '08:00:00'
- condition: numeric_state
entity_id: sensor.bme280_temperature
below: 10
sequence:
- service: climate.set_preset_mode
data:
preset_mode: none
entity_id: climate.termostat_khoz_spalnia
default:
- service: climate.set_preset_mode
data:
preset_mode: eco
entity_id: climate.termostat_khoz_spalnia
mode: single
Whilst ‘choose’ has its place, since its introduction I have noticed a horrendous uptick in people making really really messy and complicated automations because they’re defaulting to choose rather than use another method (like the condition block of the automation, or a really simple template), which would often be far more efficient.
The above is a perfect example. 19 lines with a basic template, rather than 42 lines in an automation of awkwardly nested choose options from which it was generated.