Smart remote heating control 2- cottage

The day came when it was time to fire up the old trusty rust bucket with all the components in the trunk and head to eastern Finland. It’s about a six hour drive. When we (I had my daughter with me) arrived to the cottage in Kiviapaja I checked the Grafana analytics. Things started to suck. My fear realised, the Lora sensors were not able to send any data:

Oh no! #2

I tried several locations inside the cottage where I put the sensors, but nothing. I even stooped so low that I started playing around with tinfoil and duct tape trying to boost the signal somehow. It’s pity I did not take any pictures, since now in retrospect it was hilarious. We knew that this might happen, but there was nothing I could do at that moment. I would need to come back with another sensor + extra antenna, or we’d need to come up with a plan B not involving Lora tech. And another disaster stuck. I have two heaters, and I took two Shelly smart plugs with me. One of them went dark. Did not boot. What else can still go wrong? When I went to sleep that night, I was frustrated to stay the least.

Something magical happened during the night. I don’t know what. My best guess, wind was blowing and leafs dropped to the ground, IDK. Sensors were reporting data! \o/ yay!

BTW, if you have a good idea how this happened, let me know:

After that it was just setting everything up, and playing with the thresholds. Here is the data from those few days I was in the cottage. I’ve annotated some of the data, thus the vertical blue dashed lines:

After turning off the regular heating, the cottage started to cool down, but at least for now the relative humidity is under control. I’ve set the threshold to 78%, in the graph it’s around 65%.

On the chart above, you can see a spike in the relative humidity (“kosteus %”). That’s when I took a shower. We left the cottage on the 20th after 12.00 and you can see the temperature slowly drop.

Here you can see a snippet of the Node red code. It’s pretty straight forward. It checks for the sensor ID, decodes the payload. Then the code branches. In the top part, the decision to turn on the heating is done based on the treshold value. Mqtt message is sent to a broker, and the Arduino is subscribing and listening to the message. When it receives the message, it turns on the heater(s), for 600 seconds, and turns off automatically. Arduino also sends back status information and measurement on how much electricity have been used.

The bottom part of the of the flow pushes the data to Scorpio context broker and then it’s available for Grafana analytics. Why Scorpio? Why not just push it to Postgres directly? If we want to use that data somewhere else, it’s easy to query that via the NGSI-LD API.

Part of Node red flow

Here is a picture inside the cottage. Cottage has two main parts, and I tried to set up the heaters so that they’d circulate the air everywhere. They use ~800 watts each. Shelly is rated 2500 watts. The heaters run max ten minutes, and have overheating protection. They also have a “sensor” which detects if the heater has fallen over. Safety first!

Alright, in the next part I’ll show you what I did with the water pipes. Can’t have those pipes freezing and bursting. ETA for that part 4.11.2022. Kick my ass if the post does not appear.