andrewfraley / magic_mapper

Remap LG Magic Remote buttons
MIT License
52 stars 5 forks source link

Sending raw IR codes #6

Open crytaljin opened 1 year ago

crytaljin commented 1 year ago

Hi, I'm wondering if there's a way to have the remote directly send an IR code to an external device without the device connection manager (my device is not on the list). I read through the API but couldn't seem to find a suitable call.

andrewfraley commented 1 year ago

I believe it's possible, but I haven't figured it out yet and I don't think anyone else has either. A few years ago I made another project that solves this in a round about way. Basically you configure the TV with some arbitrary AVR, then program a Flirc device connected to computer/raspberryPi to listen for the those codes, then transmit the correct codes to your device. I never got it to perform well enough for my liking, though. https://github.com/andrewfraley/flirc_repeater

As for doing what you're asking, there are multiple database files in WebOS that contain the IR codes. Someone would need to figure out which file needs to be modified, what the correct format of it is, then add new codes to it.

Alternatives would be injecting our own code into the "irdbmanager" process and directly calling the functions inside of it. This is really complex, but some folks have figured out how to do this with other processes in WebOS.

Anyway this was probably more technical information than you were looking for, but this is something I want to try to solve sometime.

crytaljin commented 1 year ago

Thanks for the quick response and the explanation! That's too bad, wish they had an easy API for this since theoretically it shouldn't be too difficult :/ Will try to look into what you suggested if I have a block of time!

MonolithNZ commented 1 year ago

This is unrelated, but I just wanted to comment on how amazing this project is. Thanks to you, I've been able to trigger my home assistant Node Red automations using the LG remote. Being able to turn the lights above our TV on/off or adjust our window blinds using the remote is a game changer. Thanks again!!!

andrewfraley commented 1 year ago

Thanks @MonolithNZ! I'm glad it's working so well for you. My magic remotes are now my main interface to Home Assistant as well. What I use the most, and the reason I first created this, is using the channel up/down buttons to adjust the oled backlight, so now I adjust brightness just like a volume control, works great.