-
Things that make me see (node) red...
05/10/2017 at 05:38 • 0 commentsAs I've worked on this project over the last 3 weeks or so, I have made several attempts at 2 different features:
- compressor inhibit timer, and
- refresh fan timer
You'd think these would be simple to implement, but they've been kicking my butt. I finally built a workable solution for #1, but #2 remains elusive at this time.
Most compressor-driven refrigerant systems require a minimim cycle time in order to prevent premature compressor failure. For some heat pumps and air conditioner units, 5 minutes is recommended as the minimum time for the compressor to be on before turning back off, or the minimum shut-down time before another cycle turns the compressor back on.
Node-RED has 2 built-in timer type nodes; a delay, and a trigger. The delay takes an input message, and delays it for the set amount of time before passing it to the next node in the execution path. The trigger node emits a message upon receiving an input, then waits for a set amount of time before sending a second message. This sequence could start by emitting a true, then waiting for a few minutes before emitting a false, for instance.
The compressor cycle timer needs to allow the compressor to switch from stop to run, or run to stop, then wait for the set amount of time before allowing another run change; i.e. if stopped, let it start, then wait at least 5 minutes before letting it stop again. My first attempts quickly showed that I could not directly insert the timer directly into the execution path between other logic and the compressor's GPIO pin; for instance, every time any signal passed through the path to the pin, it would trigger the delay, even if the logic were sending a run command to an already running compressor.
So I realized that I needed to loop the timer's output back into the logic function node and flip an inhibit flag there. After several attempts, I have a solution that seems to work well enough. I've also effectively dampened most sources of repeated triggers to the various GPIO outputs, which were causing some other issues throughout the thermostat logic.
As for feature #2, the refresh timer, I've given up on it for the time being. The idea is to run the fan periodically to recirculate stale air and rebalance temperatures in all the rooms, without running the compressor. In fact, the refresh cycle shouldn't run at all until at least an hour has passed without any other heat pump cycles running. I've tried a few arrangements of doubled-up delays and triggers, but none of them have worked. I think I'll have to add some code here, as well, just like the compressor cycle timer required. However, it's not a critical feature, so I'll just leave it alone for now.
-
It's been a long, long time...
05/10/2017 at 04:13 • 0 comments...but I've finally made significant progress on my smart heatpump thermostat. I got my hands on several RasPi 3's, and I'm using 2 of them for this project. I might later reduce that to the single unit I originally intended to use, but for now 2 is the ticket. I have been working with Node-RED and MQTT (using mosquitto) for most of the last 3 weeks or so, and the results are pretty nice so far.
Here's where I am now, after more than a year of nothing:
- One RasPi 3 will be connected to the heatpump via a half-dozen solid-state relays. I plan to use a PiFace Digital 2 to bridge the GPIO header to the SSRs. A Node-RED flow runs here to toggle the relays and interface with the main thermostat logic.
- The second RasPi 3 will be placed in the location of my current digital thermostat. This one will connect to a temperature sensor (planning on a SenseHAT for the time being, as well as a touchscreen LCD. A Node-RED flow runs here to send the SenseHAT environmental data out to the rest of the system, with an additional flow for testing behavior across different temperature ranges. The SenseHAT includes an 8x8 array of RGB LEDs, which I might use as an additional signal for alerts (an actual "red alert"!).
- Ubuntu 16.04 Server machine running Node-RED and mosquitto server. The main Node-RED flows run here: main thermostat logic, display UI using Node-RED dashboard, processes to retrive current weather conditions and any weather alerts for my area, display statistical graphs, and initialize some parameters. Using Node-RED dashboard, I have developed several pages to display weather conditions, 3-day forecast, some statistical graphs, and the main thermostat controls, which I can display on any browser on my network. Mosquitto/MQTT is used to coordinate data communications between the 3 component systems.
Current feature set:
- Display current weather conditions, including barometer, solar radiation and UV, 3-day forecast, solar and lunar cycles, and wind speed and direction. This data comes from the WeatherUnderground API, updated 4 times per hour.
- Display indoor temperature and humidity.
- Display temperature setpoint and heatpump operating status.
- Display an alert to change the air filter. Buttons to set reminders for 30- and 90-day filters.
- Display a modal dialog upon receipt of any weather alerts provided by WUnderground, push an alert via PushBullet, and speak the text audibly.
- Set the desired temperature, enable/disable the entire system, set/unset away mode, manually engage the fan or emergency heat mode.
- Automatically switch between heat and cool modes based on the season.
- Automatically engage auxilliary heat if the interior temperature falls too quickly for the first stage to keep up, or if the outside temperature drops below 40° F, as heatpumps are not effective below that temperature.
- Away mode: switch to a lower-energy operating mode. Engage cooling when interior temp reaches 80° or heat when interior drops to 55°.
Some features still to come:
- Scheduling interface (though this may not be necessary with presence detection)
- Presence detection: Automatically switch away mode on and off based on presence determined by smartphones.
- Refresh mode: if the system has been completely idle for at least an hour, run the fan for up to 20 minutes to equalize room temperatures and recirculate stuffy air.
- Track operating time each month, display when each mode is used and correlate to indoor and outdoor temperatures.
- Voice activation via Alexa or others.
I'm also working on the display screen. I have an old 17" Dell LCD that runs 1280x1024 resolution. I hope to upgrade it to use LED backlighting and replace the existing VGA-only with an HDMI interface capable of playing audio. Then I can mount it as a single unit on the wall in the hallway where the current thermostat is.
I'll throw some screenshots of the web dashboard and some of the Node-RED flows into the project gallery.
-
Long gaps and short diversions
03/14/2016 at 16:28 • 0 commentsThe tstat project is currently on indefinite hold, merely because life and stuff got in the way. The Pi is currently set up with Raspbian Jessie and a Python script that allows it to use Amazon's Alexa Voice Service. This is mainly an educational diversion to show to the students in the computer class I teach, but since the AVS ToC requires any non-Amazon device to use a physical button to trigger the service rather than a voice wakeup, it is of limited usefulness. I hope that during Spring Break, which is in about 2 weeks, I will be able to restart the ThermPi project, though I still need a 24VAC transformer to build the power supply. Now that Radio Shack is bust, I'll have to head into a nearby city for one of the local electronic supply shops.
I will be making one change to the presence checking. Instead of reporting who is present, my SNMP setup will simply report whether anyone is present. Later revisions might enable different rules based on who is home, but out of the gate, overall presence detection is more important than identifying people and preferences.
-
State of the Stat Address
01/20/2015 at 18:10 • 0 commentsThus far I have no real project logs. I have acquired most of the hardware components I'll need, and I've experimented with the RPi to learn how to interface with the SSRs and the temperature sensor. When I am able to spend more time on building circuits or writing code, I'll add more log entries.
I purchased a switchable 18/24VAC wall-wart transformer so that I could begin building my power supply, but apparently I got a dud. And of course I can't take it back because I clipped off the interchangeable tip socket instead of getting the tip with bare leads. So I'll have to open it up and try to fix it.