HestiaPi - Open Smart Thermostat

by gulliverrr in Circuits > Sensors

21680 Views, 282 Favorites, 0 Comments

HestiaPi - Open Smart Thermostat

case1.JPG
IMG_5511.JPG
Screenshot_2014-01-23-03-05-33.png

/* First instructable here, so be nice :) */

Okay, there are too many open source home automations out there but whenever I tried to look into making any of these I ended up with a bitter taste because of one or a few of the following reasons:

  • The software part was open but the hardware was based on boards either too complicated to produce myself economically or simply proprietary that I could only buy ready
  • The sensors/parts were too expensive
  • It was too ugly for my living room

So I started from scratch by listing my requirements:

  • It has to be open source and open hardware as much as I can
  • It should not rely on external web/cloud/log servers
  • I want to control heating independently
  • I want to control hot water independently
  • I want to be able to monitor and control it over the internet (from work basically)
  • I want to be able to add more functionality later
  • I want to be able to control it "old-school" with its buttons and screen while in the house without the need of a smartphone at hand
  • I want to be able to not only schedule it for regular usage but also to manually override it and set my own

With all the above requirements and after some prototyping, experimenting, failing and experimenting again I decided:

  1. RaspberryPi should be the main board running plain old raspbian
  2. A cheap 1602 LCD display should be enough for my needs
  3. 4 buttons should be enough (Heating boost, Hot water boost, Temperature+, Temperature-)
  4. A custom shield-type board should be produced compatible with most RasPi variants/versions
  5. A pretty enclosure should be purchased to stay pretty - so this will be the non open source part of this ible, sorry (I'm working on a 3D printed case)
  6. Its name will be HestiaPi - derived from the Greek goddess of home hearth, warmth and heating

So What Is HestiaPi?

IMG_5573.JPG

So what is HestiaPi?

  • HestiaPi is a box, similar to what many home thermostats look like
  • You fix it on the wall where your old thermostat used to be
  • It connects to your old heating/hot water wiring
  • It connects to the Internet over WiFi
  • Inside it is a credit card sized computer running Linux
  • No additional system is running anywhere else on the internet and no other computers are required to run any other programs. Everything is hapening right inside that box!

Sounds fun? Let's build one! Here is what you will need.

Hardware

  • 1 x RaspberryPi (version A, A+, B, B+ and B2 are all fine but prefer B2 as its faster) - 27GBP
  • 1 x 4GB MicroSD card (Full SD if you plan to use an old RaspberryPi A or B) - 4GBP
  • 1 x Power supply for mains that provides 5V and at least 2Amp - 5GBP
  • 1 x HestiaPi shield - 24GBP or make it yourself
  • 1 x Enclosure box - any that fits (don't need to buy ours 22GBP)
  • 1 x USB WiFi dongle (optional) - 6GBP

Total: 36GBP for our makers - 88GBP for the lazy people

Software

All the programs running are stored in the MicroSD card and inserted inside the RasPi. The only configuration you need to change is your WiFi network name (SSID) and password.

So let's start!

Quick Setup (for the Experienced Makers)

IMG_5611.JPG
IMG_5578.JPG
IMG_5582.JPG
IMG_5574.JPG
pcb.png
Screenshot_2014-01-23-03-05-33.png

For those who just want it done follow this guide. The rest who want all the details visit the next step.

4GB MicroSD card

Download the image file first and write it on the card (instructions)

Once all is done, leave the card to the side and move to the HestiaPi shield.

HestiaPi shield

Double-sided PCB file (GitHub) in PDF, Gerber and SVG formats (Fritzing format, more info here)

Components list PDF.

Assemble

  1. Insert the SD card inside RasPi
  2. Push the HestiaPi shield on the RasPi aligning the first pins first (pin1 and pin2)
  3. Push the relay module to snap in place with the HestiaPi shield*
  4. Connect USB WiFi dongle
  5. Connect power
  6. Wait for boot
  7. Find HestiaPi's IP (see next step if you don't know how)
  8. Open your browser to this IP

* Please note that the reset function requires a 2 pin female header to be soldered on Raspberry Pi (on A+, B+ and B2 models).

We have skipped the wiring to your home as if you don't know how to do it yourself it is best for everyone to leave it to a professional or someone who does know. The relay module offers two independent volt-free changeover contact relays so you decide what is best for you.

Detailed Setup

IMG_5584.JPG
IMG_1022.JPG
IMG_5531.JPG
casing_demo_800.JPG
IMG_5105.JPG
IMG_5109.JPG
IMG_5108.JPG
IMG_5107.JPG
IMG_5117.JPG
IMG_5112.JPG
IMG_5110.JPG
IMG_5114.JPG
IMG_5115.JPG
IMG_5118.JPG
IMG_5106.JPG

This is just the previous step but with more details this time.

4GB MicroSD card

The fastest way to get all the needed files inside your card is by copying what is called an *image* file that I have prepared. This is a different process to just copy-pasting the files from your computer and it will not work by simply doing that. It requires one additional little program that you may already have and a computer.

Download the image file first (3.9GB) from the bottom of the page and then follow the detailed instructions from the link on this page for Linux, Windows or Mac on how to write it on the card.

Once all is done, leave the card to the side and move to the HestiaPi shield.

HestiaPi shield

You will need to make a double-sided printed circuit board (PCB) for this step. Instructables has a ton of ideas on how to make PCB, the cheap way, or in very professional level depending on how much time you have and what finishing quality you are aiming for. I am not going to go into details on how to make PCBs here as its out of scope. Please do your googling if you are a beginner.

No matter what method you choose though you will need at least one of the available formats I have prepared for you. Copper, silkscreen and mask layers are all there!

Once the PCB is ready, get your shopping list (HTML | PDF) for all the components needed.

Final step is to solder all the components* following the Label ID each one has and finding it on the silkscreen map on each side of the PCB. Please note that some components are very small and you may need tweezers. Again, learning how to solder is not what this 'ible is about so practise first or visit a local hackerspace/fablab where people usually help each other learning new skills.

Case

The case can be a tricky part. You need to fit everything together, make an opening for the screen, the 4 buttons, the 2 LED and the reset button. Ideally you will also need to move the temperature sensor to the furthest possible from sources of heat like the CPU of RasPi and the power suppy module. It is also good practice to have one surface of the sensor in direct contact to the outside air to get the best reading of the room temperature (see photo). Buying the case is the easiest way but the whole point is making *your* case the way you want it. There are cases where people may embed it inside cupboards or whatever their house has to offer. Your imagination is the limit! 3D printing it is of course the way ahead and we will soon have sketch files for you ready to print yourselves.

Assemble

  1. Insert the SD card inside RasPi
  2. Push the HestiaPi shield on the RasPi aligning the first pins first (pin1 and pin2). See previous step photos
  3. Push the relay module to snap in place with the HestiaPi shield*. See photos here
  4. Connect USB WiFi dongle
  5. Connect power
  6. Wait for it to boot
  7. Find HestiaPi's IP (see next step on how to do that)
  8. Open your browser to this IP

* Please note that the reset function requires a 2 pin female header to be soldered on Raspberry Pi (on A+, B+ and B2 models).

We have skipped the wiring to your home as if you don't know how to do it yourself it is best for everyone to leave it to a professional or someone who does know. The relay module offers two independent volt-free changeover contact relays so you decide what is best for you.

Configuring HestiaPi

ethernet.png
557dfa3f50e1b63b61000aeb.jpeg
557dfa852e7fb6e1db0011ce.jpeg
557dfacf15be4de88a00078c.jpeg
557dfbae50e1b6afec00019e.jpeg
557dfbb467400c8f2000001b.jpeg
Cropped.JPG
Workspace 1_007.png

Finding HestiaPi's IP

I hope you know what does IP mean :) You don't need to know much more about networks.

If you are not familiar with the way RasPi works this part can be tough but we have made this very easy for you. All you need is an Ethernet cable (see photo).

Open HestiaPi's case and connect one end to HestiaPi's Ethernet port and the other end of the cable to your laptop.

Once this is done open your browser on your laptop and enter this address.

http://myhestiapi.com:8080

If you don't have an ethernet port at your laptop connect it to the device that provides your home network. This is usually your WiFi modem. Then try any of the following:

http://192.168.1.32:8080 or http://192.168.2.32:8080

STEP 1:

Click on "Configure Client".

STEP 2:

Click on "Scan for Networks" and wait for the scan to complete.

STEP 3:

Click on "Connect to this network" next to the name (SSID) of your network.

STEP 4:

Enter your password (1) and click Save (2).

STEP 5:

Wait for the WiFi settings to be saved successfully (1) and write down the address shown (2). This is HestiaPi's IP address, i.e. 10.10.10.52. We got it!

STEP 6:

You can now remove the Ethernet cable and have your laptop connected to your WiFi.

It is advisable to restart your HestiaPi now simply by removing its power, waiting a couple of seconds and reconnecting it. HestiaPi needs about 1 minute to start for the first time. Once it starts check the screen. It should show your WiFi network name and the IP address we found from Step 5. If the screen goes dim, press any button to light it up again.

STEP 7:

All the hard work is now over! Head over to that address from Step 5 and you should see your HestiaPi alive for the very first time!

HestiaPi - the Web Interface

557e025d4fbadea18a0009ad.jpeg
Screenshot_2014-01-23-03-07-09.png

The main page of HestiaPi is almost self explanatory. Here is a short "user's manual"

  1. Current time
  2. Current room temperature (it was Summer during this screenshot :) )
  3. Reduce desired temperature by 0.5 degree
  4. Increase desired temperature by 0.5 degree
  5. Desired temperature
  6. Current Heating status - Grey means OFF, Red means ON
  7. Current Hot Water status - Grey means OFF, Red means ON
  8. Manual boost/override for heating
  9. Manual boost/override for hot water

Manual boost is the way to ignore the schedules and start right now the heating or the hot water. It can also be used if schedules is not your thing.

Both manual boosts, once pressed, bring out a popup to ask you for how long you will want it on. To save you time, your last choice is already selected so if you want the same as last time, just press "Toggle" (see screenshot). Within a couple of seconds the following will happen:

  1. You will hear a click from HestiaPi meaning the function is enabled
  2. The LCD on HestiaPi will lit and a countdown will show how much time is left for the override
  3. The indicator on the web interface (6, 7) will turn red
  4. A countdown next to the manual override button will show how much time is left for the override

You can cancel the manual override anytime by pressing the same button.

HestiaPi - Up and Running! [VIDEO]

Now Thats What I Call Open Source HestiaPi
IMG_5511.JPG
Screenshot_2014-01-23-03-07-45.png
Screenshot_2014-01-23-03-09-00.png
Screenshot_2014-01-23-03-09-12.png
IMG_5100.JPG

That's it! HestiaPi is successfully installed and set up.

You can now use it with the buttons and screen (old-school) or from your phone.

The web interface allows you to also setup complicated schedules.

Schedules like "every weekday morning have hot water at 8am and set the temperature at 21C from 8am to 9am". This can be set in 1 step!

HestiaPi also supports groups of schedules so that you can group individual schedules and enable or disable them all at once. This can be very handy for people with shift works so that they can have one group for working mornings and another group for evenings. That way they can enable whichever they want with one click!

The web interface allows you to check and change some settings. You can also check for available software upgrades. More features get added all the time!

As it is open source you can easily hack it to do what YOU want it to do, like our friend Nancy who hacked the web UI to control its Christmas lights instead (see video below)!

Feel free to ask any questions you may have as I understand it is a bit complicated project involving both software and hardware (which is the best mix for my taste :) ). All your questions and comments or suggestions help us get better so keep them coming and we will try to answer all of them!

Troubleshooting

Here is a short troubleshooting guide for the common problems. Use the forum on our website for further assistance.

Problem: I start HestiaPi but nothing happens even after 3 minutes.

Solution: Sounds like there is a problem with the SD card. Make sure you followed the steps about writing the contents of the card correctly. Repeat the process if necessary. Make sure all connections are good. Make sure RasPi lights blink for the first minute.

Problem: myhestiapi.com does not work
Solution: This website is a tool available only during setup with an Ethernet cable connected directly to HestiaPi

Problem: myhestiapi.com does not work

Solution: Make sure you have DHCP enabled in your Ethernet settings on your laptop

Problem: Schedule or manual boost override for heating start but heating remains off.

Solution: Desired temperature is set to a value higher than the current one. Increase desired heating.

Problem: I start HestiaPi but the relays go crazy after about 1 minute
Solution: What actually happens is that HestiaPi thinks you press its buttons about 4 times per second so it tries to catch up with your speed. This is a common problem that can happen in 2 cases. Case 1. You were too lazy to read the instructions and you just started your RasPi with the SD card image only without the shield snapped on it. The GPIO pins (if the shield is connected) are normally pulled high, that is +3.3V reach each button GPIO when no buttons are pressed. When a button is pressed, its GPIO is connected to ground (GND, 0V). So when you have no shield attached to the Pi, it thinks that you keep all the buttons pressed as they are floating and they are not connected to +3.3V. Solution for case 1, I believe is obvious. Don't start HestiaPi before attaching all hardware. Case 2. You tried to produce the PCB yourself and you either forgot resistors R1, R2 or one of your copper tracks is not connected. Solution for case 2, is also obvious :)

Problem: All above do not cover my case

Solution: You will need to enter debugging mode by first opening an SSH connection (use PuTTY) to the IP you got from step 4.

Username is

pi 

password is

hestia

then enter the following commands

sudo service boilercontrol stop

cd /opt/boilercontrol/

sudo ./run.sh

Now you can read on the screen additional information about what is happening behind the fancy LCD and web interface. Once you are done, simply restart RasPi or type:

q, ENTER

sudo service boilercontrol start

Whats Next - Fututure Improvements

From our website (hestiapi.com/features) we try and get some feedback on what real users want. Here are some of the top requests we have so far. Each time a new development cycle starts one of the top is chosen to be implemented! Feel free to thumbs-up or suggest your own in the link above.

SmartPhone App
Native Android and iOS application for my phone/tablet to access and control my HestiaPi remotely easier than the web interface. Well that's actually very close to be launched. Here is a little teaser using OpenHAB:

Humidity
Show current indoor relative humidity. Maybe even log it and plot it against time along humidifier status and heating.

Wireless relay for remote units
My hot water is in a different room/system and I am not planing on running a cable accross the room

Wireless temperature sensor
Additional wireless temperature sensor for upstairs/bedroom

Temperature Logging and charts
Allow logging for temperature values and plot them in charts of variable period of time ideally along heating status changes.

Comfort/Eco/AntiFreeze Modes

Modes like comfort, eco and anti-freeze are very helpful

GSM SMS alternative/support

For remote homes with no fixed internet line send commands via a simple SMS

WiFi extender

Allow HestiaPi WiFi to operate in AP mode and act as a WiFi extender for rooms with poor reception