8 ms·
I Built a Smart Thermostat
- zuhayeer 6y agoLego is still so underrated. Love https://ngrok.com https://ngrok.com too, ends up being so randomly useful, one of my favorite tools.
- maksum 6y agoI previously put together something like this, but my only gripe was having the usb cable hanging down to an outlet to power the whole thing. I tried a solution by scrapping the Pi, using a nodemcu with a portable power bank and putting the node in low power mode and only regularly coming on to check for updates and to update the thermostat state, but then it became just another thing to charge, so I scrapped that too, maybe a revisit is in store.
- cgriswald 6y agoI’ve got several PoE devices in places I don’t otherwise have power. Could work for your case and generally easier to run than power.
- Skunkleton 6y agoYou might be able to run your doodad off of the thermostat wiring. I think there is 24v ac power?
- IgorPartola 6y agoTrouble with it is that they often times don’t include a ground wire. All the thermostat does is connect the power wire to the given function wire (like “fan on” or “heat pump 1 on”. I am not an expert but having installed a number of thermostats in a number of homes, all the manuals talk about the ground wire being rare and I have never seen one. If you are lucky you might have an unused wire that you can find a ground for, but I have only seen that once. Somehow when houses are wired it seems the HVAC people are very efficient with using the exact right number of wires in a single cable.
- craz8 6y agoCommercial solutions have a rechargeable battery and cycle one of the circuits occasionally to get power to recharge This can cause trouble Ecobee (probably others) provides a Doo-dad that wites into the furnace to help make this work
- kube-system 6y agoYou can always run a new one. I bought new wire at Home Depot, tied it to the old cable, and pulled it down to the basement.
- gww 6y agoThat only works if they didn't staple it to the wall or bury it in spray-foam insulation. I ended up having to run a new one but was lucky that the floor-board was under the garage. I ran a piece of cat5e as well in case there is ever an option to get a thermostat that can use it.
- IgorPartola 6y agoI have yet to see the wires that aren’t staples to the inside of walls. If it’s an option, great but IME it’s rarely an option.
- kube-system 6y agoHigh voltage wiring has to be secured, by code, but low voltage thermostat wires don’t, so it’s more likely that you can pull them.
- IgorPartola 6y agoOk but if the roughly 15 thermostats I have replaced in 8 buildings it has always been secured.
- maksum 6y agoI wasn't a fan of messing with the thermostat housing but just now after pulling it off, I think my thermostat isn't anything fancy like that, just two black load and two red line wires. It's also important to note that my thermostat connects to baseboard heaters, not an HVAC system.
- PhantomGremlin 6y agoThe following is relevant to your comment, since you I think are talking about a standard, conventional setup. In contrast, the article has a weird setup for an apartment. There are adapters you can use to work around the lack of wires. The existing wires already include power, it's the ground that's missing. The existing 4 wires to a standard dumb thermostat are: Power heat A/C fan The functions are enabled by connecting power to whichever is required. But there is a missing "C" (common) wire. So, as you discovered, smart thermostats have no easy way to also power themselves. I was lucky when I added my smart thermostat. It turned out that my 20 y/o house already had an 8 wire cable preinstalled. For people stuck with 4 wires, there are adapters available that will multiplex two control signals onto one existing wire. This lets you free up another of the existing wires to become the needed fifth C wire. Here's one setup I found with a quick search. There's even a video. This adapter requires access to both ends, viz. the thermostat and the furnace. https://smartthermostatguide.com/c-wire-venstar-add-a-wire-adapter-review/ https://smartthermostatguide.com/c-wire-venstar-add-a-wire-a...
- ufmace 6y agoThis is cool! I've often felt tempted to build something like that. I'm disappointed by how overpriced and terrible commercial thermostats are - try finding one that can actually switch from cool to heat automatically, isn't super-cumbersome to set up, and doesn't cost several hundred bucks. It's also a bit sad how hard it seems to be to get Google Home to be able to control custom gadgets. And combining Python scripts with a Spring Boot webapp - why? Seems like a good application for Flask. Why use 2 languages when 1 can do the job?
- ysabri 6y agoThis one wasn't that cheap tbh. Without the legos and with all the bad sensors I got, it cost around 130ish. I was surprised at how difficult Google Home integration it was yes. I see what you're saying. I honestly used Spring Boot just cause I'm really comfortable with it and can get something going quickly. It later on worked well for the Google Home stuff since they have examples and docs in Java/Kotlin. It also doesn't look like they have Python support.
- p1necone 6y agoThat Final Thoughts section is... odd. Stealth sponsored advertising?
- spuz 6y agoUnlikely as Pi-hole is free and can't really afford to spend on marketing. it is an excellent piece of software though.
- ysabri 6y agoNot at all! I just really liked their project and thought more people should know about it. They made a pretty complex thing really easy to setup and very reliable.
- craz8 6y agoI “upgraded” my HVAC to a super modern heat pump with fully variable compressor for efficiency. But the only thermostat that can drive it is a crappy Trane 1050 The remote thermostats can only be averaged and not switched (eg Measure Bedroom at night, Living Room & Office during day) There’s only 4 time blocks per day There’s no adjustment of start time based on outside temp. In fact, no way to say: Be at 72 at 8am when I get up There’s a ”quiet mode” to reduce speed (and noise) at night, but clearly this is on an internal timer. It will come on at 67% for up to a minute before the timed Quiet Mode Function notices and scales it back to the pre-set maximum. Sadly, I’m already awake by then. (Also, the default values at install are wrong - they have Day and Night switched) Since this is the smartest thermostat they do for this, can they at least open up the API so I can have a chance to get back the features I liked about my Ecobee? For so much money, there is so little “smart” I think I can use what APIs I have to implement the OP solution without mechanical switches, but I can not control the compressor speed directly for Quiet Mode to work
- maxerickson 6y agoAre you just supposed to run it more? Or is it hard to keep things comfortable with the inputs you do have?
- craz8 6y agoSince it’s a heat pump, the ability to heat the inside depends on the outside temperature. Warmer outside, faster to heat inside. But there’s no way to tell the system - I want 72 at 8am, you work it out. So I need to see if tomorrow morning will be 30 or 50 outside and set the start time accordingly. That’s not smart. Heat pumps aren’t great at large changes anyway, but even 68 to 70 or 72 would work for me And I also want that inside temperature to be based on the rooms I expect to use at those times: Night time, bedroom. Daytime, living room. Ecobee has exactly this function, Trane/Nexia does not
- dashundchen 6y agoHow many degrees below your occupied temperature are you setting back? I have a ground source heat pump and my understanding was to pretty set and forget unless you have multiple zones or are going to be away for a long period of time. Reason being heat pumps have variable speed compressors and setting them back forces them into less efficient higher stages, and as you mention take a lot longer to recover compared to traditional heaters. If the system is sized right it should be running it should be running below max at a relatively stable power.
- insaneirish 6y ago> “The simple stupid approach for the logic is as follows: keep the apartment temperature as close as possible to the temperature we set. This is not realistic as it would keep turning the system on and off very frequently, thus why the system needs a tolerance window.“ Certainly an accurate observation, and what is typically known as hysteresis for those playing along at home. I mention this because sometimes when you self-discover something, you struggle to identify the most common word to describe it, which can obscure lots of research and prior art about that thing. Because applications of control theory are so practical and likely to be empirically observed, it’s probably pretty common to have observations like this.
- m463 6y ago> you struggle to identify the most common word to describe it In case of temperature control, the magic word (acronym) was "PID" which I learned from a friend who set up an open-source bbq controller: https://www.raspberrypi.org/blog/heatermeter-open-source-barbecue-controller/ https://www.raspberrypi.org/blog/heatermeter-open-source-bar... https://en.wikipedia.org/wiki/PID_controller https://en.wikipedia.org/wiki/PID_controller
- wolfgang42 6y agoBang-bang[1] works fine for home heating applications, and is used by every thermostat I’ve ever seen. PID is more useful if your system requires/allows fine adjustments rather than just switching on and off. [1] https://en.wikipedia.org/wiki/Bang%E2%80%93bang_control https://en.wikipedia.org/wiki/Bang%E2%80%93bang_control
- maxerickson 6y agoWhat do they mean by "The temperature dial doesn’t work"? It seems like they might mean it doesn't control the air temperature of the HVAC, but that isn't what it is supposed to do, it's the thermostat. If they mean it's broken, well there you go.
- mhink 6y agoI am far from an HVAC expert, but I think these lines from the article help clarify the issue: > The temperature dial doesn’t work, the building controls whether its heating or cooling time. > The fluid temperature is out of our control since the building adjusts it based on the outside temperature. It doesn't sound like the device they have available is actually a proper thermostat- rather, it's just a control device for a water heater + radiator + fan. The switch adjusts how fast air is blowing over the radiator, and the dial is supposed to adjust the temperature of the fluid in the radiator. But if I understand correctly, the building sets their radiator fluid temperature for the whole building, and it sounds like the fan speed is apparently useless, so the only control the author has over their unit's temperature is whether or not the fan is on or off. So, what they built is the actual thermostat, which mechanically actuates the on/off switch based on a temperature measurement.
- wolfgang42 6y agoWhat I would expect under the circumstances you describe is that the knob controls the temperature at which the fan turns on and off. It sounds like the building installed the wrong device for the job, or didn’t hook it up properly, or it’s otherwise broken; hard to tell from the article which of those options it is.
- ysabri 6y agoNot hooked cause the valve it's supposed to turn to control the fluid in the pipes is stuck.
- maxerickson 6y agoRight, what I'm saying is that no heating system would work like that, the fluid temperature is set at the furnace (the controller might vary it based on the outdoor temperature or other factors, but it's not a directly adjustable user input). The likely function of the dial is to set a temperature where the fan turns on and off.
- wolfgang42 6y agoI’ve been in the middle of making a similar system for my own apartment, mainly out of frustration that I keep forgetting to turn the heat down at night. It’s less relevant since I’m working from home right now, but I also have plans to add geofencing to turn the heat down when I’m not there and back up again when I head home. I had the parts I need 3D printed, partly because it looks a bit nicer and partly because I need to replace the knob with one that’s easier to attach a servo to, and so needed something with a D-shaft. Designing those parts made me learn more about gear measurements than I ever thought there was to know. Like the author I went with the DS18B20 1-Wire temperature sensor, mostly because it was the first thing that came up on Sparkfun, so I’m glad to hear it was a good choice. I’m using an Arduino to drive the circuitry, sending the temperature and receiving control commands via serial over USB to my home server. This works pretty well (and allows for fancier logic than doing it all on the Arduino), but has the interesting result that when I’m compiling software the control program can get swapped out and my heat switches off (or rather, gets turned down to 55°F) until the thermostat daemon gets paged back in!
- ysabri 6y agoThe last part about the thermostat daemon is pretty cool. I set the system to always switch off when it turns on. How fancy do you plan to go with the control logic?
- wolfgang42 6y agoFor the first version I’m just doing a hard-coded daily schedule, plus a button to bump the setpoint up briefly if I get a chill. The server is still useful even for this simple setup because I can just use the NTP-synced system clock instead of having to mess around with an RTC on the Arduino, and also so I can log things for later analysis. In the long run, I have a bunch of ideas bouncing around in the back of my head that I might get around to eventually: the aforementioned geofencing, interfacing with an automatic alarm clock (also not built yet) to turn the heat on right before I get up, detecting when I go to bed rather than having a set schedule, determining my preferred temperature based on the weather (I think I mind the cold less when it’s raining), running the ceiling fan (in the summer, and maybe also to pull heat down from the loft in the winter), and so on. No idea if I’ll actually do any of them, but the option is there.
- el_benhameen 6y agoI think my biggest takeaway from this (very cool) writeup is that I'm an idiot for buying cases for all of my pi zero projects instead of digging into my kids' box-o-legos.
- KaiserPro 6y agoI had a similar problem, but I was lucky enough to be able to make more invasive changes. https://www.secretbatcave.co.uk/house/raspberry-pi-powered-thermostat/ https://www.secretbatcave.co.uk/house/raspberry-pi-powered-t... However its all reversible
- buzzert 6y agoIf anybody has a Pocket CHIP laying around, I built a thermostat out of one of those. https://buzzert.net/posts/2020-02-10-chipotherm https://buzzert.net/posts/2020-02-10-chipotherm
- spuz 6y agoI don't quite understand why he could not detach the cover of the thermostat and connect the wires of the switch directly into the raspberry pi. Would it not be possible to do this in a non destructive way?
- ysabri 6y agoYes, I thought about it and touched on it in the article. I just didn't want to mess with the control unit given how old the building is, I'm renting, and I have no prior experience in wiring electrical stuff. Also by doing like that, I run the risk of ruining something in the control unit and living without temp control until my landlord feels like fixing it.
- lloydatkinson 6y ago> The pursuit of minimizing my commute to work led me to move into an apartment with no temperature control. Given how common this is for downtown Chicago apartments with reasonable rent What kind of third world shenanigans is this?
- aequitas 6y agoIf you live in Europe, your heater highly likely has OpenTherm (which is not as open as the name suggests). So instead of playing with lego you can buy/build an otgw[0] which will MITM your heater and thermostat communication, allowing you to add your own smart solution on top. You can still use the outdoor temperature sensor (if installed), thermostat control logic, etc. But you can intercept and rewrite commands so you can set temperature, date/time and other heater/thermostat settings. And snoop on messages like internal temperatures from the heater and things like water pressure. [0] http://otgw.tclcode.com/ http://otgw.tclcode.com/
- optimalsolver 6y ago"What is it like to be a Thermostat?" http://consc.net/notes/lloyd-comments.html http://consc.net/notes/lloyd-comments.html