more G-Labs products

Author Topic: Boiler control / Thermostat / Watchdog / Network Presence  (Read 1899 times)

August 28, 2014, 07:28:51 PM
Read 1899 times

dinth

  • *
  • Information
  • Newbie
  • Posts: 2
Hi. Im trying to make boiler control using Raspberry Pi and Home Genie. Boiler control itself and temperature monitoring will be done by GPIO, plus in future i want to make it smarter by using data from weather forecast too.
Unfortunately i believe there is no ready logic, widgets or modules which could help me with that - and i find that little bit strange, because usually boiler control is one of main tasks of home automation systems. But no worries - i can make logic myself and share it with community:) I need some help though. I have some basic python, cron, etc. skills, i could be even willing to learn CSharp, but i dont know where to start with programing. I dont need any extra hardware support though, im just using GPIO.

First of all i would need something to work as watchdog module, what checks if Raspberry and Home Genie is working properly, if not resets whole thing. Im afraid that this cannot be done in software, but who knows - quick search showed me that Domoticz R-Pi based HA system has software watchdog. Anyway, nobody would want being charged thousands of pounds for gas at the end of the month, or freeze to death overnight, only because of some software error.

Boiler control module itself.
We have two options here - first one is basic controlling of boiler using pre-set times when it should run. I believe this could be currently done by adding lots of On-Off switches on my dashboard - one for every 15 minutes in 24hours, and then making cron based task which checks if switch for current time is On, and if yes - setting "1" state on one of GPIO pins.

Another option is thermostat, which checks current temperature and if it is lower than pre-set value runs boiler. Sounds simple to make, but it gets tricky, because boiler shouldnt be On all the time until we reach desired temperature.  It should be on On-Off 15 minutes cycle until temperature reaches pre-set value +3 (to make hysteresis loop). I really dont have idea how this can be done in HomeGenie - i believe i should make some global variable if boiler should be in On-Off loop, and then another cron based task which turns it on and off every 15 minutes.

I also thought about adding presence checking using Wifi. I would need to read and parse data from network router - probably using external script in python or php, and somehow pass this data to HomeGenie - we dont want boiler running when there is nobody in the house.

Any suggestions please?
« Last Edit: August 28, 2014, 08:02:13 PM by dinth »

August 28, 2014, 07:57:21 PM
Reply #1

bkenobi

  • *****
  • Information
  • Global Moderator
  • Posts: 1525
Watchdog doesn't exist.  If you are concerned that HG is possibly broken, then that would have to be external code to check I imagine.

I would code your thermostat in a single C# code using timers or scheduled events as necessary.  Nothing like that currently exists, so you would need to code from scratch.  There are lots of code samples available at this point, so you can probably reuse snippets for some of your program.

August 28, 2014, 08:28:03 PM
Reply #2

dinth

  • *
  • Information
  • Newbie
  • Posts: 2
OK im starting, for now with wizard.
Quick question - if i will use "pause" function somewhere in code, will it safely pause just my function/one thread, or will it pause whole Home Genie?
Im thinking about using pause and while to make that 15 minutes on-off loop for boiler.
« Last Edit: August 28, 2014, 08:37:12 PM by dinth »

October 13, 2014, 02:48:36 PM
Reply #3

MickEE

  • *
  • Information
  • Newbie
  • Posts: 17
    • MikaelStenstrand.com
I'm not sure how the thread works, but for this kind of tasks its good to use the
Code: [Select]
GoBackground() method or create a function that runs asynchronously, with the function
Code: [Select]
Thread RunAsyncTask (Utility.AsyncFunction functionBlock)

More documentation about this can be found here:
http://www.homegenie.it/docs/doxy/de/d1f/class_home_genie_1_1_automation_1_1_scripting_1_1_program_helper.html#a73aaf7bc607c946fdd354a481262560a