ESP8266 / ESPEasy Thermostat for Domoticz
Posted: Tuesday 20 December 2016 10:45
Hi Folks, first post here. Been playing with ESPEasy on both NodeMCU and Sonoff ESP8266 WiFi switches for a while. I'm running Domoticz on a RPi3 and have also installed Homebridge and MQTT for HomeKit support (although I can't seem to get MQTT to start up correctly BEFORE Homebridge on boot).
Anyway, to the point of this post: In South Africa (where I'm from) we mostly use electric water heaters with a 100 - 200-litre cylinder. Inside the cylinder is a heating element and a thermostat. The thermostats are set once and then the element will turn ons and off as the thermostat desires. Problem is, the water heater is in the roof, and so turning the system on and off or adjusting the temperature (say downwards in summer is a PITA).
For my next home automation project I'd like to use Domoticz and HomeKit to set the temperature of, and also to turn the water heater on only when we're home. I've decided to use a NodeMCU (ESP12) running ESPEasy with a 100A Solid State Relay (SSR) and a DS18B20 on a 1m cable (which I plan to attach to the outlet pipe with thermal paste at the outlet of the water heater (it's a copper pipe so closely representative of the temperate inside the cylinder). As the SSR will be inline to the AC supply to the water heater, it will effectively 'override' the water heater (turning it off as programmed) and only up to the temperature set on the water heater's built in thermostat. I want to use it this way for two reasons: 1.) I can set a 'safe' temperature on the water heater so as to prevent it from boiling if there is a problem with my design; and 2.) if the home automation is not functional the water heater will work on the built-in thermostat as it is now. For the latter arrangement I am building my circuit so that the SSR is normally closed (so to speak).
Where I'm at now: I've configured the DS18B20 and switch on both the NodeMCU and in Domoticz, and I can read and write both respectively. I've created a virtual thermostat, but cannot figure out how to interface the input temperature from the water heater and then using the thermostat to perform the switching. I'm hoping someone here can help me write the logic in Domoticz please?
Anyway, to the point of this post: In South Africa (where I'm from) we mostly use electric water heaters with a 100 - 200-litre cylinder. Inside the cylinder is a heating element and a thermostat. The thermostats are set once and then the element will turn ons and off as the thermostat desires. Problem is, the water heater is in the roof, and so turning the system on and off or adjusting the temperature (say downwards in summer is a PITA).
For my next home automation project I'd like to use Domoticz and HomeKit to set the temperature of, and also to turn the water heater on only when we're home. I've decided to use a NodeMCU (ESP12) running ESPEasy with a 100A Solid State Relay (SSR) and a DS18B20 on a 1m cable (which I plan to attach to the outlet pipe with thermal paste at the outlet of the water heater (it's a copper pipe so closely representative of the temperate inside the cylinder). As the SSR will be inline to the AC supply to the water heater, it will effectively 'override' the water heater (turning it off as programmed) and only up to the temperature set on the water heater's built in thermostat. I want to use it this way for two reasons: 1.) I can set a 'safe' temperature on the water heater so as to prevent it from boiling if there is a problem with my design; and 2.) if the home automation is not functional the water heater will work on the built-in thermostat as it is now. For the latter arrangement I am building my circuit so that the SSR is normally closed (so to speak).
Where I'm at now: I've configured the DS18B20 and switch on both the NodeMCU and in Domoticz, and I can read and write both respectively. I've created a virtual thermostat, but cannot figure out how to interface the input temperature from the water heater and then using the thermostat to perform the switching. I'm hoping someone here can help me write the logic in Domoticz please?