"Can I... ?" featuring Harmony Hub

I was interested in a couple of use cases for the harmony hub, to see if it fits my needs, and I thought maybe some of you guys might know.

  1. Is the harmony hub capable of controlling a generic AC unit?
  2. Is the hub capable of controlling any thermostats?

Does anyone have any experience with any of these scenarios?

The Logitech Harmony Hub is primarily a IR blaster for AV equipment. It also uses Wifi and Bluetooth to control devices like appleTVs and Rokus . They sell and add on unit for zigbee and zwave control, but I have not tried it. If your AC unit or thermos have IR control then you might be able to control it, but I get a feeling its probably not a good fit.

I occasionally use my Harmony Remote/Hub to adjust my Nest T-Stats.

Although not what it’s designed for, I have created “devices” that it doesn’t recognized and used old junk remotes to program IR codes. I then programmed an arduino to read said IR codes and react.

I was able to create a ir switched relay for my theater subwoofer and add it to activities. I can also control the relay via MQTT in openhab.

But, as for AC units, you can teach it whatever codes you want if you have the original remote for your device. It just may not map cleanly to buttons inside the harmony app.

This sound REALLY interesting!
Could you post any details on how to do this?
I know it is not that difficult if you already familiar with arduino, IR and MQTT.

But it would be great if you count point me (or othernm) in the right direction.
Preferably a step-by-step guide. :slight_smile:

Heh, I’m not really into the whole “instructable” style thing but would be happy to share parts or all of my sketch and wiring. I basically sifted through a couple of different blogs and library examples to piece together my stuff anyway. I’m not a programmer or a electrical engineer so I have to figure out as I go on both sides.

I’m actually still finishing up the project at this point so the code will change more and I haven’t taken the time to properly comment and clean it. I dumped my current code here: Arduino code. I’ll try to update it as I finalize the code.

The .items are here: MQTT items

I’m using an arduino mega with ethernet shield. The sketch is too big for an uno. My project basically has 3 relays on a relay board, Motion Detector, Pair of DHT11 (will be upgrading to DHT22, the 11 isn’t accurate enough), an IR receiver and a relay (driven by my doorbell) to drive a pin to ground. The wiring is all super standard and follows any of a million examples easily found by searching each sensor.

I wrote handlers to listen to and update OH via MQTT for the relays, temp sensors, motion sensor and doorbell.

The automation logic is split between the arduino and OH. Some things I choose to have the arduino make decisions about such as turning on/off the sub (don’t want to wait for OH to respond) where as other things like room temperature is reported to OH and OH decides when to turn on the fan in the room. That being said, I started automation with vera and z-wave. Z-wave has nothing on the speed of this arduino with mqtt… nothing close… it’s super fast.

The IR stuff is separate from OH for the moment. It simply turns my sub relay on and off. The action of doing so does send mqtt back to OH to let it know the sub is on. As for the harmony hub, I setup a new device and just put in a manufacturer and model I knew wouldn’t be in their list such as my subwoofer which doesn’t have IR so obviously would be missing. It asks if you have the original remote… say yes… find some junk remote you know doesn’t interfere with other devices you have, choose buttons on it to “map” to on/off and have it learn them. I used this IR example to spit out the code. You can see a case statement in my sketch that listens for and handles receiving those codes.

Please let it be known that I reused several code snippets from all over the web. I’m not in any way passing this off as all my work. I just pulled it together and customized it. I can’t keep track of all the places I found BUT, I want to link to here. This guy who is likely a member of this forum really helped a lot with the MQTT stuff. The blog has a lot of extra stuff going on but if you run through the first three parts, I pieced it together.

Let me know if you have any questions, I would be happy to help you with your project. Sorry for the brain dump, I’m a tech guy not a tech writer :smile:

1 Like

You did exactly what I was going to do. :smile:
But now I am a step closer. :wink:

The Blog you linked to seems very interesting!

In case you are still interested, I updated my sketch. I have been running it live for a week now with good results. I edited my temperature sensor code as it was updating OH every tenth of a degree. I wanted it to only update if a full degree changed.

In general, I have been very pleased with the setup. Everything has been very reliable. I even wrote rules today to control the lights in my theater based on the motion sensor.


I want to control my infrared lights via mqtt and arduino. Can I use your project?


Are you looking for a copy of my sketch?

Yes ! Does it do what I am trying to imply?


Yes, that and much more but it’s not like installing Microsoft office. It requires lots of “moving parts”.

Basically you need an arduino with ethernet shield and an IR blaster and an IR receiver. I don’t recall the wiring off the top of my head. I’m using a mega but an uno would work depending on sketch size. I just wanted more IO and memory. The sketch MAY not fit in an uno. The mqtt and ethernet shield libraries add up fast in memory consumption.

With the sketch, if you point a remote at the receiver and push a button, it will display the code via serial if unrecognized. This is used to identify codes from existing remotes.

Then you have to add that code into the sketch to do something. Usually send an MQTT message. I also have set the arduino to recognize an ir code and turn on or off a relay thereby making an IR controlled “power button” for my analog subwoofer.

Then, you have to setup OH & MQTT of your choice to listen for and handle the MQTT messages.

The arduino this sketch is running on does the IR blasting/receiving, has 2 temp/humidity sensors, controls 4 AC relays, monitors a motion sensor and monitors my doorbell. It has a bunch of MQTT listening/sending as well as monitoring the sensor and MQTT data to switch fans and audio equipment on and off etc. I didn’t bother cleaning it out of other stuff. It’s fairly well commented. It has been running for a year now with only a few small tweaks to add functionality here or there. For the most part, I don’t even think about it for months on end.