[OBSOLETE] Kodi for SmartThings BETA

I was playing around with video mirroring yesterday and I noticed that it didn’t work on android TV but works flawlessly from windows to windows. I know that requires uPNP as well, I wonder if there is any relation to it.

unfortunately, the change I made isn’t really related. I just made a value that was already available inside the device handler and made it available to outside Smart Apps. I mentioned this over in the github issue as well, but I’m running AndroidTV OS on a Shield Android TV and everything is working fine. It really is an interesting combination of working/not working. My SATV works but there are reports that the Nexus Player (which is quite similar to the SATV) does not. “Normal” Android works for some but not all. And for others, it’s working on PCs but not on Android on the same network, likely ruling out a router configuration problem. Just to be sure, you did enable the “Allow remote control via UPnP” option in Sytem->Services->UPnP menu of Kodi, correct?

Yeah mine was working when I had it running on a Ubuntu box but I just retired that box in favor of the android box :slight_smile: You know less power draw and the such and just easier to manage. I agree that the work/not work is quite odd. I’m going to have to upgrade the rest of my android boxes in the house because Kodi17 requires Android 6 or higher and since I like to stay up to date my MXQ boxes won’t be. We also have a MySQL DB for all of our kodi boxes to keep tabs on what was watched so we can move from one TV to the next without losing our place. Oh the spoiled world we all live in.

1 Like

I think you mean version 5 :wink:

http://kodi.wiki/view/Kodi_v17_(Krypton)_FAQ#Android_5

Also, guys if you are using Kodi on Android just use SPMC it contains lots of fixes specific to Android. If you don’t know what SPMC is think of it as Kodi for Android as the original Android developer who left Kodi maintains this with specific Android fixes. This solved some audio and SMB issues I had once I installed it so can’t recommend it enough.

@dshokouhi yeah I meant android 5 lol. I’ll have to check out sbmc. Do you know off hand does it work with MythTV?

SPMC does work with the mythtv pvr plugin. As far as I know, all plugins for Kodi should also work in SPMC. The differences between Kodi and SPMC are primarily centered around hardware support.

1 Like

Installed it on all of my android boxes and yay my receiver now actually works with true surround sound. Thank you for the tip.

1 Like

Could someone help me. I’m just trying to convert the on off from play pause to system.suspend. From the changes I made to the code I have it successfully suspending while playing. But if the button status is on stopped it won’t reissue the command system.suspend which if suspended wakes it back up. I’m guessing that is because if it was truly stopped hitting play wouldn’t do anything but I’m not real familiar with this code so I cant see to translate the part (I’m guessing an if) that says if stopped don’t bother trying to play). I just want this to get the status like it does if playing show playing if paused show paused and if stopped show stopped. But what I want different is that when it is stopped I want the command I swapped out to be issued so it will actually send the command system.suspend. I just can’t find whats stopping it

I just want to say that this integration is the coolest part of my home automation setup, always get a few ooo’s and ahhh’s when the movie starts and the lights dim.

FYI using tasker to pause playback when a phone call is received is neat but dont tell your friends… someone thought it would be fun to set up a robodialing bot to call me throughout Q4 of the packers game…

2 Likes

Will this work with Kodi on Fire Stick?

Yes, although some users have reported mixed cases of the UPnP events working which is one of the main use cases for this. I’d say try it out and let us know how it goes.

Yeah I’m still dickin around with this trying to figure out how to get it to play nice with the UPnP stuff.

Edit: I don’t blame @joshua_lyon for this :slight_smile: I firmly believe it to be an android issue. Whats interesting if I hit refresh inside of the device in ST then it picks it up. But when I tell CoRE to do a refresh it doesn’t work so I’m not sure what the difference is in the refresh.

1 Like

FWIW I am noticing the following:

1st gen fire tv - uPNP does not work at all no matter what I try however HTTP commands do as I can pause/play, just no status updates

1st gen fire stick - uPNP is finicky and HTTP commands work fine

2nd gen fire stick - uPNP and HTTP works fine

not sure why those differences are there but hopefully this means that the next Fire OS update will correct it.

1 Like

I have it configured but ST never finds it.

Try changing the URL manually to see if it gets detected properly, I had to do this for a couple of devices where it detected the ST IP inside of the actual device.

1 Like

Not sure what you mean, this is my first Kodi device.

Edit the Kodi device and set the override URL to the one you setup when you enabled the HTTP server. It should be http://(device_ip):(port) and make sure you enter the user name and password that you configured as well.

1 Like

So today I noticed something peculiar. If you noticed above I mentioned that the Fire TV 1st gen only worked with http and not uPNP. Well I went ahead opened up the smart app to rerun discovery and I noticed that it found a second device. This time it found Kodi without the (localhost) part of it. It also correctly identified my IP and port so no need for an override, only needed to add username and password. I don’t really know what changed but it was a few months since the last time I tried this.

When I run discovery it still finds the incorrect device that never worked properly, even with the override.

Now I am also noticing the same issue on my 2nd gen fire stick. It finds the incorrect IP and works fine once corrected but uPNP never works so I never get metadata.

I see in the logs when I physically change the IP it works but the subscription still calls the older IP, any reason why that IP gets stuck? Is it being stored somewhere that needs to be cleared out? When I look at the devices that work properly they subscribe to their own IP

2630a2a7-3fb5-4ba5-b3ce-109c65ae5130 5:18:26 PM: trace Sending command: Player.GetActivePlayers
2630a2a7-3fb5-4ba5-b3ce-109c65ae5130 5:18:26 PM: trace SUBSCRIBE 192.168.1.48:1458 to /AVTransport/0ce1a13b-96f8-27c9-8e5a-e544dac0ec06/event.xml
2630a2a7-3fb5-4ba5-b3ce-109c65ae5130 5:18:26 PM: trace subscribe(/AVTransport/0ce1a13b-96f8-27c9-8e5a-e544dac0ec06/event.xml, )
2630a2a7-3fb5-4ba5-b3ce-109c65ae5130 5:18:26 PM: trace Clearing existing event subscriptions and getting a new subscription.
2630a2a7-3fb5-4ba5-b3ce-109c65ae5130 5:18:26 PM: debug Getting status from 192.168.1.52:8181
2630a2a7-3fb5-4ba5-b3ce-109c65ae5130 5:18:26 PM: debug Executing 'refresh’
2630a2a7-3fb5-4ba5-b3ce-109c65ae5130 5:18:21 PM: debug Returning 1 HubActions
2630a2a7-3fb5-4ba5-b3ce-109c65ae5130 5:18:21 PM: trace SUBSCRIBE 192.168.1.48:1458 to /AVTransport/0ce1a13b-96f8-27c9-8e5a-e544dac0ec06/event.xml
2630a2a7-3fb5-4ba5-b3ce-109c65ae5130 5:18:21 PM: trace subscribe(/AVTransport/0ce1a13b-96f8-27c9-8e5a-e544dac0ec06/event.xml, )
2630a2a7-3fb5-4ba5-b3ce-109c65ae5130 5:18:21 PM: debug Refreshing subscription for: [:]
2630a2a7-3fb5-4ba5-b3ce-109c65ae5130 5:18:21 PM: debug Unsubscribing from and removing: [:]
2630a2a7-3fb5-4ba5-b3ce-109c65ae5130 5:18:21 PM: debug Checking for expired subscriptions in [:]
2630a2a7-3fb5-4ba5-b3ce-109c65ae5130 5:18:16 PM: debug Host: 192.168.1.52 Port: 8181
2630a2a7-3fb5-4ba5-b3ce-109c65ae5130 5:18:16 PM: debug Splitting out the host and port
2630a2a7-3fb5-4ba5-b3ce-109c65ae5130 5:18:16 PM: debug splitting atoms
2630a2a7-3fb5-4ba5-b3ce-109c65ae5130 5:18:16 PM: debug overriding the IP Address based on input preferences http://192.168.1.52:8181
2630a2a7-3fb5-4ba5-b3ce-109c65ae5130 5:18:16 PM: debug updated
2630a2a7-3fb5-4ba5-b3ce-109c65ae5130 5:18:16 PM: debug Host: 192.168.1.52 Port: 8181
2630a2a7-3fb5-4ba5-b3ce-109c65ae5130 5:18:16 PM: debug Splitting out the host and port
2630a2a7-3fb5-4ba5-b3ce-109c65ae5130 5:18:16 PM: debug splitting atoms
2630a2a7-3fb5-4ba5-b3ce-109c65ae5130 5:18:16 PM: debug overriding the IP Address based on input preferences http://192.168.1.52:8181
2630a2a7-3fb5-4ba5-b3ce-109c65ae5130 5:18:16 PM: debug updated

FWIW I also tried to manually create the device in the IDE but I noticed the subscription was reading null:null in the logs so I assume that the device needs to be discovered properly so it can save the right data in the db.

I have tried with no success. The port I thought was 8080 by default, I wasn’t able to find the port in the system info screen.

Go to Settings -> System -> Services -> Web Server

This information is also found in the first post