I do and I have that set currently but with ST I was able to use the attached SmartApp / Device to set Movie lighting when we watch a movie using the following options in WebCore
I may keep ST anyway once I fully migrate across as I think there are a few things that aren't going to work in Hubitat currently
Kodi has an exposed API (https://kodi.wiki/view/JSON-RPC_API/v9) that can be called using websockets. You could write a simple app (or driver, perhaps) that could subscribe to the websocket and report when a player has started playing a media item and then inspect the returned JSON and grab the media type.
Did you try just porting? You can remove the tiles from the driver code, they are not used on HE. Change occurrences of physicalgraph to hubitat in the code.
I did on the one Kodi for ST Beta, I sorted the physicalgraph references and was able to get to save but was then throwing up errors so I played around with some stuff and made it worse so would have to start again
With the help of Roy over PM we have been able to get the App and Driver to install and I have then been able to get the driver to pause / play etc. But it isn't reading the state of the playing media.
I have got it to work by overriding the auto-discovery as this doesn't find my devices.
The error I'm getting is groovy.lang.MissingMethodException: No signature of method: user_app_boshdirect_Kodi__formerly_XBMC__195.parseLanMessage() is applicable for argument types: (java.lang.String, java.lang.Boolean) values: [mac:XXXXXXX, networkAddress:C0A801B4, deviceAddress:50, ssdpPath:/description.xml, ssdpUSN:uuid:2f402f80-da50-11e1-9b23-0017882d484c, ssdpTerm:urn:schemas-upnp-org:device:basic:1, ssdpNTS:, ...] on line 257 (onLocation)
Line 257 onwards is " def lanEvent = parseLanMessage(evt.description, true)" and is in the group as follows:
/**
Called when location has changed, contains information from
network transactions. See deviceDiscovery() for where it is
registered.
@param evt Holds event information
*/
def onLocation(evt) {
// Convert the event into something we can use
def lanEvent = parseLanMessage(evt.description, true)
lanEvent << ["hub":evt?.hubId]
// Determine what we need to do...
if ( lanEvent?.ssdpTerm?.contains(getDeviceType()) )
{
parseSSDP(lanEvent)
}
else if (
lanEvent.headers && lanEvent.body &&
lanEvent.headers."content-type".contains("xml")
)
{
def xmlData = new XmlSlurper().parseText(lanEvent.body)
parseDESC(xmlData)
}
}
I used the same device type handler from Joshua in ST as well. I've never coded in groovy before, but I am willing to help, test, or any other way I can to keep this rolling. I would like to port this over too. This and alarmdotcom are my last integrations running on ST.
If you're going to post code here, make sure the authors are attributed unless you are the author. Highlight the code and click the </> icon (preformatted text) at the top of the compose window so it truncates the preview and makes a highlighted scrollable window within your post. This keeps the code formatted properly, avoids accidental special characters from getting inserted, doesn't force everyone to scroll and scroll and scroll through the post where the code was just pasted in place without using the preformatted text option.
Alternatively, post code you own in a github repo, and fork code you don't own to your repo and post the link here. But always keep accreditation to the original author in the code and respect their terms. If according to their terms, the code is not to be altered, copied or used outside of sharing the original code in its entirety, then contact the author and ask what exceptions they might make. Otherwise, always honor their requests and or specific licensing terms if they exist.
So far I have managed to get the app and driver to save, it doesn't automatically search for Kodi instances so this has to be set manually in the driver.
I am able to control Kodi from Hubitat so far and that is all.
I can send notifications to Kodi from the Hubitat web portal but not from Apps (i am using another driver for that)
What I would like to do is control lights based on videotype that is playing. I can do this with ST so am keeping ST connected for now....
Do you want what I have posting so you can take a look? This is edited from Joshua's ST code.
No thanks. I took the quick and dirty way out. I plugged my kodi box into a Zigbee energy monitoring outlet. That way, when I shut it down in the OS, it is detected in the outlet and can do other functions and turn itself off. Then when i turn the plug back on, the system knows that kodi is on. Not able to do anything by media type but I didn't really need that.