Home Automation Series: Initial Temperature Findings


I knew going into this, that temperatures around the house would vary, but the degree to which they vary is quite astonishing. First, I’ll show the main HVAC values:

{
  "heat_to": 71,
  "cool_to": 74,
  "indoor_temp": 68,
  "outdoor_temp": 49,
  "fan_status": {
    "fanMode": "on",
    "fanIsRunning": true
  },
  "temperature_status": {
    "StatusCool": "Holding until next window",
    "StatusHeat": "Holding until next window"
  },
  "system_status": "Heat"
}

As you can see at that moment the Heat is one trying to heat the house to 71 degrees, the indoor temperature is 68 and the outdoor temperature is 49.

Here are the rooms I’m currently monitoring:



  {
    "controller_name": "<redacted>",
    "controller_id": "<redacted>",
    "damper": 0,
    "id": 1,
    "temperature": 69,
    "humidity": 48
  },
  {
    "controller_name": "<redacted>",
    "controller_id": "<redacted>",
    "damper": 0,
    "id": 2,
    "temperature": 71,
    "humidity": 46
  },
  {
    "controller_name": "<redacted>",
    "controller_id": "<redacted>",
    "damper": 0,
    "id": 4,
    "temperature": 65,
    "humidity": 50
  },
  {
    "controller_name": "<redacted>",
    "controller_id": "<redacted>",
    "damper": 0,
    "id": 5,
    "temperature": 61,
    "humidity": 54
  }
]

I’ve redacted the identifiable bits here, but rooms 1 and 2 are upstairs, and rooms 4 and 5 are downstairs.

Upstairs, we’ve got comfortable temperatures at 71 and 69, that’s a pretty good range between them. Downstairs though, is a much different story. Room 5 (No there aren’t 5 rooms in my house, that’s just the ID based on the number of sensors I’ll have) houses a preference of having windows open when sleeping. Room 4, is a living room, directly outside room 5, which as you can see gets colder due to this.

The problem now is when I turn on the heat, all of the cold air from downstairs will get pumped upstairs into warm rooms, cooling them down, before the heater eventually warms up the house.

This is where damper control would really make this easy. Monitoring temperatures constantly, it could very easily adjust dampers and force more air into the colder room (regardless of the windows being open) and warm it up.

This is going to be quite the challenge keeping rooms comfortable, but keeping rooms within some margin should be easy(ish)

Home Automation Series: Temperature Sensors (Part 2)


It took just under a month to get them from Bulgaria (Customs is apparently backed up). But I finally got my first two Shelly H&T sensors!

No photo description available.
May be an image of ball

First off, I was absolutely amazed by how small these things are. All of the images I saw while reading about them didn’t really put the size into perspective. They are about the size of a small mandarin orange.

Setup was a bit weird because they came with firmware from 2018, and the app wouldn’t let me add them to my account until it was updated. But, there weren’t any instructions to do so. They had IP addresses because I could access them, and their app saw them, but they couldn’t do anything. I switched from DHCP to Static IP for them (something that is a *suggestion* in their documentation) and boom, they were able to update. If you buy these: The configure mode only stays online for 3 minutes at a time. Press the button and hurry up and get whatever config changes you need done. Alternatively, you could make the config change in their app and the next time it wakes up, the data is pushed down.

My original idea was that I would reach out from my application to the sensor to see what the temperature was, by using their RestAPI. After getting these and reading up, that’s not needed (or ideal. The wifi chip puts off a lot of heat when on for too long), as the Shelly H&T has two ways to provide data to you.

  1. Report URL
  2. MQTT
  3. Normal Wake-up and report

Let’s break these down.

  1. What is a Report URL? Within the config, you’re given the option to wake-up the device when the temperature changes by some number of degrees and report to a URL, it does a GET request to that URL with three keys: temp, hum, and id. The id is formatted like this: “shellyht-<mac>” It’s not the entire mac address, just the last little bit. With that data though, you can ingest the real-time temperature changes using the report URL.
  2. MQTT stands for Message Queuing Telemetry Transport. It’s very similar to ActiveMQ or RabbitMQ but this is designed specifically for devices that have very small footprints and tight power requirements. I haven’t done too much testing with this. Though the nice thing about using MQTT is, I don’t need to have rest endpoint configured to process the data. MQTT isn’t nearly as straight forward the Report URL though, as it sends data to multiple topics designated for that device, which means you need to subscribe for each device, rather than having a single endpoint where you parse the ID value from the call. I haven’t read anything that says a temperature change forces the MQTT data to send though, so I’d need to test that and see.
  3. Normal Wake-up and report, you can configure how often you want the device to wake-up and report out it’s data. Shelly suggests every 6 hours, though, without me changing it, the default appears to be 3 hours.

After the initial setup and configuration, I placed both in their respective rooms. One goes in my bedroom and the other in my daughters room. My wife and I have always been able to feel temperature differences between rooms, even when the A/C is running, but this actually revealed just how big of a jump it is. The front of our house faces north, so the back of our house is currently getting hit hardest on sunny days, my office and daughters room are on that wall. When the door to my daughters room was closed yesterday (outside high of 77 degrees F), her bedroom jumped from 71 to 75. As soon as I opened the door, the temperature started falling.

When I spotted the temperature going up, I opened her door and set the house fan to “on”. Within a few minutes the main temperature sensor for the HVAC detected enough of a temperature increase to kick on the cool air.

That’s where my system will come in. Let’s say for each room I have a threshold of say, 5%. If the temperature in a room changes by more than 5% of what the house is set to, make an adjustment to the dampers and turn the house fan on. The big plus here is that my HVAC thermostat has no idea what the temperature outside is, so it doesn’t know if it needs to cool or heat the house, it’s just aware of the ambient temperature in the house.

My system takes in weather from outside (right now, by way of DarkSky and OWM, that will change soon to an on-premise source), by having knowledge of what it’s doing outside the temperature inside can be monitored and adjusted in relationship to the outside temperature.

Now, in the past when it’s been a nice comfortable day outside, we open the windows. The problem there is we have to either open the Honeywell App and turn off the system, or run upstairs and turn it off. If I do this right, I can hook into the Alexa ecosystem and just call out, “Alexa, I’m opening the windows” and it’ll call out to my system and it will know to turn the system off, but still be able to manage the fan and damper control.

I’ve for 2 more Shelly H&T on the way and I’ll likely be ordering two more in the very near future.

Thanks for reading!

-Dan

Home Automation Series: Temperature Sensors


The heart and soul of my home automation and HVAC controls are room temperatures. Having a single zone HVAC unit means that the temperature is controlled in one place (usually near the central return). My house was built in 2016, and makes use of the idea that when a bedroom door is closed, the air return can occur under the door. That idea is….well, terrible.

With HVAC units you have registers (the vent that blows air into a room) and returns (it removes air from the room). Our house is unique because it has a second master suite, which has its own air return but has no temperature control and very weak air pressure from the unit. We’ll come back to this in a bit.

If you have a register in a room and it’s blowing air and the door closes you do what’s calling “blowing up” the room. Like a balloon. You are putting more air than you are removing into a room. Now, if you don’t have enough air blowing into a room and you have a return sucking air out you actually get the exact opposite issue. You create a negative pressure issue. When the unit is trying to pull air out of the room but there isn’t enough air from the unit, you start pulling air in from outside.

I mention this because right now in our house we have four bedrooms and two common areas. Two of the bedrooms are controlled by a single vent off the unit. I recently added an air return to my bedroom to help balance the system and attempt to get rid of the build up of air. So, that second master bedroom. The floor vents provide very little air, and I mean, VERY little air. So little its barely detectable by placing your hand over the vent. But, the room has a fully operational air return, which runs straight into the system. In the winter time, that room is very cold and in the the summer very hot.

The issue is, the air return pulls in whatever temperature the air is and sends it to the HVAC for recirculation. The issue is, if we want the house warm, but that room is cold. the house struggles to warm up because we’re sending cold air.

Wow, quite the intro. haha.

So, how will I correct this? By using Shelly H&T Sensors to monitor temperatures in each room, I will be able to tell which room needs more or less air. The two rooms that are controlled by a single vent duct from the unit will need a “jumper duct” to allow better air transfer.

Jump Ducts | Building America Solution Center
A jumper duct lets air from one side of a wall or door easily pass back to the unit.

The Shell H&T sensors have an Open RestAPI, which will make direct automation very easy!

Once per hour my code will query the sensors to get Temperature and Humidity readings. Once the readings are complete, determine which rooms have temperatures that are out of scope for the overall house temperature.

Once we’ve determined which rooms are too cold or hot, we’ll adjust the dampers accordingly and push air.

When the dampers have been adjusted, the room temperature should raise or lower pretty quickly since we’re driving a lot of air to that room. When a room has been marked as being too cold or hot, we’ll check in every 15 minutes after the dampers are adjusted to see how the temperatures is coming. If we’ve checked-in twice and still haven’t seen the temperature come into scope, a push notification will sent to me alerting me.

I haven’t yet added to jumper ducts, and I don’t have the sensors yet. I’ve ordered two of the sensors so that I can begin the tracking of temperatures in my room and one of our other bedrooms.

Thanks for reading!

Dan

Home Automation Series: HVAC Controls


I have a HoneyWell WiFi thermostat, which prior to this project was great. I could control it from my phone or their website. It was fuss free and convenient. That changed after I started this, while they have an API available, my specific thermostat isn’t part of their deployment. Which I only found out after writing a bit of code to authenticate to the API.

After realizing their API was not an option, I decided to scour Google and Github looking for other ways. I stumbled upon pyhtcc which at first, I couldn’t get to work, but after some testing found I was doing something wrong and has since worked great. The really nice thing is, it exposes a way to bypass it’s built-in features and directly call it’s base function which communicates to the HoneyWell service. Which I’ve taken advantage of 🙂

An example of code used to check on and update the overall HVAC system

Never mind the fact there are warnings in the screenshot above. Those are because I’m calling “protected” areas of the pyhtcc code base. I ended up adding a few specifics that suite my needs better than what pyhtcc can offer. One of those is the ability to control the temperature at the next period. With HoneyWell, you have this concept of periods, or slices of time in the day where you want a specific temperature. What this means is I can build into the system the ability to measure outdoor temperatures, and as they rise or fall, I can leave the house temperature where it’s at and simply adjust the next periods temperature. That is of course, if temperatures outside rise or fall dramatically, then adjust right now.


Damper control

A damper can control airflow by opening and closing. Opening allows more air, closing allows less air. When we bought our house, the dampers were set in such a way it would be “balanced” and we only had to mess with the main trunk in the garage when the season changed. That really didn’t work out. I’ve crawled up to the attic a couple of times to adjust them, and I’m done doing that. Not the mention the damper that controls our entry way, kitchen and second Master bedroom is much too low and we always have issues with cold spots.

We’ve got six dampers that control various areas.
– There is the main control, which dictates how much air flow goes downstairs vs upstairs.
– one that controls air flow to the downstairs living room
– one that controls air flow to the guest room/kitchen/main entry
– one that controls air flow to the master bedroom
– one that controls air flow to the two bedrooms upstairs
– one that controls air flow to a little sitting area/living room upstairs.

By having temperature sensors in those areas along with damper controls, I can hopefully achieve good balance and better control of when a room is heated/cooled, without needing to buy a multi-zone HVAC unit.

I hope at some point to do a video describing how it all works. That will probably be after I’ve installed damper controls.

Thanks for reading!
-Dan

Home Automation Series: Weather Data


This is probably over kill, but I’ve always had a fascination with the weather, and so one of the things I wanted to do was hold an enormous about of weather data, so I could write logic to analyze it and provide me with data about unusual trends, or possible up coming weather.

I read through several different Weather API providers and settled on DarkSky, who had two important factors: History all the way back to 1937 (for the most part) and cheap rates for excessive API calls.

Example output from my RestAPI

Using DarkSky, which has their own engine to “predict future weather”, I’ve populated weather data all the way through 2024. Every day though, my code will reach out and pull down accurate weather for each day. Ensuring valid data.
Right now, this process is dependent entirely on the internet, in the future though all weather data will be collected from a locally hosted weather station.

Why all the data though?

A major part of this will be a digital assistant, which I will probably call Jarvis. With that, I want to be able to rather quickly calculate weather records and have Jarvis be able to provide me with weather from a specific day or factoids about weather. Ideally, I think it would be pretty neat to write some code that could try to predict what the weather will be, then use actual weather recordings to prove or disprove (validating the learning process). This way, Jarvis could inform me of possible weather pattern changes or be able to tell when upcoming days will be sunny or not.

The real reason for the data hoarding though, is primarily because DarkSky was bought by Apple and it’s rumored the API will go away at some point. Which means, my ability to write code that will be dependent on that API is in question. So, instead, I’ve captured all the data I need prior to the API going away.


I’ll eventually look at plotting out all of the data in a scientific format using Matplotlib, this goes back to me being fascinated by weather data. It would be pretty neat to see how often trends repeat in terms of temperature spikes and dips, how often we actually get snow accumulation, or monthly average rain fall. I’ve always kind of been a bit of a data scientist, I’ve just never had the ability to act on the desire.

All of this data will feed into the logic that will be used to adjust the house temperature using the HVAC controls I’ve been building.

Thanks for hanging around!

-Dan