# Central Heating/Home Control schedule. Suggestions please

**URL:** https://discourse.nodered.org/t/central-heating-home-control-schedule-suggestions-please/71552
**Category:** General
**Created:** [1 December 2022 12:59 UTC](https://discourse.nodered.org/t/central-heating-home-control-schedule-suggestions-please/71552 "2022-12-01T12:59:37Z")
**Posts on this page:** 1
**Showing post:** 1

<div class="post-metadata">

### Author: ![mudwalker](https://avatars.discourse-cdn.com/v4/letter/m/47e85d/32.png) [@mudwalker](https://discourse.nodered.org/u/mudwalker)
#### Post date: [1 December 2022 12:59 UTC](https://discourse.nodered.org/t/central-heating-home-control-schedule-suggestions-please/71552/1 "2022-12-01T12:59:37Z")

</div>

I have been thinking about this for (quite) a while, and getting nowhere fast.

I am trying to move away from using a file with a temperature for each hour of the week (basically a .csv file) to a more readable format, i.e. identifying the change events for temperature/ON/OFF etc..

After having problems with my system becoming unresponsive (several times) using the `node-red-contrib-ramp-thermostat`, and getting into trouble with the other half, I decided that using the `cronplus` node I can get the schedule in the format I need. The problem with this is that should I do a redeploy, the current required 'state' is not loaded into the flow. It is read into context, but that does not mean that the current value is what is actually required.

My aim is to end up with an easily editable event driven schedule that is stored in one file/variable/place.

My question is, does anyone have any suggestion as to how to do this without using the long inflexible .csv method?

Here is what I have so far using `cronplus`

```auto
[{"id":"ee855b993163e811","type":"cronplus","z":"8c6966a6107dcb0f","name":"LR SP","outputField":"payload","timeZone":"","persistDynamic":true,"commandResponseMsgOutput":"output1","outputs":1,"options":[{"name":"schedule1","topic":"topic1","payloadType":"default","payload":"","expressionType":"cron","expression":"0 12 * * MONL","location":"","offset":"0","solarType":"all","solarEvents":"sunrise,sunset"}],"x":410,"y":400,"wires":[["c5b67c2fa77fa613"]]},{"id":"cc10a01f25a66dc7","type":"function","z":"8c6966a6107dcb0f","name":"LivingRoom","func":"msg.payload = [\n { \"command\": \"add\", \"name\": \"0600\", \"expression\": \"0 0 6 * * * *\", \"expressionType\": \"cron\", \"payloadType\": \"default\", \"payload\": 18 },\n { \"command\": \"add\", \"name\": \"0700\", \"expression\": \"0 0 7 * * * *\", \"expressionType\": \"cron\", \"payloadType\": \"default\", \"payload\": 19 },\n { \"command\": \"add\", \"name\": \"0730\", \"expression\": \"0 30 7 * * * *\", \"expressionType\": \"cron\", \"payloadType\": \"default\", \"payload\": 20 },\n { \"command\": \"add\", \"name\": \"1000\", \"expression\": \"0 0 10 * * * *\", \"expressionType\": \"cron\", \"payloadType\": \"default\", \"payload\": 19 },\n { \"command\": \"add\", \"name\": \"1600\", \"expression\": \"0 0 16 * * * *\", \"expressionType\": \"cron\", \"payloadType\": \"default\", \"payload\": 20 },\n { \"command\": \"add\", \"name\": \"1700\", \"expression\": \"0 0 17 * * * *\", \"expressionType\": \"cron\", \"payloadType\": \"default\", \"payload\": 21 },\n { \"command\": \"add\", \"name\": \"1800\", \"expression\": \"0 0 18 * * * *\", \"expressionType\": \"cron\", \"payloadType\": \"default\", \"payload\": 22 },\n { \"command\": \"add\", \"name\": \"2000\", \"expression\": \"0 0 20 * * * *\", \"expressionType\": \"cron\", \"payloadType\": \"default\", \"payload\": 20 },\n { \"command\": \"add\", \"name\": \"2200\", \"expression\": \"0 0 22 * * * *\", \"expressionType\": \"cron\", \"payloadType\": \"default\", \"payload\": 16 }\n]\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":210,"y":400,"wires":[["ee855b993163e811","6a5d826e85828b9b","71d14181cb58fe69"]]},{"id":"1e01c124aee0dee7","type":"inject","z":"8c6966a6107dcb0f","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":200,"y":360,"wires":[["cc10a01f25a66dc7"]]},{"id":"6a5d826e85828b9b","type":"function","z":"8c6966a6107dcb0f","name":"HotWater","func":"msg.payload = [\n { \"command\": \"add\", \"name\": \"0700HW\", \"expression\": \"0 0 7 * * * *\", \"expressionType\": \"cron\", \"payloadType\": \"default\", \"payload\": 38 },\n { \"command\": \"add\", \"name\": \"0800HW\", \"expression\": \"0 30 7 * * * *\", \"expressionType\": \"cron\", \"payloadType\": \"default\", \"payload\": 23 }\n]\nreturn msg;\n\n/*\nmsg.topic = \"setProfile\"\nmsg.payload = {\n \"name\": \"hot water\",\n \"points\": [\n { \"00:00\": 23 },\n { \"06:59\": 23 },\n { \"07:00\": 38 },\n { \"07:59\": 38 },\n { \"08:00\": 23 },\n { \"23:59\": 23 }\n]\n}\nreturn msg;\n*/","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":220,"y":440,"wires":[["a59ea161b4e504ab"]]},{"id":"a59ea161b4e504ab","type":"cronplus","z":"8c6966a6107dcb0f","name":"HW SP","outputField":"payload","timeZone":"","persistDynamic":true,"commandResponseMsgOutput":"output1","outputs":1,"options":[{"name":"schedule1","topic":"topic1","payloadType":"default","payload":"","expressionType":"cron","expression":"0 12 * * MONL","location":"","offset":"0","solarType":"all","solarEvents":"sunrise,sunset"}],"x":420,"y":440,"wires":[[]]},{"id":"c5b67c2fa77fa613","type":"debug","z":"8c6966a6107dcb0f","name":"debug 90","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":560,"y":400,"wires":[]},{"id":"71d14181cb58fe69","type":"debug","z":"8c6966a6107dcb0f","name":"debug 91","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":400,"y":360,"wires":[]}]

```

TIA

---

_[View the full topic](https://discourse.nodered.org/t/central-heating-home-control-schedule-suggestions-please/71552)._
