Alarm and Heating management

In this subforum you can show projects you have made, or you are busy with. Please create your own topic.
Post Reply
Antori91
Posts: 27
Joined: Sunday 12 February 2017 18:12
Target OS: NAS (Synology & others)
Domoticz version: 3.5877
Contact:

Alarm and Heating management

Post by Antori91 » Friday 07 April 2017 9:59

Hello,

I use Domoticz for three functions:
- management of an anti-intruder alarm,
- heating management and heating cost optimization,
- weather information.

Regarding alarm, I always had in my house a high-end wired alarm but this alarm doesn't have the internet interface I had wished. In a first step, I added a Raspberry in the Alarm box with a custom C ++ program. The Raspberry is interfaced via its GPIO to the electronic alarm board and uses the Pubnub middleware to communicate with a personal Android app. This Raspberry alarm system can send Sms and email to notice alarm events. In a second step, I added Domoticz as an additional client communicating with the Pubnub Alarm channel using a Node.js program and JSON api. In Domoticz, I use the Security Panel and various Alarm light device indicators.

Regarding heating, I have electric heating with two supplier tariffs (day and night). I wanted to go further and follow from Domoticz the actual consumption (Degrees-Day algorithm) and optimize the consumption with possible stops of the heating depending at the difference of temperature between inside and outside and the period of the day (effective presence at home, night, ...). To measure the outside and indoor temperature, I installed two probes based on an ESP8266 chip and a DHT22 sensor. These probes include Arduino / C program to send measurements via Web/JSON format. To update Domoticz temperature devices, I use the JSON api with an external Node.js program which polls via WiFi the ESP8266/DHT22 sensors. This function is at on-going status. I still have to implement the electronic hardware to interface the electrical heating appliances.
Last edited by Antori91 on Wednesday 02 August 2017 12:10, edited 1 time in total.

Antori91
Posts: 27
Joined: Sunday 12 February 2017 18:12
Target OS: NAS (Synology & others)
Domoticz version: 3.5877
Contact:

Re: Alarm and Heating management

Post by Antori91 » Wednesday 02 August 2017 11:29

Update : I've deployed for each electrical heater of my house an ACS712 breakout (http://www.electrodragon.com/product/ac ... rrent5a20a) with Electrodragon ESP8266 Wifi Relay board (http://www.electrodragon.com/product/wi ... d-esp8266/) to measure consumption and manage the heater. The ESP boards read every minute the AC current its heater is using, calculate power consumption and send this power consumption to Domoticz via MQTT. Each ESP/Heater has its each virtual P1 Smart Meter at Domoticz side. For energy usage optimization, I use a script which manages the heaters using Domoticz switch selectors. When this script changes a selector level, the corresponding ESP board get it via MQTT and accordingly adapts the heating program of its heater.

To try to make sure that the heating optimization program is really effective, a script compares the total actual consumption against a theoretical consumption based on the theoretical heat loss coefficient of my house, the difference in outside / indoor temperature and a continuous heating mode. To show in a graphic mode, the actual/outlook versus the continuous/forecast heating, I use the features of the P1 Smart Meter, the script put in Usage 1 (day) and 2 (night) the total consumption and in Return 1 and 2 the theoretical consumption. Based on total power consumption and temperature difference, another script feature recalculates / checks the thermal heat loss coefficient.

All the Domoticz scripts are node.js scripts and I use Arduino IDE to program/flash the ESP8266 board.

This solution is inexpensive, less than 10 euros per heater and can use basic/regular heater (No need of new connected heater using proprietary protocol. However, your heaters need a management interface like the "fil pilote"/pilot wire)

Antori91
Posts: 27
Joined: Sunday 12 February 2017 18:12
Target OS: NAS (Synology & others)
Domoticz version: 3.5877
Contact:

Re: Alarm and Heating management

Post by Antori91 » Tuesday 12 September 2017 11:46

Antori91-DomoticZ.JPG
Antori91-DomoticZ.JPG (142.91 KiB) Viewed 309 times

uNGam3R
Posts: 41
Joined: Wednesday 24 December 2014 14:23
Target OS: Raspberry Pi
Domoticz version: beta
Location: Toulouse, France
Contact:

Re: Alarm and Heating management

Post by uNGam3R » Tuesday 12 September 2017 20:23

Thank you for this presentation, I had pleasure reading your project.
I'm running a similar project and you give me idea.

I guess you are french because ... The electrical heater are mainly used in France ... The other country are generally doing better on this point (I'm french too by the way).

What is your algorithm to compute the heating orders regarding outside temperature ?
Are you including something like a (Thermostat temp - Outside temp)*K coefficient in the PID / PI / PD heater command algorithm ?
Or is that just a check like "When outside temperature is 1 degree below the commanded temperature, I stop the heaters" ?

Anyway, thanks for sharing.
---------------------------------------
Want more about Domoticz scripts and DiY devices?
Go to ---------- http://mydomotic.blogspot.com

Antori91
Posts: 27
Joined: Sunday 12 February 2017 18:12
Target OS: NAS (Synology & others)
Domoticz version: 3.5877
Contact:

Re: Alarm and Heating management

Post by Antori91 » Wednesday 13 September 2017 11:39

Hello uNGam3R,

A short answer is the algorithm is basic today and based on the day period, the energy provider tariff ("French heures creuses/pleines tariff"), whether or not we are at home and difference of indoor/outside temperature. Notice that I do not try to regulate the heaters temperature. When they are switched ON (Eco/Confort) or OFF by Domoticz, it is in principle for a "long" period (several hours). And if switched ON, the heaters will then regulate their temperature with their own thermostat.

Actually, I'm still looking for the best algorithm for my house. This winter will be the first use of this system. I plan to try to find during this first use the most efficient algorithm using the comparison to the simulated mode of permanent heating operation based. I compute this theoretical consumption of permanent heating with the H coefficient (thermal loss). This winter, I will start with a H coeff value I have calculated based on the material building of my house. Then I will adjust this H Coeff. The system will give me the real H Coeff value versus the one I have calculated. I want to validate in particular the axiom "when you stop heating whatever the duration, you always make money"
ChauffageVSprovsion.JPG
ChauffageVSprovsion.JPG (93.69 KiB) Viewed 219 times
DegresDays.JPG
DegresDays.JPG (96.07 KiB) Viewed 219 times

uNGam3R
Posts: 41
Joined: Wednesday 24 December 2014 14:23
Target OS: Raspberry Pi
Domoticz version: beta
Location: Toulouse, France
Contact:

Re: Alarm and Heating management

Post by uNGam3R » Wednesday 13 September 2017 20:41

Well, OK.
I was doing like you in my first winter with domoticz :).
Know I have set up a PID algorithm (if you have good heater, there is no benefit from this).
Regarding outer loop I run the same algorithm than you are.
To be honest, I'm still not sure about the fact of cutting the heaters, I tried both way and the outcome was nothing outstanding ..

Some advices I can give you based on my experience :
- If you want to run an inner loop (like a PID) as short duration order < 5 min take care about the wireless communication. I frequently encountered transmission loss causing heater stuck either in ON or OFF mode ... My wireless was based on 433Mhz I don't know if Wifi is more accurate. Any I now wired all my heaters to domoticz this seems safer and this winter will be the first try of this system :).
- Take care about you temperature sensors, because they are the center of your algorithm. I mean try to anticipate the fact that it could return you 0° or a wrong value (in case of failure, or in case of bug). It happened to me and caused a full power heating during hours in my house. When I returned the house was 23° instead of 19.5°C ... So now I have a plausibility check (example : plausible = between 5° and 40°).
---------------------------------------
Want more about Domoticz scripts and DiY devices?
Go to ---------- http://mydomotic.blogspot.com

Antori91
Posts: 27
Joined: Sunday 12 February 2017 18:12
Target OS: NAS (Synology & others)
Domoticz version: 3.5877
Contact:

Re: Alarm and Heating management

Post by Antori91 » Thursday 14 September 2017 10:18

Regarding reliability and accuracy, my temperature sensors (ESP8266/DHT22) running already now for months, I'm starting to have an idea. At Domoticz side, a node.js script polls every 5 minutes the sensors and then updates Domoticz.
In case of any error (communication error at server side, unable to reach the sensors, bad value returned by a sensor like NOT A NUMBER), the script logs the error in Domoticz and ignores the corresponding value.
For the heaters monitoring, I use MQTT instead of HTTP polling. With MQTT you have automatic heartbeat monitoring. In case of a subscriber/publisher heater failure, a error is logged in Domoticz.

** ESP8266
- reliability : VERY GOOD. For months, I never get a communication failure. I never restart them.

** DHT22
- reliability : GOOD. For the outdoor one, I get from time to time (maybe one/two times per 24 hours) a NAN value. But DHT22 are not supposed to be used outdoor !
- accuracy : GOOD. For the outdoor one, I compare its reading to the official weather station (near my house) ones (via WUnderground in Domoticz ). Very often for long period of time, it is almost the same readings (gap between 0.0 °C and 1°C max, the 1°C gap is always at morning due I think my sensor is at west against a garden shed wall).
--
TempSensorsLog.JPG
TempSensorsLog.JPG (30.39 KiB) Viewed 183 times
--
TempLog.JPG
TempLog.JPG (173.98 KiB) Viewed 183 times

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests