Building My Own Smart Central Heating Control System with a Sonoff TH16

  Рет қаралды 166,982

Cameron Gray

Cameron Gray

5 жыл бұрын

In this video I build my own smart central heating control system based around a Sonoff TH16 with my own custom software built mostly in Python deployed through Docker. The reason for this project was that I wanted a smart central heating system but didn't want it to rely on any sort of manufacturer provided cloud service.
Source Code (Very much still in development): github.com/Home-Automation-Hub
www.camerongray.me/
/ camerongray1515
AFFILIATE LINKS NOTICE:
Product links under this video marked “(Affiliate)” are affiliate links where I may receive a small commission on qualifying sales. Affiliate programs that I am a member of include, but are not limited to: Amazon Associates, eBay Partner Network and AliExpress Affiliates.
As an Amazon Associate I earn from qualifying purchases.
Purchasing through these affiliate links will not cost you any more money, however the commission earned significantly helps fund the production of videos on my channel.

Пікірлер: 177
@camerongray1515
@camerongray1515 5 жыл бұрын
Disclaimer: This system was purpose built for my own central heating system. Systems and control methods will vary between different boilers so be sure to research how your own system is controlled rather than simply replicating what I have done here. In particular you would need to take care to determine whether your system uses mains voltage contacts like mine does or if it uses volt free contacts which would require either modifications to the Sonoff or a different model of Sonoff supporting dry contacts to be used instead. If in doubt, always contact a professional before attempting anything like this.
@Herman-ge2ux
@Herman-ge2ux 5 жыл бұрын
The system really looks good!
@user-od3rl5mc
@user-od3rl5mc 5 жыл бұрын
Did you ever consider combining this with thermal actuators on your rads, controlled by a smart switch with temp sensor?
@camerongray1515
@camerongray1515 5 жыл бұрын
I considered it although didn't feel it was worth the effort for me, my flat isn't huge and I tend to leave the internal doors open so it didn't really make sense trying to maintain different rooms at different temperatures. It's also really well insulated so doesn't cost much to heat.
@AddoPro
@AddoPro 5 жыл бұрын
Hi Cameron. The video is excellent! Thanks for sharing it. Do you know how to get DRY contct / volt free from this TH16 Sonoff? I have seen some tutorials but they are not for TH10/16. It would be really helpful if you could help with this. :) Thanks in advance.
@camerongray1515
@camerongray1515 5 жыл бұрын
Thanks! It's not something I've done myself although it should be a case of figuring out how the mains wiring works inside then breaking the appropriate traces and adding in the appropriate links so that the L and N output are switched by the relay and the L and N input feed the power supply but aren't connected to the relay nor the output. A potentially easier/safer option may be to get a mains voltage contactor (essentially a relay switched by mains voltage instead of low voltage DC) that is powered by the mains output of the sonoff, you could then connect your heating system to the switched terminals of the contractor.
@MartinMeadowsEvans
@MartinMeadowsEvans 5 жыл бұрын
This is awesome. I love the software and the fact it’s expandable
@frazer26
@frazer26 5 жыл бұрын
I have hive at home, your system looks so much better even though it’s not “polished”. I like the graph plotting view. Really useful.
@norwegianstud
@norwegianstud 5 жыл бұрын
Great inspiration! I`ve seen your network installation video after I did some Cat6-cabling myself, and got this recommended today. Some time back I was looking to do something similar to four devices I have. An AC for the whole house(with built-in temp-sensor on the indoor-fan-unit) and with three thermostats(from 2006) for floor heating in two bathrooms and a cellar. Would be great to get an electrican to install some hardware and to tweak around with software to get functions like night and day-time power-saving. But solutions like that cost a fortune.
@lanvukusic
@lanvukusic 5 жыл бұрын
The UI skills impressed the most :D
@MilanKragujevic
@MilanKragujevic 5 жыл бұрын
Excellent project, and a great video as always. I love the ESP8266 chips, I use them in a few different projects in my home.
@TieDyeRich
@TieDyeRich 5 жыл бұрын
I have a very similar boiler to that and can say they absolutely hate being turned off! An amazing video.
@steveg4iwr
@steveg4iwr 5 жыл бұрын
That looks great. A fantastic project I could do to implement as my home heating is on a basic controller similar to the one you replaced.
@scottmcarthur10
@scottmcarthur10 5 жыл бұрын
This is great, this looks much more flexible and cost effective than something like Nest. Thanks for sharing.
@VAX1970
@VAX1970 5 жыл бұрын
Hive is cheaper @ £120
@dant5464
@dant5464 5 жыл бұрын
Thanks for the video, I've considered doing something like this for a while. Mainly because the timer is broken on my system, but it'd also be neat to switch it on and off from anywhere in the house (and to muck around doing it myself). Also, I have one of those USB serial adaptors and it's nice to see mine isn't the only one with a wonky USB plug :)
@trollobite1629
@trollobite1629 5 жыл бұрын
I did this a different way. I left the original programmer in place which takes care of the usual temp control and programmed settings but used a 433Mhz relay to override and interrupt the relay that switches the central heating on and off. All of this is controlled using a broad link hub, an old Galaxy s4 with voice control by Alexa. The s4 setup is fully automated using Tasker giving you endless possibilities such as Google calendar intergration, for example, when the phone battery is 100% power to the phone is disconnected and turns back on when the battery reaches 10%. Using Tasker and Alexa your programming options are limited to your ingenuity but best of all, no 3rd party websites involved so if the internet is down you still have full internal control.
@holnrew
@holnrew 5 жыл бұрын
This is so cool, I wish I had the ability to do a project like this
@alanjrobertson
@alanjrobertson 2 жыл бұрын
Great video and lovely bit of coding and hardware work there, Cameron. Nice neat installation job too 👍👍
@xer0334
@xer0334 5 жыл бұрын
Really nice software, good job!
@thomasvnl
@thomasvnl 5 жыл бұрын
The only thing you need to look out for is with InfluxDB that you set a retention span for your series data (and maybe only store daily averages for anything outside of your volatile per-reading measurement stored data). Nicely done Cameron
@jasonmhite
@jasonmhite 5 жыл бұрын
The ESP8266 is perfectly fine with 5V signals (it has clamping diodes), it's POWERING them from 5V that kills them. You can use a 5V serial adapter if it's all you have as long as you power the board from 3.3V.
@kolt9307
@kolt9307 5 жыл бұрын
Subscribed; absolute pleasure watching this video
@alejandrorodriguezdiaz8689
@alejandrorodriguezdiaz8689 5 жыл бұрын
absolutely amanzing! Great thing
@johnosborne9271
@johnosborne9271 5 жыл бұрын
Nicely done :D The sensor enclosure looks identical to the Evatron EN30 listed at CPC for £2.18
@paulham
@paulham 4 жыл бұрын
Great find
@Magnus_E
@Magnus_E 2 жыл бұрын
haha we share the same naming creativity haha. Thanks for the amazingly described video! Stay strong through these hard times, dude, take care!
@JohnWeland
@JohnWeland 5 жыл бұрын
I'd love to see some videos on setting this all up (software wise)
@emilcarr7190
@emilcarr7190 5 жыл бұрын
I was actually just thinking of making pretty much this exact thing this month...
@karlbishop9670
@karlbishop9670 3 жыл бұрын
'Im no big Clive' 😂😂 Great comment mate. Great video. Clive is a legend mind😀
@miawgogo
@miawgogo 5 жыл бұрын
I cam in to this video thinking why not use home assistant. Then you got to the software part and found your reasons very valid. Just to expand on the UI being yaml in Home assistant, Home assistant is ment to be just a state machine, the UI is currently a hack on to the state machine engine(Its changing to a purpose built ui thing, that is still configured using yaml and in a fix style). that said it is very possible to use the Web Socket API to make your own UI and keep home assistant as a state machine
@adsy124ww
@adsy124ww 4 жыл бұрын
Hi, great find! what transistor and LED did u use ?
@robertfreund7525
@robertfreund7525 4 жыл бұрын
Great job, keep up that
@Steve-ou9ed
@Steve-ou9ed 5 жыл бұрын
Hi mate brilliant video your skill level is through the roof 😁 hope you dont mind me asking can the temperature sensor record temp and humidity over time with standard firmware and create graphs
@Vynncent
@Vynncent 5 жыл бұрын
I think it would be cool to install a raspberry pi with touch screen in the hall closet to control this. Though, it would be redundant since you could just use a phone or computer to control it. On the other hand, if you have company staying in your flat for an extended period, it probably isn't that bad of an idea
@ryanmilne1987
@ryanmilne1987 5 жыл бұрын
You shouldnt use a 20a double pole switch a fused spur should of been used with a 3 amp fuse. I do really like the effort you have put in. Well done
@camerongray1515
@camerongray1515 4 жыл бұрын
The switch only serves to isolate the Sonoff so that I can power it down form firmware updates/to restart it without turning off the boiler itself. The feed to the Sonoff comes out of the boiler which itself is fed from an FCU with a 3a fuse therefore a second FCU would be redundant.
@gOrLaMiii
@gOrLaMiii 4 жыл бұрын
Nice video , does this device shows temp and humidity readings inside the google home app ?
@mrroobarb
@mrroobarb 5 жыл бұрын
Great stuff Cameron - I think a Big Clive teardown would be very useful. I've heard some bad things about Sonoffs (but maybe that's just the cheap Chinese imports?). Keep up the good work! Bruce.
@mrsideshowjack
@mrsideshowjack 5 жыл бұрын
Really cool project, I wonder if I could do the same to my heating system, its not central heating and is ceiling/floor heating with a thermostat? in each room
@EsotericArctos
@EsotericArctos 4 жыл бұрын
You definitely could do the same. It would just be a SonOff for each room rather than one Central device. To use the Sonoff in this tutorial/video you would need to be sure your heating system switched the mains power. If you have low voltage switching thermostats, you may need to explore another option such as a D1 Mini ESP8266 with a dry contact relay add on. The thing that makes the Sonoff hackable is that it uses an ESP8266 chip :)
@1kuhny
@1kuhny 4 жыл бұрын
You could put a 1k and 2k voltage divider on the tx of the USB to ttl converter. You don't need anything special on the RX. You could also use the same voltage divider for the 5v out to power it. So you can use a 5V USB to ttl without a problem
@latitudeash
@latitudeash 5 жыл бұрын
Wow... Your really knowledge able and having the guts to do it. One question, is the sensing were a reused wire from the old timer box?
@camerongray1515
@camerongray1515 5 жыл бұрын
The sensor was new, the only part that I reused was the cable from the boiler that connected to the old programmer.
@HappyfoxBiz
@HappyfoxBiz 5 жыл бұрын
IMO, the smart meters are the way to go, especially when it's 7 day forecasts, not only can it tell you the temperature outside based on your local weather station but act accordingly due to your preferences it has noticed over the months that you have used it along with zoning appropriately (we all know some rooms are warmer/cooler than others so it's not efficient to treat it like all others)... or even just turning the fan on to mix the air between zones to make it comfortable with the same energy usage as an exhaust fan For predicted hot days, the house should be cooled early rather than later and for cold days the same, for nights it should be turned off or turned down low, most current air conditioner thermostats are so stupid the energy ratings might as well be classified as "abysmal" and smart ones should have the "energy star rating" based on predictive natures Same with Gardening, no point in having a water timer for outside when it's going to rain, and maybe you would like to tell it to water more on predicted hot day mornings. I know it sounds like too much information but bottom line is this. Traditional methods of air conditioning would cost approx $20-30 more per unit above having none, where yours could slash it to approx $2-$10 more per month over having none.. basically the system would pay for itself. Yes there is the privacy issues, but as long as it isn't voice monitoring you should be fine, if it does, don't whisper dirty things into it... some dirt can't be fixed with a filter change.
@tomtalk24
@tomtalk24 5 жыл бұрын
Satisfying!
@bamdadkhan
@bamdadkhan 5 жыл бұрын
i can't get over hearing you say 'sawn-off' for the 10th time now and only later realising you're talking about the switch box and not a shotgun xDDD
@stevebishop1161
@stevebishop1161 2 жыл бұрын
I've done the same, but just used Alexa for the timer. Saved writing a new UI :)
@tsiatt
@tsiatt 5 жыл бұрын
have you considered Prometheus instead of InfluxDB? I have heard that it takes a lot of resources. Prometheus 1 was even able to run on a Raspberry Pi
@dermotdonnelly5495
@dermotdonnelly5495 Жыл бұрын
Great project but why change from the Sonoff software?
@gabiold
@gabiold 5 жыл бұрын
Possible upgrade: PID control. Depends on the building and the heating system, but it can be much more confortable than two point switching with huge hysteresis. There is no continuously variable input on the boiler to control how much power you want, but you can control the ON/OFF ratio in PWM-like fashion (pulse width modulation). The cycle time should not be choosen too short because it may lower the heating efficiency and may shorten the lifetime of the boiler. 10-20 minutes is a good start.
@h82fail
@h82fail 5 жыл бұрын
I don't think a PID would be that useful for this, wont work if its gas, and if its electric you'd need a really big relay to keep it from burning out - and if it has a pump for circulation It would probably have to be run continuously which would waste electricity. I think the better way to improve it is to add outside temperature and weather forecast, you can use the inside vs outside temp to perdict when it will need to run without waiting for the temp to cross the delta of the set temp. And you can use the forecast to see when it will warm up outside to near the set temp and decide to just not run the heat before then to save energy.
@TheFamilyHope
@TheFamilyHope 5 жыл бұрын
How did you connect to your boiler did you modify the sonoff to a dry contact or did you use the live from the sonoff to feed the boiler PCB
@camerongray1515
@camerongray1515 5 жыл бұрын
My boiler uses main voltage contacts rather than volt free ones. Out of the boiler I get 3 wires - Live, Neutral and switched live. The live and neutral connect to the input of the Sonoff and the switched live connects to the output of the Sonoff. Obviously all boilers vary so if you had one that used volt free contacts you'd either need to modify the Sonoff or use a different model such as the Sonoff 4ch Pro which has dry contacts.
@welshtony1
@welshtony1 5 жыл бұрын
Fair play I like this project. Done a great job. Think you could get it to work with Alexa or Google Home?
@camerongray1515
@camerongray1515 5 жыл бұрын
Definitely could, would just need to create a custom set of skills for it. Not something I've looked into though.
@welshtony1
@welshtony1 5 жыл бұрын
@@camerongray1515 very interesting. Iv just bought a house and it doesn't have a thermostat wired into the boiler yet (bit annoying) so iv been looking for a solution then this video pops up and it's giving me ideas haha. I may just end up just buying a normal wireless thermostat though :/
@EsotericArctos
@EsotericArctos 4 жыл бұрын
The GPIO Pin will happily drive an LED. Just use a slightly bigger resistor and limit the current on the LED that way. It just means the LED will not be quite as bright, but the LED will last longer :). Great little project. I have a system that uses a 24V drive to the thermostat so I am modifying a SonOffSV to do the job. Great thing about the SonOff SV is it has pins for 3 additional GPIO's on board also :) Have you progressed further with writing your own smarthome hub or did you give in and you to a "premade" one?
@Rickblues46
@Rickblues46 3 жыл бұрын
Great work loved the vid
@anyheck
@anyheck 5 жыл бұрын
You may want to install a dumb thermostatic control switch in parallel to your relay set at 5°C. This would be in place so that if the sonoff fails while you are away for an extended period of time the temperature cannot reach freezing and burst pipes. Heat flux from neighboring apartments would delay that type of failure.
@camerongray1515
@camerongray1515 5 жыл бұрын
Good point, I thought about this when I initially planned the project then somehow forgot all about it, think I'll pick one up. Unlikely to be a major issue since my flat is so well insulated - I've never seen it below 15c even when it's snowing but not a bad idea to have. I also considered adding a manual thermostat in series with the sonoff as an upper limit in case the sonoff gets stuck on.
@anyheck
@anyheck 5 жыл бұрын
@@camerongray1515 The over temperature limit sounds like a good idea to me too. You could likely reuse your Honeywell thermostat for one or the other roles. It will have a thermistor on the board that could be relocated to your sensor housing, if you want to go to the trouble.
@SpikeTheSpiker
@SpikeTheSpiker 5 жыл бұрын
You could also wire up thermostats around the house so you get an accurate 'house/room' temperature and get a real idea of humidity and temperature. This is something even modern thermostats don't do which I think is a massive flaw.
@jakesmith1988
@jakesmith1988 4 жыл бұрын
Looks amazing! I'm trying to download your Smart Home Hub via github but I have no idea how github works. Does anyone know how to get the Smart Home Hub working?
@camerongray1515
@camerongray1515 4 жыл бұрын
Thanks! Unfortunately the software is very much still not ready for release so there's no real documentation or support and I'm not aware of anyone else using it apart from me. If you're familiar with Python development and the use of Docker you can probably get it up and running but you'd have to really treat it as a framework to build your own system on top of rather than as a prebuilt solution. If you need something that works out of the box with a large enough support community, something like Home Assistant would be a better option.
@EsotericArctos
@EsotericArctos 4 жыл бұрын
How bright is the LED on this unit? I am looking at a ESP8266 controlled thermostat, but it is in the hall way so I was thinking of maybe a resistor to limit the current to the LED rather than switching the full 20mA to it.
@philipslater5015
@philipslater5015 4 жыл бұрын
Blue LEDs are usually very bright and will run on a few mA - 20-mA would be blinding - so 1k to 2k would be fine. The only problem would be if driving from 3.3-V, it's going to be close to the forward voltage of a blue LED. Ultrabright Red would be better
@richarddavies2902
@richarddavies2902 5 жыл бұрын
Really good video, really enjoy your content. One thing I think would be really interesting to see would be power usage monitoring in a smart home hub like that. It's annoying that the new Smart Meters don't allow you to harvest your usage data from them, this really frustrates me.
@camerongray1515
@camerongray1515 5 жыл бұрын
Yeah definitely, a future project is going to be to build a current monitor that will work off of a clamp around one of the meter tails to log power usage to InfluxDB.
@richarddavies2902
@richarddavies2902 5 жыл бұрын
That's a thought, how reliable are they though? Looking forward to seeing the video :)
@mkaltoft
@mkaltoft 5 жыл бұрын
I advice you to order another TH16 for backup - I have been running one for about 6 months to switch on/off my desktop lamp, and it suddenly died, maybe I was just unlucky, or maybe they are not that reliable.
@AlanMcGarrity
@AlanMcGarrity 5 жыл бұрын
I think I may be adapting this to turn a electric panel heater into a "smarter" heating system
@AndrewGillard
@AndrewGillard 5 жыл бұрын
I imagine that the reason the connection to the temperature & humidity sensor has 4 wires is that there are actually 3 different sensor modules you can buy for the TH10/TH16. One is the AM2301 that you used, and that's essentially the same as the very popular DHT-22 temperature & humidity sensor (I have a dozen or more of those around my house!), and Adafruit sell the AM230*2* here: www.adafruit.com/product/393. That uses a 1-wire protocol specific to the DHT11/DHT22/AM230x devices and has accuracy specs around ±0.5°C and ±3%RH. Another option is the DS18B20 which is also popular with hobbyists, also has a ±0.5°C accuracy, and uses the Dallas 1-Wire protocol (Adafruit: www.adafruit.com/product/381). However the third option is the Si7021, which actually uses I2C and therefore requires four connections (Adafruit have it on a breakout board here: www.adafruit.com/product/3251). The Si7021is marginally more accurate, at ±0.4°C and ±3%RH, but one nice advantage of that is that because it uses I2C, and therefore you have the I2C pair of signals at your pretty thermostat box, you could hook up all kinds of other I2C devices in there as well, right in your hallway, e.g. an LED driver, an I/O expander, an ADC, some kind of keypad, even some types of display such as the 1602/2004 character LCDs (connected via one of the typical "FC-113" I2C Philips/NXP PCF8574T I/O expander boards, of course) or the little ~1" OLED modules :) That said, the manufacturers of the AM2301 module appear to fit it with a 4-pin connector with pin 4 as "N/C" as well, so maybe there's another reason! kropochev.com/downloads/humidity/AM2301.pdf It looks like the PCB inside the original AM2301 is the same as yours, so I guess Sonoff just swap out the cable - or probably just get AOSONG to build them with that TRSS cable instead. I've lately been considering doing something like this myself. I live on the top floor of a 3-storey house (rented, of course!) and even though we have dual-zone central heating, the thermostat that affects the top floor is on the middle floor, and so the temperature up here has no bearing on what the thermostat senses - and of course it's not a wireless system so I can't just move the thermostat upstairs! :( My thermostat programmer module removes from its wall mount plate more easily than yours does (there's just a catch you press down with a finger just below it, and then it slides up and out), and the removable unit connects to the wiring via five fairly big, thick pins that stick out of the back of the programmer and slide into matching holes in the mounting plate. So given that this is a rented property and I'd like to avoid messing with the thermostat wiring (although I've already swapped out three lighting dimmer switches for standard switches, because LED lamps really don't like being stuck on non-LED-suitable dimmers, even at "full power"!), I've been considering making a PCB with suitable pins to fit into those connectors, putting it inside a custom-designed 3D printed enclosure to make it look a bit nicer, and then doing something similar to what you have here. Most of the time all I'd need is "it's freezing, turn the heating on for a few hours" or "oh god I'm melting, turn off already!" :) So your software might come in handy! No idea yet if my thermostat has volt-free contacts or not, though! I know that it has mains voltage behind the wall mount, but I haven't looked into the wiring schematic yet!
@adamgrayson1918
@adamgrayson1918 4 жыл бұрын
Cameron: (sat in a 23.8 degree room) "it's too hot, I'm dying" Me: (sat In a 24.3 degree room) "I'm cold" Great video though, I'm a ReactJS software dev, loved the custom dashboard, so much better & easier to use than a prebuilt system, especially since it's expandable to really anything.
@N1CH0LAS12
@N1CH0LAS12 5 жыл бұрын
I was wanting to do something like this, but then I just got a cheap zwave thermostat and linked it with home assistant.
@matt9852
@matt9852 5 жыл бұрын
I've looked into this myself....you have executed it well. However, let's say the compute workload is moved to the cloud. In the event of an outage or loss of connectivity, what happens? No heating? I like the idea of running it on something solid state like a Raspberry pi or Arduino.
@camerongray1515
@camerongray1515 5 жыл бұрын
If it was moved to the cloud then yeah there wouldn't be any heating, you could also have done something as an emergency backup such as using the button on the Sonoff to control it or by doing something like connecting an analogue thermostat in parallel with the Sonoff to act as a manual override. Being able to host everything on my local network instead of relying on a manufacturer's cloud service was the main reason for building this instead of getting something premade.
@matt9852
@matt9852 5 жыл бұрын
Yes you are right there, but for those with a minimal home server set up it would be cool to run this on a Raspberry Pi... I heard that Worcester Bosch smart controls are processed in the cloud so you could loose your heating with your internet connection! Interesting: blog.rtwilson.com/hacking-the-worcester-wave-thermostat-in-python-part-1/
@matt9852
@matt9852 5 жыл бұрын
This is also very interesting, for those with wireless controls: www.stevenhale.co.uk/main/2013/08/home-automation-reverse-engineering-a-worcester-bosch-dt10rf-wireless-thermostat/
@zemismartofficial
@zemismartofficial 5 жыл бұрын
nice video, glad to know you from youtube channel,do u want to review smart home?
@carpii
@carpii 4 жыл бұрын
Do you have an immersion heater in your water tank which you have made 'smart'? I was thinking of adding a Sonoff to power mine on and off from Home Assistant (when I need to), but its a 3kW element I'm not sure if this is sensible.
@camerongray1515
@camerongray1515 4 жыл бұрын
I've got a combi boiler so I don't have a water tank in my setup. I wouldn't trust the relay in a sonoff with a 3kW load. If I was doing it (Obligatory disclaimer that I'm in no way a qualified electrician), I'd use the sonoff to control a contactor (with a mains voltage coil) then have the contactor switch the immersion heater. For a neat installation you can get DIN rail mounting contractors that can fit inside a standard consumer unit (either in your main one or by using a small consumer unit next to the immersion heater as an enclosure).
@carpii
@carpii 4 жыл бұрын
@@camerongray1515 Ok, I will look into that. Thanks a lot for the help :)
@stevecraft00
@stevecraft00 5 жыл бұрын
Boilers have volt free contacts. How did you interface between the sonoff 230v out and the boiler terminals?
@camerongray1515
@camerongray1515 5 жыл бұрын
It depends on the boiler, my particular one uses mains voltage contacts rather than volt free ones. If your boiler uses volt free contacts you'd either have to modify the Sonoff to provide dry contacts (wouldn't be too hard) or buy a different Sonoff such as the Sonoff 4CH Pro which supports dry contacts out of the box.
@stevecraft00
@stevecraft00 5 жыл бұрын
@@camerongray1515 i ordered a th16 today and a simple contactor to get a pair of contacts for the boiler. Thats how i got round it. Overkill maybe lol but the cheapest way i could do it. And i need it urgent because my old controller stopped working.
@kippie80
@kippie80 5 жыл бұрын
C: well executed and presented! You know, that esp8266 is also totally capable of hosting its own web page, no other servers needed. Could send out mqtt & host web page. Also, I'm a fan of 'homie' for esp8266 (on github) as it takes care of bootstrapping network config. and over the air programming.
@camerongray1515
@camerongray1515 5 жыл бұрын
Thanks! I could have hosted the web page on the ESP however the idea was to make a reusable piece of software I could integrate a bunch of other devices into rather than having it restricted to just the heating. I also wanted it to be easy to expand/update the software for both the web interface and heating control logic so running that on the server with everything written in Python was so much easier than building everything in C for the ESP and then having to keep re-flashing it. Homie definitely looks interesting though, will probably give it a go for future projects or maybe rebuild the heating firmware using it at some point.
@No3Snow
@No3Snow 5 жыл бұрын
FYI battery operated stats are cheaper than mains operated stats, despite there being the more expensive 3 core and earth installed, they could of installed 2 core and earth for further cost savings
@Ed19601
@Ed19601 5 жыл бұрын
Well done, but as you bought a separate housing for the sensor you might as well have bought a bare dht22 sensor module or ds18b20
@camerongray1515
@camerongray1515 5 жыл бұрын
I could have done although the Sonoff one also included the cable and 2.5mm TRRS jack - getting the whole assembly saved a lot of hassle.
@LSF315
@LSF315 5 жыл бұрын
Smart.
@IsHeMad
@IsHeMad 4 жыл бұрын
Hello Cameron, i would like to do this project, but i dont understand the hardware issue. My boiler just requires a simple switch, but the TH16 switches mains to your boiler. Can you advise!
@camerongray1515
@camerongray1515 4 жыл бұрын
My particular boiler uses a mains voltage contact to the thermostat so switching mains with the Sonoff works fine. On the other hand if your boiler uses a "zero volt" or low voltage contact you would either need to modify the sonoff to have "dry contacts" or use the switched mains output of the sonoff to power a contactor then use the contactor to switch the boiler.
@Olmirz
@Olmirz 2 жыл бұрын
Great video! Have you considered calculating the dew point based on the RH and temperature values?
@darrencoyle3290
@darrencoyle3290 4 жыл бұрын
Hi Cameron , I am interested in using a sonoff with the temp sensor to control a circulation water pump that turns on a pump when a certain temp is reached and off after it runs and the temp falls..basically a pipestat ..can I get live feed back of temp from the sensor and can i set up a high and low set points. Is it possible to hack the software to does this..
@camerongray1515
@camerongray1515 4 жыл бұрын
I haven't used the default sonoff software at all but would be totally possible to write it yourself. I wrote my own Arduino firmware for it which essentially is a big continuously running loop that executes your code. Would be pretty easy to on each loop iteration read the temperature then switch the relay accordingly.
@rvvince3296
@rvvince3296 5 жыл бұрын
super !!!!
@protectaa
@protectaa 5 жыл бұрын
i got the sonoff th 16 but im a bit confused as im unknown in this area is the power from the heater that powers the regular thermostat enough for the sonoff? I can't seem to power the sonoff on with the Red Blue wires that run from the heater. Do I need a seperate power supply for it?
@camerongray1515
@camerongray1515 5 жыл бұрын
I can't really advise on your specific setup without it in front of me. Bear in mind this install was done for my own heating installation which is likely very different to yours. If in doubt contact a heating engineer/electrician - You're dealing with mains electricity, if you get it wrong you're potentially not just going to be looking at a broken Sonoff!
@protectaa
@protectaa 5 жыл бұрын
​@@camerongray1515 Thank you. Well my old thermostat is still working. Its an on/off heater (gas). Its just that there is 34 volt on the wire and I figured it wouldn't be enough to power. It reads 90-240 volt but I'm not sure if 90 is the minium to power it on. Do you know how much volt you have on your sonoff? I'm not too worried about breaking it as im insured.. imgur.com/a/sFqPJ6J is a pic of it
@camerongray1515
@camerongray1515 5 жыл бұрын
The sonoff is a mains voltage device, mine is running off a 230v mains supply, it's not designed for a low voltage system like yours without modification to work as a dry contact relay. My system uses a mains voltage thermostat so this was a drop in replacement. Insurance or not it's seriously not worth the risk if you aren't sure about what you're doing. I'm not worried about a broken heater here, if you get something wrong with mains electricity we could be talking about serious shock or fire. If in doubt please contact a professional or buy an off the shelf smart thermostat.
@protectaa
@protectaa 5 жыл бұрын
@@camerongray1515 thank you ill let it be then, props for the response
@jaromanda
@jaromanda 5 жыл бұрын
While I wouldn't recommend testing the theory, I've read that the GPIO on the ESP8266 are 5v tolerant - and it's only TX (RX on the ESP8266) that would be exposed anyway, not both TX and RX
@totalkiller4
@totalkiller4 5 жыл бұрын
i think the AAs are so it keeps the programs in the event of a power outage
@kbhasi
@kbhasi 5 жыл бұрын
With the fact that it uses a standard ESP8266, that means it could be reworked to connect to Adafruit IO instead of Sonoff's service, though, to be fair, both services are IFTTT compatible. Also, I can understand if you decided not to replace your existing heating programmer with one of those Nest things, of which the UK version is apparently wireless.
@moth.monster
@moth.monster 5 жыл бұрын
Did you even watch the video? He replaces the firmware.
@MichaelFlatman
@MichaelFlatman 5 жыл бұрын
25:16, go easy on your central heating water temperature, higher temps reduces efficiency in condensing boilers like yours.
@mahdihajjaj
@mahdihajjaj 5 жыл бұрын
From where i can get the sensor plastic holder to hide the sensor? thanks in advance
@sajhidb
@sajhidb 5 жыл бұрын
Did you get an answer or did you manage to find one? I ned one also. Thanks
@philipslater5015
@philipslater5015 4 жыл бұрын
Made by Camden Boss available from RS quite cheaply. Just bought two (2020) to hold a Sonoff Mini sitting under my boiler so that I can remotely power it down. Also use the Sonoff timer to turn power off every night to stop diverter valve overheating/
@carminoneto9857
@carminoneto9857 4 жыл бұрын
nice man, i want to do something the same this, can you help me ?
@KolinMc
@KolinMc 5 жыл бұрын
Have you had a look at openhab or home asistant?
@camerongray1515
@camerongray1515 5 жыл бұрын
I did although neither really did what I wanted, they both seemed very much a case of configuring the existing application to work with my hardware without that much ability to make a custom UI. I also fancied working on a large software project so decided that this would be a fun one to do.
@DanNixon2007
@DanNixon2007 5 жыл бұрын
You should check out the Lovelace UI for Home Assistant, this is much more flexible than the previous/existing way to generate a UI (i.e. the UI is part of the state machine). I did have a little chuckle as you described your implementation and how almost identical it is to Home Assistant.
@sajhidb
@sajhidb 5 жыл бұрын
Can you post a digram of your sonoff wiring please? Thank you
@camerongray1515
@camerongray1515 5 жыл бұрын
I deliberately didn't include any sort of wiring diagram for the sonoff end. The wiring will vary depending on your boiler/central heating system and I wouldn't want people blindly following how I have my system wired without understanding their own system and ending up damaging something.
@frazer26
@frazer26 5 жыл бұрын
uC can sink more current than source. You probably could get away with 80mA sinking current.
@bakkersb5119
@bakkersb5119 3 жыл бұрын
tips for home assistant Integrations
@tigertoo01
@tigertoo01 5 жыл бұрын
The Honeywell controller would be battery operated in case of power outage I believe.
@stevenmilne1
@stevenmilne1 5 жыл бұрын
But if there was a power outage then the boiler wouldn't work anyway...
@JasonBryanIsAwesome
@JasonBryanIsAwesome 5 жыл бұрын
@@stevenmilne1 It's to keep the time and schedule in memory after a power outage :)
@kbhasi
@kbhasi 5 жыл бұрын
18:18 I swear that sidebar looks like it was ripped from Cockpit (for managing Linux servers)… 18:56 I really wonder if the web portion of Cockpit actually runs on Flask…
@camerongray1515
@camerongray1515 5 жыл бұрын
Flask is just the backend server, it doesn't have anything to do with the user interface. The user interface is built on coreui.io/ which itself uses Twitter Bootstrap.
@sinitronics
@sinitronics 5 жыл бұрын
I've recently switched to Home Assistant which has made my work flows so much easier. Have you looked at the new Lovelace UI much more easier to setup and you can now have custom cards on there. Might be something to look at and maybe create a hass.io plugin with your thermostat control. I'm currently working on a thermostat unit that will have a colour LCD to show heating status, set the temp and show currrent temp from a remote sensor in the living room.
@philje123
@philje123 5 жыл бұрын
Neat solution but running everything on a server seems a little overkill. You've also re-invented the wheel a little and Home Assistant would have been much easier running on a Raspberry Pi. It has a built in Cilmate/Thermostat component and provides graphs etc as standard.
@camerongray1515
@camerongray1515 5 жыл бұрын
I looked into that but it didn't really do what I wanted in terms of allowing me to entirely build my own interface with a UI that supported creation/management of timers.etc. I also fancied a relatively large software development project. I could have run this all on a Pi as well however I already had the server running for other stuff so it made sense to use it to host this as well rather than deploying another, less powerful device to run it instead.
@moojuiceuk
@moojuiceuk 5 жыл бұрын
A similar product exists here: openenergymonitor.com/wifi-mqtt-relay-thermostat/ where this can also talk MQTT back to a Raspberry Pi for additional control. I would imagine you could use several temperature sensors around the house if you wanted to, rather than just one central temperature probe.
@BaconSniffer578
@BaconSniffer578 5 жыл бұрын
14 quid for the box? Jesus screwfix must have a massive markup that
@camerongray1515
@camerongray1515 5 жыл бұрын
They absolutely do, I only bought it because I needed it last minute to get this video out on time.
@Tekwyzard
@Tekwyzard 4 жыл бұрын
For anyone else in the UK who wants to do something like this and who's rightly baulking at coughing up 14quid for a vented plastic sensor enclosure, here's quite a few alternatives equivalents from CPC cpc.farnell.com/search?st=sensor%20enclosure, which are much cheaper, even more so if you buy some other bits and bobs to qualify for free shipping.
@xellanox
@xellanox 5 жыл бұрын
Is that i3 + mate?
@camerongray1515
@camerongray1515 5 жыл бұрын
Yep! Finally discovered a Linux environment that works amazingly for me. I get all the benefits of i3 along with all the "nice to haves" such as shortcut keys, monitor autodetection, usb storage auto mounting and a central control panel working out of the box.
@xellanox
@xellanox 5 жыл бұрын
Nice, I've kind of done the same. I'm using XFCE+i3 and it's brilliant.
@gabest4
@gabest4 5 жыл бұрын
Not Big Clive, but John Ward had a series of videos on this Sonoff switch (edit: a similar one): kzfaq.info/sun/PLVsHvs2Suqmot1ADJmdhjJX43szPSx3Cj
@rajilsaraswat9763
@rajilsaraswat9763 5 жыл бұрын
Why not use a jail instead of using a bhyve instance?
@camerongray1515
@camerongray1515 5 жыл бұрын
I wanted to deploy it using docker which pretty much requires Linux.
@Lfreeman98
@Lfreeman98 5 жыл бұрын
If it has an additional unused GPIO pin, you really should have mentioned it🙄
@jucallme1
@jucallme1 5 жыл бұрын
How is that smart?
@wclifton968gameplaystutorials
@wclifton968gameplaystutorials 5 жыл бұрын
whats the point of this? Why do you need to control your heating from the internet?
@camerongray1515
@camerongray1515 5 жыл бұрын
It provides a much nicer interface than using the original programmer. It also allows me to do things like switch the heating on when I'm on my way home so it's warm when I get in or turn it off remotely if I go out and forget to switch it off. I tend to get home at wildly varying times so being able to do it remotely or use the "Switch on at x until y" feature is way more useful than setting timers on a programmer and having to change them regularly. I can even go further and build custom integrations such as automatically switching heating on/off when I leave/get home based on my phone connecting to my WiFi or even go as far as integrating it with my alarm clock app so that the heating turns on 30mins before my alarm is due to go off so that it is warm when I get up.
@MultiDollymixture
@MultiDollymixture 5 жыл бұрын
@@camerongray1515 and nerds like us love working on cool and interesting projects.
@RyanMartinez
@RyanMartinez 5 жыл бұрын
+Cameron Gray Should have just said "Because it's kewl!" lol Next question: Why do you like Apple Jacks when it doesn't taste like apples? 😉
@davefiddes
@davefiddes 5 жыл бұрын
NTP time sync and the death of daylight savings changes.
@holnrew
@holnrew 5 жыл бұрын
Just being able to control it from any room in the house is pretty appealing. Especially if you're in bed and wake up to it being a bit chilly
@VAX1970
@VAX1970 5 жыл бұрын
You should have used a FCU not just a DP switch, the device is not fused! I would suggest buying a Hive or Nest Thermostat instead, as when you sell the flat this all has to be removed. Nice project though.
@JoeRKsChannel
@JoeRKsChannel 5 жыл бұрын
Probably one on the boiler already
@camerongray1515
@camerongray1515 5 жыл бұрын
The mains connection to the Sonoff is provided by the boiler which itself is fed from an FCU in the kitchen fitted with a 3A fuse so an FCU isn't required at the Sonoff's end. Of course if I were powering it directly from a ring then yes it would need an FCU but not in this situation. I deliberately went for this over something like Hive or Nest because I wanted it to run entirely off of my own software without relying on a manufacturer's cloud service. If I sell the flat (which I'm not planning on doing any time soon) I would just fit the original programmer back in again. Removing this would be no more hassle than removing things like wall mounted TVs which would also have to be removed if I were to move.
@MrFutu8
@MrFutu8 2 жыл бұрын
Сделай мобильное приложение.
@pumpkin6429
@pumpkin6429 5 жыл бұрын
You always sound as if you're super cold. So maybe something like this is what you need. 😝
@Fatpumpumlovah2
@Fatpumpumlovah2 4 жыл бұрын
Lol till windows crashes lol
@camerongray1515
@camerongray1515 4 жыл бұрын
No aspect of this system runs on Windows, the server side of this runs under Debian Linux deployed in Docker containers - has been rock stable and hasn't crashed in the 2 years I've had this system installed.
@Schlumpfpirat
@Schlumpfpirat 5 жыл бұрын
25m video for 2m content
@eddtheduck
@eddtheduck 4 жыл бұрын
Amateur that’s all I’m saying
@camerongray1515
@camerongray1515 4 жыл бұрын
I mean, it would be more constructive to suggest what's wrong and what I should have done differently rather than blindly criticise...
@SmithyScotland
@SmithyScotland 5 жыл бұрын
You've probably invalidated your buildings and contents insurance policy.
@camerongray1515
@camerongray1515 5 жыл бұрын
Care to explain how? It states nothing about installing central heating controls or thermostats... Fitting something like this is practically the same as replacing a socket or light fitting.
@VAX1970
@VAX1970 5 жыл бұрын
Your flat's electronics would have been PAT tested which is now invalidated, which "could" affect the guarantee on a new build, but i doubt it would effect your general insurance policy, unless it caused a fire and affected other flats in the building. Check your property's lease agreement.
@VAX1970
@VAX1970 5 жыл бұрын
Some flats don't allow certain down-lights to be fitted due to fire risks between floors, i've seen that clause but nothing about heating controllers. Apparently it can defeat the fire proofing barrier.
@camerongray1515
@camerongray1515 5 жыл бұрын
It's not a new build so the only remaining warranty is for major structural issues. Definitely doesn't affect insurance as long as the work complies with the regulations which this does. As you said all it could do is affect the warranty on electrics in a new build. Minor pedantic note, PAT testing is for "portable appliances" not entire installations. There will supposedly have been testing carried out but given the number of stupid flaws I've found on original electrics (metal back boxes on light switches not earthed with earths shoved in a choc block behind the switch and a loose live connection to an original socket.etc) I don't have much faith in how much care was carried out with the original installation. Downlight wise there are regulations where certain environments require fire rated downlights to maintain the fire properties of the ceiling. In my case I technically don't need them as the fire barrier is the concrete ceiling, not the plasterboard drop ceiling. That said, I have fire rated downlights anyway since they barely cost any more.
@VAX1970
@VAX1970 5 жыл бұрын
Sorry i meant (EICR) testing
Was I Wrong About The Sonoff NSPanel Pro?!
13:25
Everything Smart Home
Рет қаралды 199 М.
I Can't Believe We Did This...
00:38
Stokes Twins
Рет қаралды 70 МЛН
버블티로 체감되는 요즘 물가
00:16
진영민yeongmin
Рет қаралды 104 МЛН
This PoE Zigbee Coordinator is Perfect for Zigbee2MQTT & ZHA!
24:24
How to DIY Install a Smart Heating System: Drayton Wiser
30:53
Charlie DIYte
Рет қаралды 123 М.
Is the Shelly 1 better than the Sonoff Basic?
14:17
The Hook Up
Рет қаралды 473 М.
SuperHouse #33: Sonoff Mini and S55: ALMOST perfect
27:48
SuperHouseTV
Рет қаралды 223 М.
Sonoff Basic Smart Switch turns anything into a smart device
11:09
This Budget Network Cable Tester is AWESOME! - Noyafa NF-8209S
30:07
Reverse Engineering Smart TV Remote with Logic Analyzer
13:26
Matt Brown
Рет қаралды 16 М.
Installing a Super Compact Home Network & UniFi Protect CCTV Setup
32:07
cute mini iphone
0:34
승비니 Seungbini
Рет қаралды 6 МЛН
GamePad İle Bisiklet Yönetmek #shorts
0:26
Osman Kabadayı
Рет қаралды 524 М.
КРУТОЙ ТЕЛЕФОН
0:16
KINO KAIF
Рет қаралды 1,6 МЛН