OSMC Remote Kodi JSON Method

#1

Hello,

First time here, and thanks for your work on OSMC.

Please I want to be able to control my TV using LIRC on OSMC. I have setup the remote, but I don’t want to be using irsend to send the command.

Please does anyone know of a Koid call method that allows for accessing stored remotes? So instead of using irsend, could use the koid api and use the right call method.

Also I want to be able to control different devices, using the remote. It seems I am limited to just selecting only 1 at a time. Is this the case please? And if it is possible to use more than one, can I be enlightened on how to do it?

Kind regards

#2

Kodi doesn’t support IR blasting natively

#3

Hello @sam_nazarko,

Thanks for the feedback. So there is no way, one can use the Kodi api for IR :pensive:, that’s so sad.

Anyways will have to figure another way out, and thanks again.

Regards

#4

Are you saying that when an IR signal is received, you’d like to do something in Kodi?
This is possible – and the standard way of achieving this is to develop a keymap.

#5

Hello @sam_nazarko,

Oh no I am not talking about the ability to control Kodi with IR, which I know is possible. I just wanted to one of Kodi’s JSON-RPC APIs to send an IR signal, so I could control my TV using it.

Since you said it wasn’t possible, I am presently looking at putting together some standalone python script running in a venv that will allow me to receive messages over MQTT, and the received message used by my script to control Lirc. This then controls my TV.

Thinking abt it, if I understood Kodi addons api, maybe this will be a nice addon to develop. So once installed on Kodi, it could then expose the IR signals over the Kodi JSON-RPC API, using the plugin :thinking:.

Now something I need to think thru. So you think it will be possible? So I don’t waste my time :wink:.

Kind regards.

#6

Does your TV not support CEC? Depending on what you are trying to do you may be able to achieve it with CEC.

#7

Hello @bmillham,

My TV does, but it’s actually a problem since I got other things connected to it. Also I want to be able to use the same Kodi instance as some form of IR blaster for other IR devices.

This will help reduced the number of devices I have, and ultimately reduced power. For example I have Kodi always on, have another ESP device, for controlling IR devices. Yes power minimal, but I just think it’s so unnecessary to have it, and makes my system clustered. So started thinking of how I can combine multiple services in a single Pi box.

I came across something like this https://www.matthuisman.nz/2018/10/gpio-monitor-kodi-add-on.html?m=1. It’s similar to what I want, but for IR. I could even use this, to control the power to my AV devices, as no matter what, I got Kodi always on, as I use it for other things like scanning Bluetooth presence system, and calculating where users are in the house using RSSI.

So once I can also cramp into it my IR blaster, that to me is a big step forward.

Hope this makes sense?

#8

Sounds like an ambitious project!

If I understand correctly what you are doing, most of it would be done outside of Kodi control, so you would just ‘talk’ to the IR blaster directly from scripts.

#9

Well possible out of Kodi’s control yes, but I want the IR to be within its control and why I was thinking of utilising an addon.

The Bluetooth scanning is just done using a standalone bash script on the same pi, so out of Kodi’s control. But I wanted the IR to be within its control, for as much as I can still run another standalone python script for Lirc, I really don’t want to if it’s possible via an addon.

Kind regards

#10

You could possibly do something like:

Have a service that talks to the blaster. That service would only talk to the blaster and listen for commands (maybe with a JSON type interface).

Then your BT script would send a message to the blaster service.

If the Kodi addon that you linked does what you want, you could modify it to send a message to the blaster service instead of what it’s currently doing. I don’t know if a Kodi addon can watch for IR input, so this is just a thought. Maybe it will give you some ideas to help.

#11

Many thanks @bmillham,

Will look into it and get back if any further issues.

Kind regards