@Dnpwwo: Thank you for your effort to implement this functionality into Domoticz.
I really like it!
Till now i use the xbmc-kodi-status-in-domoticz script made by ChopperRob for this. (wich works very good!)
Maybe you can add same functions like that script. It changes user variables dependant on state from screensaver, profilename, mute, volume ..... etc.

There is still a fair bit of integration work that I want to do around core functionality: logging, device control, 'switch off' to name a few. I also want to move from polling (which it currently does) to listening.

After that I will look at integrating it into things like lua (and maybe even blocky). The challenge will be in ensuring that it sits comfortably with the existing functionality and that the capabilities are kept as generic as possible so that other Media Players could be added later (Plex, Sonos....).

I will probably try and stay away from User Variables if possible because, as I understand it, they really a mechanism to allow custom extensions to Domoticz via scripts not to support native implementations. Also, if I can expose properties in lua then people can update User Variables manually as (or if) required.

I've had a look at ChopperRob's script and would expect to expose similar details. Also want to be able to push messages and/or images to Kodi.

The reasonable man adapts himself to the world; the unreasonable one persists to adapt the world to himself. Therefore all progress depends on the unreasonable man. George Bernard Shaw

If you would switch to the raw TCP port instead of the web api you can integrate a much better listening system. After connecting, KODI pushes all actions to the connected devices, so you would only need to listen and not poll. My script works the same way, this makes to reaction time very fast.

You can test this by connecting to the TCP port (9090) with a simple telnet client.

Thanks for reporting. I couldn't test this because when you run on top of Raspian all the shutdown options are 'false'. Try 2.2664 and let me know.

I'll turn the logging down as much as possible once I know things are working smoothly. Per hardware logging sounds like a good idea but would be quite a big job now so much hardware has been implemented.

The reasonable man adapts himself to the world; the unreasonable one persists to adapt the world to himself. Therefore all progress depends on the unreasonable man. George Bernard Shaw

@Raspberry Piet, There was a fairly obvious spurious comma towards the end of the command. Crappy testing on my part. Glad it works now, thanks for letting me know.

@Derik, Not sure exactly what you looking to do with it. You can control it over the network, via http commands or UPNP and you can get remotes for most devices (there is even a primitive one even built into the latest beta for Domoticz)

The reasonable man adapts himself to the world; the unreasonable one persists to adapt the world to himself. Therefore all progress depends on the unreasonable man. George Bernard Shaw