Hey everyone, I wanted to share a cool project I recently worked on. I’ve been trying to find a way to use the temperature sensors from my Philips Hue motion sensors to control my Honeywell Lyric thermostat. I’ve got a lot of west-facing windows in my living room that let in a ton of heat, even with the blinds closed. Meanwhile, my thermostat is on the opposite side of the house, so it doesn’t really feel the same warmth. This setup was causing some major discomfort, especially in the afternoons when the living room would heat up way more than the thermostat was indicating.
After some research, I discovered that the Hue motion sensors also have built-in temperature sensors. This was the key I needed! I decided to use these sensors to remotely monitor the temperature in the living room and adjust the thermostat accordingly. Here’s how I did it:
-
Identifying the Sensors: I found that each motion sensor has a corresponding temperature sensor. For example, sensor ID 18 was the temperature sensor paired with my motion sensor ID 19. This was crucial because it allowed me to link the temperature readings to the correct location.
-
Setting Up OpenHAB Items: I created an OpenHAB item to pull the temperature data from the Hue API. Here’s the code snippet I used:
Number HUE_Temp_Livingroom “Livingroom temp [%.2f f]” (gSkur) { http=“<[HTTP://10.0.0.126/api//sensors/18:300000:JS(getHueTemperature.js)]”}
- Temperature Conversion Script: To convert the raw temperature data from the Hue sensor (which is in hundredths of a degree Celsius) to Fahrenheit, I wrote a small JavaScript function:
(function(i) {
var json = JSON.parse(i);
return (((json[‘state’][‘temperature’]))/100*9/5+32).toFixed(2);
})(input)
- IFTTT Integration: Since my thermostat doesn’t have a direct OpenHAB binding, I used IFTTT to bridge the gap. I created two applets:
- One triggers when the living room temperature rises above 74°F, turning on the thermostat’s fan.
- The other triggers when the temperature drops below 74°F, turning the fan off.
This setup has been a game-changer! Now, when the sun hits my living room hard in the afternoon, the fan kicks in and circulates cooler air from my bedroom, making the whole house more comfortable. It’s been 19 years since I’ve had a reliable way to manage this issue, and this solution has been a lifesaver.
If anyone else is dealing with similar temperature discrepancies, I’d love to hear how you’ve tackled it. Maybe we can come up with even more creative solutions together!