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.