[OBSOLETE] Kodi for SmartThings BETA

Here is a copy of the piston that I use for Plex but same stuff should apply with Kodi. I’m not using it with Kodi right now because I’m having trouble with the android boxes detecting the updates.

Edit: This is actually for 2 plex instances but just that first portion that refers to the music player will do what you want it to do.

Cheers going to try this tonight not expecting much though now I’m on krpton.
I just want something that will dim my lights when I start to play something
For anyone else like me here’s the Devs github as your links above don’t work.

Thanks for the note! When I renamed my GitHub account, I tested that all the links to my old repositories worked as expected, but I guess I forgot to check if links to raw files worked as expected! I’ve asked the moderator team if it’s possible to edit the original post - it appears that the original post is locked for editing.

2 Likes

Should still work on Krypton.

I’m on 17.5 and it’s working fine for me on my Android TV (LeEco Super 4 X55). I have my living room light (Hue) on in the evening and when I pause it will get brighter and then dim when I resume playback.
During the day, it ignores those rules as I have webCoRE set up to only run those pistons if my light is on.

That’s great I’ve just read krypton makes things harder.
I’ve not had chance to set it up yet as the kids are are taking over the tv lol
Would you be able to share your piston for me to get ideas from?
Cheers

Is there a way to manually add Kodi to the smartapp?
I’ve installed the app on the IDE but when I go to set it up in the SmartThings app I get to the discovering Kodi screen but it never discovers my Kodi :frowning: but I’ve had this issue on other apps I’ve set up where it won’t auto show so I have to add it manually and it normally works then.

If I remember correctly, I added in a feature where you should be able to manually install the device type and manually create a device which uses that device type and then in the device’s settings you can manually set the Override URL.

–edit–
Some of the features like automatically fixing issues with UPnP event handling is scheduled by the SmartApp. So if something fails with your UPnP events, you’ll have to manually tap the refresh icon to get the events back in sync as the scheduler which is run by the SmartApp won’t trigger the cleanup events.

1 Like

Thanks got it working now.
It wouldn’t get past the very first initial scan tough so I couldn’t even get to the option to change URL.
So I had to create a dummy media controller just so it would detect it then I changed that one.
Cheers
Just one thing it doesn’t show the title on the now playing tile has anyone had this before?

The title is based on the UPnP eventing. The web server and UPnP have to be enabled in Kodi. Some Android devices are known to have issues with UPnP. And my commentary from my last post applies too - the SmartApp normally handles the cleanup of the eventing on a schedule, so it might not work as expected with a manual setup. Tapping refresh in the Kodi device in SmartThings should setup the eventing again, but it will likely time out at some point.

1 Like

This will depend on your device.

Are you doing this on a Firestick or something? I struggled with that.

Using my Android TV, it works great as shown below in my Action Tiles snip.

I apologize for not replying sooner, but here you go.

Thanks for this.
Yeah I’m using it through my Sony android TV also.
I got it working great last week but now fur some reason it’s not updating the smartapp now.
Kodi will be playing something but on the main thing list it’s still says stopped.
Even though if I go into it and press mute etc it will work so it is still making a connection.
But last week when it was working i created a piston similar to yours to dim my light when playing and it worked great but now it’s not :frowning:

Hi,
I have this working, however I am unable to send a notification via webcore.
Could you shed some light on this please?

Above you say to use “sendnotification” however the coding i see able to select it “shownotification” ?

would this allow to control kodi and make routines or scenes? For instance… when I hit pause for my lights to turn on. When I hit play then lights turn off.

The status updates are based on UPnP events, so if that wasn’t setup properly or isn’t working for some reason, then it won’t update automatically. The commands are all HTTP commands from SmartThings to Kodi.

The code has showNotification. I updated the capabilities.md document with the correct method name, but the post you referred to is too old for me to edit.

Yes. You could use CoRE to add the logic you are describing.

1 Like

Thanks for the reply - as I am in the UK I have had to manually install the app and DTH, I may not have the correct versions however I did use the versions linked in the first post in the manual install instructions.

When in webcore I see the two options:

custom showNotification(…)
location send notification

From webcore I am able to get pause and play to work but the showNotification doesnt do anything. The syntax I have used is…

showNotification(’ “Test”, “test” ')

Are the single quotes intentional? it would need to be:

showNotification("Test", "test")

Edit: Here’s how it would look in something like SharpTools:

These appear to be added automatically by Webcore - see the two screenshots below:

2

Thanks it is working with the status now but only when I added the IP and port in the override section.
It auto scanned it ok and I added it but wouldn’t really do anything but once I add it there it connects and works.
I think they’ve changed something since Krypton as I use the android app yatse which has always worked great but that never detects anything in a scan now I have to enter the IP manually.
I’ve got all the recommended settings turned on with Kodi and static IP etc and ports forwarded.
Saying all that though it could be because the Kodi is directly installed on my Android TV and for some reason it’s always seemed to act differently to other installations.

Unfortunately, I don’t use CoRE, so that’s really a question better suited for someone who is familiar with the CoRE UI. Based on the screenshots though, it doesn’t look like that’s the right way to fill things out. I would hazard a guess that CoRE is interpreting it as sending a single parameter with a value of "Test", "test" hence the reason it’s showing that within single quotes. (eg. It’s sending the title parameter as title='"Test", "test"' instead of title='Test', message='test')

Did you poke around to see if you could adjust how CoRE is sending the parameters. Maybe with the drop-down on the “Value” in blue to the left of where you entered the value or with the parameters drop down at the bottom?