I am still running openHAB v1.8 with the old XBMC binding and I am trying to get the genre of the currently playing movie so I can decide whether to turn off the lights (e.g. don’t turn off lights if playing a family/kids movie).
But I can get the binding to retrieve the genre. Tried Label.VideoPlayer.Genre, Player.Genre, VideoPlayer.Genre and nothing is displayed.
I am afraid I cannot help you with the old binding version.
I looked into the requirements for a new channel to deliver the genre information via the interface to openHAB. It will work but Kodi delivers a list of multiple genres for a media/audio file. The data can be converted to a semicolon separated String to be accessible at the channel, but I am personally not very convinced if that is a proper solution for it. Wdyt?
// Edit: I will post an example of the Kodi response later.
As long as openHAB does not support arrays/lists for items (would this be worth a feature request?), I think a semicolon separated String would be good enough.
The user can separate the string in a rule if necessary.
Or just use something like:
if ( Kodi_Genre.state.toString.contains("Comedy")) {
..
}
Yes, I think it is worth to open an issue in ESH and discuss about such an Item. We already have a StringListType which is capable to wrap String data. And there already is a CallerItem which accepts or delivers such data. I can imagine introducing a ListItem to hold a list of Strings shouldn’t be a big deal.
In the meantime I will try to implement it like suggested.