How to make device drivers

I want to control my devices over network API instead of unreliable IR-control.
We have seen that the IR output power of the UC dock, is to weak to control remote devices like projectors, robot vacuums, remote controlled candles, etc. Many will also prefer to have the dock placed near the sofa for easy access to the remote, which both will result in an unstable device control. This is why we need device drivers (integrations?) for our network attached devices. Today most smart tv’s, projectors, avr-receivers, tv-tuners, robot vacuums, etc. are network API controllable. Without having ever done this myself, i belive it is possible to make device drivers for all of these devices for the remote-two, that simply sends out the commands available in the devices API library. If users could make or edit existing drivers for their own devices, this would speed up the process of making this a usable and future proof universal remote. Have anybody here done this already or have any insight to how this should be done?

2 Likes

As a result of the weak IR signal strength from the R2 dock I already changed the IR based control of my entertainment devices (LG TV, Apple TV, Vu+ satellite receiver) to network IP based control.

For my Apple TV the control is clearly via the native Apple TV integration of R2.

For my webOS LG TV I use the LG webOS integration which is included in Home Assistant. (I therefore installed HA as a docker container in my NAS)

For my Vu+ satellite receiver I send http commands via Home Assistant scripts that are called from the script like

'curl -X POST ‘http://192.168.1.123/web/remotecontrol?command={command}"’

where 192.168.1.123 is an example of the corresponding network IP adress of my Vu+ device and {command} is the number code of the key command, e.g. ‘139’ for the ‘menu’ key and ‘352’ for the ‘ok’ key. From R2 I call the corresponding HA script for a command key.

I see your idea of sending these http commands natively and directly from the R2 and I think that this would be a good and smart way without the necessity of the use of another service (in my case the Home Assistant software). Unfortunately I have no idea how to realise this, but I thing that it would be easy if we just know how to do.

Maybe somebody can send some instructions for this or can give a hint?

3 Likes

There are informations about how to write an integration driver on GitHub: https://github.com/unfoldedcircle/core-api/blob/main/doc/integration-driver/write-integration-driver.md

There are also Libraries for NodeJS, Python and Go but basically you can use any language which can establish a websockets connection to the remote.

1 Like

Thank you. I will take a look at that.

Interesting information from UC today:

We are happy to see the integrations that you are writing and that Remote Two evolves out in the wild.

To make it even more easy to get started, we are working on wrappers for our integration API for multiple languages. Just recently we published our Python API wrapper: https://github.com/unfoldedcircle/integration-python-library

I’m not a programmer and don’t fully understand all of this, but it seems like a step in the right direction.

I’m not a programmer either, but I do know how to write simple programs in C/C++, Java, and my original first language, Fortran. I have not learned Python, but if it should prove worthwhile I may. I have no idea of how to use an API, let alone write one, but am willing to learn, and hope to get some support from the more code-literate members of the community. I share the goal of getting entirely off IR control and establishing two-way state aware communications with all my devices.

Right now, though, having owned the remote for under 24 hours, I’m in the process of setting up all the stock integrations that I can use, and learning the IR codes for the remaining devices. Crawl before you walk.

I would also like to access the webOS LG TV integration. But I am not a docker expert (I do have a sinology NAS, but have never used docker or home assistant).

Frankly by far teh best option would be for LG TV to become a supported standalone integration.

Yes, that would be the best option for all the stuff we want integrations for. But I’m up for learning to fish rather than be given fish. That’s one of the reasons I supported this project.

I do like the idea of running HA under Docker on a NAS. Right now, I’m fresh out of unused Raspberry Pi’s. I do have one running Open Habian, for which an integration was promised but so far not delivered afaik.

I guess I’m also more af a hacker than I thought. Spent most of the day playing with HA/docker on my Synology. Not bad at all! Shame that the Apple TV long home press doesn’t come across to the remote two though. But I am really excited that I can now toggle night mode and speech enhancement on my SONOS ARC. I’ve never been able to do this with Logitech or sofabaton :grinning: :grinning: