Piston to Get Kodi Video Player Status to Control Hubitat

Like many others, I used the wonderful Kodi for Smartthings app (GitHub - joshualyon/ST-Kodi: Kodi for SmartThings - Device Type and SmartApp) back in the day to integrate my lights with Kodi.

Unfortunately, that app no longer works on ST and there hasn;t been a similar app on Hubitat.

So I wrote the following WebCore piston that pulls the Kodi Video Player status every couple of minutes (I use another piston to pause and resume it depending if my TV is on and set to Kodi):

You'll need to get the Kodi IP address, port, name, and password, and then add those to the variables. In this piston, if it detects that the video player is active, then I call my Movies mode. If it detects that the video player is not active, then I sun another piston that restores the mode based on the time of day. You can modify the actions to your liking.

Hope you find this helpful!

Here's the piston to pause and resume the Kodi Status Piston.