Using Node RED to schedule climate control

Hi All,

I’m having trouble trying to set up NR to schedule my climate control.

My basic flow is that I have two modes, Summer and Non-Summer, each with two different set-points (Wake and Sleep).

I have a toggle in HA for Summer Mode and a toggle for Away Mode. I need the scheduler to only fire for Summer mode when the Summer Mode boolean is on. I need it to fire for Non-Summer when the toggle is off. They both can ONLY fire when the Away mode toggle is off.

I’m trying to use Light Scheduler to do this but I’m having issues getting it to actually trigger the service call. I’m thinking it might have to do with my conditions.

I’d appreciate any help. Thanks!

I’m not familiar with the light schedule and since you didn’t post the flow don’t know how many different periods they trigger.

It seems there are 5 change points in total. I used simple inject nodes for each time change. Away mode would not make any changes to the thermostat. A summer/winter input boolean would switch between seasons.

[{"id":"22d27353.d53374","type":"inject","z":"35b293a2.b5aafc","name":"summer wake time","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"00 08 * * *","once":false,"onceDelay":0.1,"topic":"","payload":"65","payloadType":"num","x":320,"y":880,"wires":[["84ecd731.06118"]]},{"id":"ed72346c.86a3d","type":"inject","z":"35b293a2.b5aafc","name":"summer sleep","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"00 23 * * *","once":false,"onceDelay":0.1,"topic":"","payload":"70","payloadType":"num","x":300,"y":940,"wires":[["84ecd731.06118"]]},{"id":"20ece2f1.468196","type":"inject","z":"35b293a2.b5aafc","name":"winter weekday wake","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"00 07 * * 1,2,3,4,5","once":false,"onceDelay":0.1,"topic":"","payload":"72","payloadType":"num","x":320,"y":1060,"wires":[["fbed2e10.fbf658"]]},{"id":"3b4706c9.0176a2","type":"inject","z":"35b293a2.b5aafc","name":"winter weekend wake","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"00 08 * * 6,0","once":false,"onceDelay":0.1,"topic":"","payload":"72","payloadType":"num","x":320,"y":1120,"wires":[["fbed2e10.fbf658"]]},{"id":"97ffd70b.c1f31","type":"inject","z":"35b293a2.b5aafc","name":"winter sleep","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"00 23 * * *","once":false,"onceDelay":0.1,"topic":"","payload":"75","payloadType":"num","x":290,"y":1180,"wires":[["fbed2e10.fbf658"]]},{"id":"84ecd731.06118","type":"api-current-state","z":"35b293a2.b5aafc","name":"input_boolean.away_mode","server":"6b1110b5.183a4","version":2,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","entity_id":"","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":660,"y":920,"wires":[[],["dacb08ed.ca4bb"]]},{"id":"fbed2e10.fbf658","type":"api-current-state","z":"35b293a2.b5aafc","name":"input_boolean.away_mode","server":"6b1110b5.183a4","version":2,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","entity_id":"","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":660,"y":1120,"wires":[[],["cfbcc974.41521"]]},{"id":"dacb08ed.ca4bb","type":"api-current-state","z":"35b293a2.b5aafc","name":"input_boolean.summer/winter","server":"6b1110b5.183a4","version":2,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","entity_id":"","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":990,"y":920,"wires":[["c99a43d.259064"],[]]},{"id":"cfbcc974.41521","type":"api-current-state","z":"35b293a2.b5aafc","name":"input_boolean.summer/winter","server":"6b1110b5.183a4","version":2,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","entity_id":"","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":990,"y":1120,"wires":[[],["c99a43d.259064"]]},{"id":"c99a43d.259064","type":"api-call-service","z":"35b293a2.b5aafc","name":"","server":"6b1110b5.183a4","version":3,"debugenabled":false,"service_domain":"climate","service":"set_temperature","entityId":"climate.living_room","data":"{\"temperature\":\"{{ payload }}\"}","dataType":"json","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1320,"y":1020,"wires":[[]]},{"id":"6b1110b5.183a4","type":"server","name":"Home Assistant","version":1,"legacy":false,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true}]
2 Likes

Oh man, that was so easy. I feel like such a boob.

Thank you sooooo much!!!

Just FYI, I use a high_temp/low_temp situation in heat_cool mode. I just added two msgs to the injector node and changed the expression in the set_temperature node.

Amazing!!