Hi Everyone,
I’ve spent some good amount of time up until now and seems I’ve hit a wall, so decided to post the problem here to start discussion and exchange of thoughts.
I have 7 Danfoss Living connect (zwave) radiator thermostats. I set the target temperature on them and they do the job of keeping the room temperature as set and they work fine, connected them, all is good.
My ultimate goal is to have different types of temperature in all the rooms, i.e.:
- Away temperature at -16 degrees
- In temperature for the day - 22 degrees
- In temperature for sleep - 19 degrees
but will come back to it later on.
I also have Xiaomi door/window sensor so whenever the window is opened in the room, thermostat is switched off automatically (i.e. temperature set to 16 degrees). Obviously it works the other way round as well - when all the windows are closed in the room, then the heating is put on (but I need to distinguish, what exatly temperature type should be set which is one of the problems).
The problem I am facing now is that with only that few variables, the number of condition I need to program grows exponentially. If I wanted to add human body sensor, then another level of complexity arises.
Anyway, I noticed, that if my automation is not just a simple on at 16:00,off at 23:00, then I need to check all the time if current temeprature is set correctly.
As a solution I ended up with following:
I have 3 input_boolean switches:
- night_bool_switch:
- day_bool_switch:
- daynight_bool_switch:
(inptu_boolean.day_off_indicator below indicates if it is a weekday, but I work from home. I set it manually on the UI)
Each of them is switched on based on specific script:
alias: Check night temperature trigger
trigger:
- platform: time
minutes: '/15'
seconds: 00
condition:
- condition: or
conditions:
- condition: time
after: 21:30:00
before: 08:00:00
weekday:
- mon
- tue
- wed
- thu
- fri
- condition: time
after: 22:00:00
before: 09:30:00
weekday:
- sat
- sun
- condition: and
conditions:
- condition: state
entity_id: input_boolean.day_off_indicator
state: 'on'
- condition: time
after: 22:00:00
before: 08:30:00
action:
- service: switch.turn_on
entity_id: input_boolean.night_bool_switch
–
alias: Check day trigger
trigger:
- platform: time
minutes: '/15'
seconds: 00
condition:
- condition: or
conditions:
- condition: time
after: 16:00:00
before: 23:45:00
weekday:
- mon
- tue
- wed
- thu
- fri
- condition: time
after: 08:00:00
before: 23:45:00
weekday:
- sat
- sun
- condition: and
conditions:
- condition: state
entity_id: input_boolean.day_off_indicator
state: 'on'
- condition: time
after: 08:00:00
before: 23:45:00
action:
- service: switch.turn_on
entity_id: input_boolean.day_bool_switch
–
alias: Check daynight temperature trigger
trigger:
- platform: time
minutes: '/15'
seconds: 00
condition:
- condition: or
conditions:
- condition: time
after: 16:00:00
before: 09:00:00
weekday:
- mon
- tue
- wed
- thu
- fri
- condition: time
weekday:
- sat
- sun
- condition: state
entity_id: input_boolean.day_off_indicator
state: 'on'
action:
- service: switch.turn_on
entity_id: input_boolean.daynight_bool_switch
Then, when the switch changes state, I would execute required script:
alias: Enable Leona
trigger:
- platform: state
entity_id: input_boolean.daynight_bool_switch
to: 'on'
action:
- service: script.heating_leona_on
- id: s001-3
alias: Disable Leona
trigger:
- platform: state
entity_id: input_boolean.daynight_bool_switch
to: 'off'
action:
- service: script.heating_leona_off
with the following scripts:
heating_leona_on:
sequence:
- condition: and
conditions:
- condition: state
entity_id: binary_sensor.door_window_sensor_158d000130e59b
state: 'off'
- condition: state
entity_id: binary_sensor.door_window_sensor_158d00014db5e6
state: 'off'
- condition: state
entity_id: input_boolean.heating_daynight_bool_switch
state: 'on'
- service: climate.set_temperature
data:
entity_id: climate.danfoss_z_thermostat_014g0013_heating_1
temperature: 22
heating_leona_off:
sequence:
- service: climate.set_temperature
data:
entity_id: climate.danfoss_z_thermostat_014g0013_heating_1
temperature: 18
To wrap up:
- I’ve set up automation which after each 15 minutes checks if the specific time conditions are met
- If specific time conditions are met, then the boolean switch is turned on
- Once the boolean switch is on, then specific script is triggered, which sets the temperature, based on additional non time conditions
What is the conclusion … I think this is not the optimal way of setting up my automation, so would be glad for any hints and ideas. Secondly, I would like to have “global variables” for different temperatures, so when I want to change e.x. away temperature, I don’t have to change it in every single script.
Eventually, I would like to set different temperature depending if it is a sleep time or occupancy time, but currently I can do it by repeating all non time conditions.
On top of above, I wanted to introduce motion sensor, to not disable heating for next 30mins if there is a body movement, but going this way seems to be more complex than required, I feel.
Anyone have any suggestions for improvements? Can anyone share their projects?
Is there any simpler way of setting above?
Thanks everyone and all the best
Marcin