API? Home automation features?

Hi Guys,

Does the 4K+ have an API or an ability to send HTTP commands to control the device? On/Off etc

Thanks

There is a JSON-RPC API.
You can suspend and wake the device via HTTP, yes.

Thanks sam. Can the status of the unit in either state be polled ? Ie to determine if its on off or standby . Can you share the documentation for how this works so i can get a head start. My unit had shipped

https://kodi.wiki/view/JSON-RPC_API

In regards to on/off. If the Vero is Off it would not react to any network commands and therefore could also not be controlled. Only suspend would be a possible mode for the Vero still to be controlled.

The Vero can be woken from suspend with any key press (by network; CEC; IR etc).

Thanks guys, plenty of options then to integrate into OpenHab2

Can you give me some basic syntax examples? Iā€™m not familiar with RPC, and my test requests in Postman arenā€™t receiving any response.

This is a script example via curl to switch audio output:
curl -H ā€œContent-type: application/jsonā€ -X POST -d ā€˜{ā€œjsonrpcā€:ā€œ2.0ā€,ā€œmethodā€:ā€œSettings.SetSettingValueā€, ā€œparamsā€:{ā€œsettingā€:ā€œaudiooutput.audiodeviceā€,ā€œvalueā€:ā€œPI:HDMIā€},ā€œidā€:1}ā€™ http://:@/jsonrpc

Is there a way to determine if the Vero 4K is currently playin a video via this API? ie to run a HTTP get to determine if something is playing. The reason is that I would trigger a scene, such as turning up the lights again if the movie has finished :wink:

I can see the API has Player.OnStop and Player.OnPlay which I assume is what iā€™d use.

How would I obtain that via curl?

To be honest when you want to programm something I would expect you are able to do some searching.

http://kodi.wiki/view/JSON-RPC_API/Examples

3 Likes

Well, why not start with a ready-made Kodi binding ā€¦

For OpehnHAB 2:
https://www.openhab.org/v2.2/addons/bindings/kodi/

ā€œold onesā€ / OpenHAB 1:

https://www.openhab.org/addons/bindings/xbmc1/

For FHEM:
https://wiki.fhem.de/wiki/XBMC
https://waschto.eu/xbmc_kodi_mit_fhem_verbinden/

For eQ-3 / CCU (or FHEM):
https://forum.kodi.tv/showthread.php?tid=204667

2 Likes

Seems useful, but should this layer of overhead be necessary when Kodi already has an API? It seems to me like the problem is with the Kodi API documentation (which I canā€™t understand, personally).

Iā€™m looking to set up a variant of this project that will play songs (and potentially videos) from Kodi rather than over Sonos: qrocodile: the kid-friendly Sonos system - Raspberry Pi

If using openhab is going to make my life easier, Iā€™ll do it, no problem, but it doesnā€™t seem like it should be necessary.

Well you jumped into this thread that was about openhab usage with OSMC. So the reply from @mathiasn wasnā€™t meant for you but for the original thread owner. I suggest you open a new thread if you want to get help for your topic.
But to be honest without some basic programming knowledge I am not seeing you getting anywhere.

Right, thanks. Sorry I missed the OpenHAB reference in the thread. Iā€™m only looking for some clarification of the documentation, not extensive help on my specific topic.