ESP8266-HTTP-IR-Blaster

I built this ESP8266-HTTP-IR-Blaster to control my window AC unit in my garage as well as a few other devices and was wondering if anyone knows how I can integrate it into HA?

It can receive commands via HTTP with the IR code JSON formatted…
http://xxx.xxx.xxx.xxx:port/json?pass=yourpass&plain=[{“type”:“nec”,“data”:“FF827D”,“length”:32,“repeat”:3,“rdelay”:800}]
replacing with your ip, port, and yourpass of course.

If anyone could help me integrate this into Home Assistant that would be amazing. I am a HA noob and love it so far. Thanks!

2 Likes

Have a look at https://github.com/1technophile/OpenMQTTGateway

This does a similar thing with HA examples included that you may be able to use.

1 Like

Hi Chad, I actually put together a post about this where I’m doing almost the exact same thing: Andrew's Ramblings: ESP8266 Based Universal Remote. The Arduino code I used had the benefit of not needing credentials. If you continue to use this code you can probably post data to the page with an HA shell script such as:

tv_off: curl -d '{"type":"nec","data":"FF827D","length":32,"repeat":3,"rdelay":800}' '192.168.1.101:80/json?pass=yourpass'
2 Likes

@aneisch, Fantastic blog post. I have to try this now :slightly_smiling_face:

BurtrumUK, Thanks will do!

@aneisch Thanks a lot for the advice. I did try this and although it didn’t work it was enough to push me in the right direction to solve it with a REST command…

in my configuration.yaml file I put this…

# Track the sun
sun:

#Shell Commands
shell_command:
  restart_pow: touch ~/.pow/restart.txt
  garage_ac_up: curl -d '{"type":"nec","data":"10AF807F","length":32,"repeat":2,"rdelay":800}' '192.168.2.19:80/json?pass=xxxx'
  garage_ac_up2: curl -d 'http://192.168.2.19:80/msg?code=10AF807F:NEC:32&pass=xxxx&simple=1'   
rest_command:
  example_request:
url: 'http://192.168.2.19:80/msg?code=10AF807F:NEC:32&pass=xxxx&simple=1'
# WebLinks
weblink: 

The two shell_commands didn’t work however the rest_command did. AWESOME!!!

Thanks so much, I will definatly check out your post in depth more later it looks great.

So glad you were able to get something working!! Let me know if there’s anything I can do to help!

I had started working on this a while back but got frustrated when the code wouldn’t turn on my panasonic plasma tv. I broke this back out this week and have it working on my Z906 speaker system with Pi Musicbox hooked to it.

Turns out there is problem in the database for panasonic, but I started over at square 1 using TV-B-Gone code which I found to work on my panasonic. I eventually narrowed the codes on TV-B-Gone to isolate the single panasonic code and plugged it into a MQTT switch, which was a decent workaround. I want to have multiple IR LEDs positioned around the gear so they will all get turned on with a script that gets triggered through home assistant.

I was able to get rest_command and shell_command both working. Your blog writeup is a good reference.

Thanks for taking the time to lay out your solution.

Sorry to hear about your frustration, clever solution though! I’m glad the writeup helped you, Merry Christmas!

Hi @chadbone

Trying to upload your ircontroller.ino but getting errors with shah.h, I noticed in your video code you don’t include this.

Iv gone though the history of iircontrollerbut can’t find one which doesn’t produce errors!

Any help would be appreciated mate - keen to get this working!