User avatar
rurwin
Forum Moderator
Forum Moderator
Posts: 4257
Joined: Mon Jan 09, 2012 3:16 pm
Contact: Website

Re: Smart Thermostat

Sat Jan 05, 2013 2:23 pm

It's very feasible. There are plenty of threads on here on controlling relays, and also on temperature sensors (search for DS18S20). There is electronics involved, but fairly simple. You should probably have a qualified electrician look it over and install it, because you need to be covered if something happens to it.

I am reminded of an old saw my boss once told me: "No password survives for more than two weeks if there is a night-shift." Students count as a night-shift; they will try to hack it. Disable all local logins and protect SSH with a key, not a password. Put it in a tamper-evident box, and have spare boards ready to replace "failed" units.

elvisimprsntr
Posts: 131
Joined: Sat Dec 29, 2012 11:36 pm
Contact: Website

Re: Smart Thermostat

Sat Jan 05, 2013 2:26 pm

SuperDave156 wrote:Hi all,

I have a number of student houses that I rent out. The monthly rent includes all bills so I often go into a house in the middle of the day and find no one home but it is sweltering hot with the thermostat turned up to full!
I need a solution to replace the conventional thermostat where the Raspberry Pi monitors the temperature and periodically logs itself onto my website, checks what temperature the house should be from a house/time/temperature database and switches the heating on or off as appropriate.
That way I could configure each house remotely from my desk.

Does this seem feasible?
I am pretty good at programming but have no experience with thermistors or relays etc.

Thanks,
David
Since your properties are rentals I am sure you would not want to install a Nest in each house as they will likely get stolen or broken, but have you considered installing less expensive radio thermostats (http://www.radiothermostat.com) which you can get from local home centers. The 3M branded CT30 is $99 at home centers. They have web portal you can use for control, but there is a documented public API for the thermostats if you want to write your own application for monitoring and control. (http://www.radiothermostat.com/document ... PIV1_3.pdf). The only downside is the WiFi module requires a C-wire to power the WiFi USNAP module, or you can use an external 24VAC power supply if you don't already have the C-wire.

I am sure you can still find a use for the RPi for example hosting your custom application for monitoring and control. If you really want to get creative you can host SiriProxy on the RPi at your home (http://www.raspberrypi.org/phpBB3/viewt ... 37&t=27529) and use voice commands to invoke custom monitoring and control voice commands. In fact the developer of the SiriProxy server, his first application was a plugin to control precisely the 3M branded radio thermostat (http://www.youtube.com/watch?v=AN6wy0keQqo). I am sure you could easily expand it's capabilities to control more than one thermostat. I implemented similar functions to control multiple IP2IR controllers and IP cameras. (https://github.com/elvisimprsntr). I created a RPi SD card image with SiriProxy already preinstalled to make is easier for people to get started. (http://sourceforge.net/projects/siriproxyrpi)

Good luck with what ever you decide.

Elvis

UPDATE As one commenter suggested, put the thermostat in a tamper proof box.
Last edited by elvisimprsntr on Sat Jan 05, 2013 2:50 pm, edited 1 time in total.
http://www.youtube.com/user/TheElvisImprsntr

Marcovaldo
Posts: 4
Joined: Fri Dec 28, 2012 6:45 pm

Re: Smart Thermostat

Sat Jan 05, 2013 2:48 pm

Hi David,

From the technical point of view I see no problems.
Also not from the hardware point of view.

The only thing is that such a solution should be well communicated with your customers.
If it is something like turning off the heating behind their backs (even if the current situation
wastes your, and at the long run, their money) they will feel like in Orwells 1984.
If you (we) can find benefits of the solution for all of us, then this might work.
- Possibly adding some kind of BT receiver so the heating throttles automatically when they leave
- Offering them a webpage or Textaddress where they can ramp up the heating before they arrive.
- If you give them part of your savings this also might convince them.
Possible scenarios
--------------------------
---- status quo (no intelligent thermostate) fixed costs for heating (covering all your expenses for
worst case, even if they leave all on)
---- Option intelligent heating:
Cost variies accordong to savings. Part of the savings given to them. This should be their
motivating bounty. Also if the heating is comfortably remote controlled from their mobile
phones they more likely will reduce heat just while sitting on the sofa.

other options would be something like a learn phase to find out the personal optimum
of the temperature (by ramping down slowly until someone presses the '+' button).
Also such a learn function should be well communicated and not something done
behind their backs and to keep them busy.

A kind of gambling soul sits in many people (see the fortune all lottery business earns...)
So using this for energy saving is to my opinion quite legitimate. So they can just try to
optimize their (and yours) savings. Why not show them a page of the student flat with the
most and least energy use (the winner gets some extra bounty?)

So, this are a few ideas.

Some more practical questions:
- How many units could that be?
- What kind of heating is to be controlled?
-- Electrical Heaters, no central control, like I have seen common in the UK
This needs some power switching located close to each of this electrical
heater. Severals of those may be remote controlled by the central smart thermostate
-- Gas/Oil fired warm water radiation heating per flat, additional conrol per radiator possible
The smart thermostat can override an existing dumb one.
-- Some kind of remote heating (external heat source delivering hot water/steam) and a
heat exchange or similar per flat/house. So controlling radiator valves would be necessary
- Where are you located?
I'm located in Austria and normally visit UK a few times every year?

Greetings,

Marcovaldo

elvisimprsntr
Posts: 131
Joined: Sat Dec 29, 2012 11:36 pm
Contact: Website

Re: Smart Thermostat

Sat Jan 05, 2013 6:29 pm

SuperDave156 wrote:Hi all,

I have a number of student houses that I rent out. The monthly rent includes all bills so I often go into a house in the middle of the day and find no one home but it is sweltering hot with the thermostat turned up to full!
I need a solution to replace the conventional thermostat where the Raspberry Pi monitors the temperature and periodically logs itself onto my website, checks what temperature the house should be from a house/time/temperature database and switches the heating on or off as appropriate.
That way I could configure each house remotely from my desk.

Does this seem feasible?
I am pretty good at programming but have no experience with thermistors or relays etc.

Thanks,
David

Also, the radio thermostats have both android and iOS apps which allow you to control multiple thermostats through the same portal account. I believe you can also change the URL in the thermostat of you wanted to set up your own portal.

Elvis
http://www.youtube.com/user/TheElvisImprsntr

simonpb1
Posts: 25
Joined: Thu Sep 13, 2012 11:25 am

Re: Smart Thermostat

Sat Jan 05, 2013 6:45 pm

looks to me like the ecobee is a zigbee based wireless control system.
The thermostat contains a zigbee node which will relay the information via wireless 2.5Ghz to a remote web portal.

I am working on a 6lowpan system that works in a similar fashion to control some roller blinds. Each blind will have a wireless MCU which has all the necessary processing power to control and monitor a motor to a desired position.

There will be a dongle which will plug into the PI and act as a gateway to the LAN/WAN.
I will be able to login to my home automation server and see the status of my blinds and have the ability to set timers so they open and close at scheduled times or operate them in real time through a web interface.

Still a way to go though but would work as a thermostat

SuperDave156
Posts: 19
Joined: Sat Jan 05, 2013 12:56 pm

Re: Smart Thermostat

Sun Jan 06, 2013 12:38 pm

Thanks for all your replies!

The heating systems are all gas fired boilers of less than 10 years old. Almost all radiators have TRVs which do quite a good job of keeping the rooms at an even temperature.
There is one mechanical thermostat that is mostly located in the hallway. The hot water is separately timed and we have this "On all time".
My plan is to place the temperature sensor inside the mechanical thermostat case which will be electrically disabled (but will still click when turned). The existing thermostat wiring will be used to connect the new sensor to the Pi that will be located in the airing cupboard next to the heating system wiring terminal block. The Pi will then make or break a relay to replace the old thermostat switch. We'll have some kind of tamper proof box to house it in. Ethically, I'm comfortable with controlling the temperature remotely. If they are cold they will certainly let us know! There is a balance to be found because if it is too cold they will use electric fan heaters...

I am a programmer of old (ZX Spectrum, BBC Model B, Windows Borland Delphi) so I have been up most of the night and have written quite a lot of the code.
I have it running at the moment reading a text file of desired temperatures every 5 minutes from my web server
0630=20
0900=19
0930=18
1000=18.5
1100=19
1200=20
1400=17.5
1630=21
1900=19.5
1930=22
2000=22.5
2330=16
checking this file and reporting what temperature it should be.
I'm writing this at 12:26 and it is reporting that it should be 20 degrees so it is working.
It also writes a history file back to the web server
...
1155=18.5
1200=20.0
1205=20.0
1210=20.0
1215=20.0
1220=20.0
1225=20.0
giving useful feedback.

Once I have the temperature sensor I will be able to compare the desired and actual temperatures and switch the relay on of off as required.

The programming has been OK but there is always a painful learning curve with any new language. Things that are second nature to me in Delphi take a bit of fathoming out in Python but I'm pleased with progress so far.

The hardware I/O is completely new to me so that will be the main challenge.

I'm happy to share my program code if anyone is interested...

David

Marcovaldo
Posts: 4
Joined: Fri Dec 28, 2012 6:45 pm

Re: Smart Thermostat

Sun Jan 06, 2013 3:38 pm

Hi,

1)
... place the temperature sensor inside the mechanical thermostat case which will be electrically disabled (but will still click when turned). ...Ethically, I'm comfortable with controlling the temperature remotely. If they are cold they will certainly let us know! ....
I personally prefer not doing tricks behind the back of customers.
Possibly you can use the existing wiring to remote sensing the thermostate switch(This provides
you with the information 'too cold'. This then might be as an input to your software.

I personally would prefer a solution then that states clearly 'The room temperature is cantrally controlled'.

2) I am also an old fashioned programmer (Turbo Pascal to Delphi, currently changing over to
Freepascal and Lazarus).
So even if I do not favour the way you plan your remote control, you might benefit from information
I will release soon about Lazarus/Free Pascal and Raspberry Pi.

Greetings,

Marcovaldo

SuperDave156
Posts: 19
Joined: Sat Jan 05, 2013 12:56 pm

Re: Smart Thermostat

Sun Jan 06, 2013 9:42 pm

Thanks Marcovaldo,

I have no ethical worries. These students don't care about my houses. They have wild parties where they break doors off and punch holes in walls. They leave all the windows open (to let the weed smoke out) with the heating on full. the place is always filthy and the cleaners need persuading to go in. We used to have a comedy show about students called "The Young Ones". Real life is even worse!!!

Yes Delphi is great and I have done a lot of enjoyable programming with it too. I'll check Lazarus but I decided to try Python as it seems to be the favoured language on the Pi.
David

tarafisherhitaltech
Posts: 12
Joined: Thu Sep 26, 2013 9:50 am

Re: Smart Thermostat

Thu Jan 02, 2014 4:35 pm

Hi All,

Not sure if it's of interest from a product development point of view but with regards to mounting the Raspberry Pi on a DIN Rail we have recently launched an enclosure specifically to meet this need.

It is available via CPC...
http://cpc.farnell.com/hitaltech/25-041 ... 20Products

Kind Regards,
Tara Fisher
Hitaltech UK Ltd

jemtaylor
Posts: 20
Joined: Sat May 25, 2013 1:37 pm

Re: Smart Thermostat

Mon Feb 09, 2015 4:35 pm

Hi,

Check out my blog. I've built pretty much exactly what you describe - a Pi controls the CH and HW and reads temperatures via sensors dotted round the house. They communicate with the Pi via serial radio links and they're pretty cheap. The batteries in the sensors last around a year.

Here's the original build:
http://fudgetech.blogspot.co.uk/2013_09_01_archive.html

And here is the write up of adding temperatire sensing:
http://fudgetech.blogspot.co.uk/2014/07 ... since.html

cheers

Jeremy

chickey
Posts: 63
Joined: Thu Jan 05, 2012 11:17 am

Re: Smart Thermostat

Mon Mar 16, 2015 11:24 am

I've finally started to resurrect the work on my Pi heating project, i've had the parts sitting in a box for two years but have suddenly found myself with a lot of time on my hands so thought i'd start it up again. I've gotten further than i did than when i attempted it many moons ago. I have also purchased a XRF temp sensor and gotten the XRF relay board to work successfully and found some great example python code which i plan to modify and put a web interface on hopefully. At the moment my system consists of a raspberry Pi, XRF relay board with a single relay as i'm only going to be controlling the heating on my boiler as it's a combi boiler so no hotwater control possible. I then have a XRF temperature sensor which i'm using for sensing the temp. I am using the following example code by a guy called rob

http://bazaar.launchpad.net/~robmh/llap ... runk/files

With this and the parts above you can have a ready to go headless system but it's not got a pretty front end, great for actually seeing something happen quickly though.

After i get this working i plan to possibly looking into wiring a temp sensor directly to the pi (have a 1 wire dallas) and then use the XRF temperature sensor in combination with energenie controllable sockets to control a panel heater in my conservatory so that i can have some temp control in there as currently it only has a timer and nothing else.

Oh i do have an LCD i was planning on using for displaying the temp/status at a glance but i'm thinking something bigger might be nicer such as a colour touchscreen but want to get something working first before i jump in with more costs.

If anyone is interested i can put it on my blog but i will be the first to say I've relied heavily on other people's sources and examples so it would be more a case of pulling these examples together.

Colin.

Return to “Automation, sensing and robotics”