#idea Thermostat - Final

This posting is the conclusion of my initial discoveries of the Wio Link Computer since it arrived 4 days ago. Here is an update on the Thermostat project where I use every Grove module - all six and every API method - both polling with POST and GET and event API with websockets. While it is not a true thermostat it does switch off the fan if the temperature is above a set point so it is only an open loop controller. This project is still a proof of concept and can be simplified - its true purpose is to discover the capability of Wio Link.

The set point is set by the rotary encoder and push button while the display toggles between a display of temperature and humidity (TT:HH) and temperature and set point temperature (TTSS). I am also using the Grove BMP085 Barometer module to measure altitude, pressure and temperature and a Grove Temperature ad humidity module to measure temperature and humidity. Everything is tracked with a node-red user interface modules and the results are displayed on any Chrome web browser so you can see all the variables graphed on gauges and charts there. The user interface is from the node-red library.

I am also using a state variable ‘tempSP’ for temperature Set Point and this is a node-red global variable that is accesible to all tabs of the node-red canvas. I need to add some hysteresis on the temperature control - easily fixed. When the set point temperature is reached both a 220V wifi power switch for the fan and a local LED on a Grove LED module come on. To save power WioLink is put to sleep every 30 secs. The push button uses event programming so events are not lost when you press the button. After you press the button the display - using a Grove 4 Digital Digit module uses both the measured and set point temperatures. This project demonstrates every API technique and interface - analog, digital, serial and I2C interfaces are used.

The node-red program is on a Beaglebones Green (BBG) computer using a Debian OS. The BBG also has a Grove cape which can expand on the IO if necessary or it can handle extra Wio Link computers on the same node-red flow or on different tabs on the canvas.

So how would you turn this into a real thermostat? Just add a pid controller - there is already one already for node-red. You also need a controllable variable such as air conditioners power to adjust temperature rather than using bang-bang and open loop control. This is another project and I will be using an infra red blaster interface that allows me to control an air conditioner directly. The future project will have 1) control multiple rooms using a single controller but multiple sensing points - one for each room so many air conditioners in the house can be controlled (simple scaling), 2) PIR sensing so that energy will be saved if no one is in a room (I have done this already on a separate WioLink Computer)and 3) measure the cost of electrical power consumption (I am already doing this with a python script - just need to interface it.

So how did the Wio Link computer and platform perform? Very well and the cloud APIs did the job. I enjoyed using the Android app and the only problem was the app failed when I have multiple instances on the phone, table and also on a iPad - only one instance is allowed. Everything was easily achieved with node-red programming including a couple of extra simple javascript nodes and a single state variable. I enjoyed doing this project.
DSC_0540.JPG
Flow1.jpeg
Flow2.jpeg
Flow3.jpeg
Flow4.jpeg
Flow5.jpeg
State Variable as a global Set Point.jpeg
UI.jpeg

I have 2 questions:

As am a beginner with node-red in order to get the temperature from wio link and send it to Thingspeak I will do the following:

1.Add to the flow an HTTP request with get and url the one from Wio Link (iot.seeed.cc/v1/node….)
2.connect a json node
3.Connect a Function node (do I have to put code in there and if yes, what should I put?)
4.Connect a debug node with msg.payload AND an HTTP request with POST and api.thingspeak.com/update?api_key= (with the write key of my channel, having added temperature and humidity and some other fields)

It doesn’t get data because I miss something,can you help me please?

2nd question: You mention and show a picture of the UI in chrome.To what are you referring to?