[OBSOLETE] Kodi for SmartThings BETA

Until Media Players are added as devices for Rule Machine, Expert Features aren’t possible. They don’t show up there yet (unless I’m doing something wrong).

I know they show up as Switches at least if I use the Callbacks code here instead of this one (but this one is much easier to implement on a Fire TV device)

@diehllane I just pushed an update that enables the “switch” capability for this device type and maps the status of “Playing” to “on” and the other statuses to “off” (eg. Paused/Stopped).

Try it out and let me know if it works for you.

(Also, don’t miss the notes I just posted just above about the actions needed to enable the new scheduler. Note that you and @jjslegacy will have to modify the canInstallLabs() method again when you update the SmartApp)

Awesome. It is now showing up in Rule Machine as a Switch.

One thing I have going on is my Mute/Unmute is actually backwards.
It’s not a big deal, but not sure if it’s universal or just something weird with my setup.

EDIT: Confirming the mute/unmute reversal on 2 different Kodi media players - Fire TV and Windows 10 PC

When the device is muted, the “Unmute” action will show up. When the device is unmuted, the “Mute” action will show up.

1 Like

Okay. So it’s for the command, not current status?
That makes sense.

1 Like

I have this working for Rule Machine with OFF being Pause and ON being Play, but only for the Windows client. Kodi on the Fire TV is not working for this.

I am playing files off a network share and Play/Pause work, but don’t trigger anything in Rule Machine. Mute/Unmute works, and Previous Track will go back to the beginning. Info, Home, Select, and all of the arrows work as well from the phone.

I used the same Triggered Rule from Rule Machine that works on my PC Kodi, just changing the Switch to the Fire TV Kodi. It may just be an Android/FireOS issue.

Anyone else able to test this on Android or FireOS?

unable to install.

market place > my apps > kodi (formerly xbmc)
I would get a message " upgrade needed! " upgrage, to use ST labs, your hub should be completely up to date. to update you hub, acesss Location settings in the main menu choose update hub.

But these instructions do not apply as my hub is up to date.

From ST: What is the latest firmware version?
At the time of writing (Jan 21, 2016): Hub v2 000.014.00026 (14.26)

You can use the workaround provided by @jjslegacy from above.
In the IDE, scroll down to the bottom of the code (around line 480) and edit it so it looks like this:

private Boolean canInstallLabs()
{
//return hasAllHubsOver(“000.011.00603”)
return true
}

1 Like

very helpful. this worked! reps

Hi Joshua

Got the install to work but having a hard time with discovery… MediaRenderer connect finds it… see log below. And below that is the log from your app. It sees 2 devices…Do I need to completely remove MediaRenderer first?

Thanks
Paul

Clear
05471502-1082-41c4-a63d-d710e2f48e48 4:16:48 PM: debug MediaRenderer device found[devicetype:04, mac:0009B0C397D7, ip:C0A80102, port:22B8, ssdpPath:/upnp_descriptor_0, ssdpUSN:uuid:27b09e14-d79e-14b9-5497-1409d7b9de67::urn:schemas-upnp-org:device:MediaRenderer:1, ssdpTerm:urn:schemas-upnp-org:device:MediaRenderer:1, hub:09bd5af8-65fe-437b-8005-bc3e4a8d21b0]
05471502-1082-41c4-a63d-d710e2f48e48 4:16:45 PM: trace mediaRendererDiscovery() state.subscribe true
05471502-1082-41c4-a63d-d710e2f48e48 4:16:40 PM: trace verifyMediaRenderer(C0A8010C:0510, /, 192.168.1.12:1296)
05471502-1082-41c4-a63d-d710e2f48e48 4:16:40 PM: trace verifyMediaRenderer(C0A80108:22B8, /upnp_descriptor_0, 192.168.1.8:8888)
05471502-1082-41c4-a63d-d710e2f48e48 4:16:40 PM: trace mediaRendererDiscovery() state.subscribe true
05471502-1082-41c4-a63d-d710e2f48e48 4:16:35 PM: trace verifyMediaRenderer(C0A8010C:0510, /, 192.168.1.12:1296)
05471502-1082-41c4-a63d-d710e2f48e48 4:16:35 PM: trace verifyMediaRenderer(C0A80108:22B8, /upnp_descriptor_0, 192.168.1.8:8888)
05471502-1082-41c4-a63d-d710e2f48e48 4:16:35 PM: trace mediaRendererDiscovery() state.subscribe true
05471502-1082-41c4-a63d-d710e2f48e48 4:16:25 PM: trace verifyMediaRenderer(C0A8010C:0510, /, 192.168.1.12:1296)
05471502-1082-41c4-a63d-d710e2f48e48 4:16:25 PM: trace verifyMediaRenderer(C0A80108:22B8, /upnp_descriptor_0, 192.168.1.8:8888)
05471502-1082-41c4-a63d-d710e2f48e48 4:16:25 PM: trace mediaRendererDiscovery() state.subscribe true
05471502-1082-41c4-a63d-d710e2f48e48 4:16:20 PM: trace verifyMediaRenderer(C0A8010C:0510, /, 192.168.1.12:1296)
05471502-1082-41c4-a63d-d710e2f48e48 4:16:20 PM: trace verifyMediaRenderer(C0A80108:22B8, /upnp_descriptor_0, 192.168.1.8:8888)
05471502-1082-41c4-a63d-d710e2f48e48 4:16:19 PM: trace mediaRendererDiscovery() state.subscribe true
05471502-1082-41c4-a63d-d710e2f48e48 4:16:14 PM: trace verifyMediaRenderer(C0A8010C:0510, /, 192.168.1.12:1296)
05471502-1082-41c4-a63d-d710e2f48e48 4:16:14 PM: trace verifyMediaRenderer(C0A80108:22B8, /upnp_descriptor_0, 192.168.1.8:8888)
05471502-1082-41c4-a63d-d710e2f48e48 4:16:14 PM: trace mediaRendererDiscovery() state.subscribe true
05471502-1082-41c4-a63d-d710e2f48e48 4:16:08 PM: trace verifyMediaRenderer(C0A8010C:0510, /, 192.168.1.12:1296)
05471502-1082-41c4-a63d-d710e2f48e48 4:16:08 PM: trace verifyMediaRenderer(C0A80108:22B8, /upnp_descriptor_0, 192.168.1.8:8888)
05471502-1082-41c4-a63d-d710e2f48e48 4:16:08 PM: trace mediaRendererDiscovery() state.subscribe true

4:14:13 PM: debug Found TX-NR609 (TX-NR609 by ONKYO)
d96c0013-d62c-4153-b950-03271d94e57c 4:14:13 PM: info parseDESC()
d96c0013-d62c-4153-b950-03271d94e57c 4:14:13 PM: trace [deviceDiscovery] Discovered devices: [:]
d96c0013-d62c-4153-b950-03271d94e57c 4:14:13 PM: debug Verifying 2 devices
d96c0013-d62c-4153-b950-03271d94e57c 4:14:13 PM: trace There are 0 verified devices
d96c0013-d62c-4153-b950-03271d94e57c 4:14:09 PM: trace [deviceDiscovery] Discovered devices: [:]
d96c0013-d62c-4153-b950-03271d94e57c 4:14:09 PM: trace discoverDevice() Issuing SSDP request
d96c0013-d62c-4153-b950-03271d94e57c 4:14:09 PM: trace There are 0 verified devices
d96c0013-d62c-4153-b950-03271d94e57c 4:14:07 PM: debug Found TX-NR609 (TX-NR609 by ONKYO)
d96c0013-d62c-4153-b950-03271d94e57c 4:14:07 PM: info parseDESC()
d96c0013-d62c-4153-b950-03271d94e57c 4:14:06 PM: trace [deviceDiscovery] Discovered devices: [:]
d96c0013-d62c-4153-b950-03271d94e57c 4:14:06 PM: debug Verifying 2 devices
d96c0013-d62c-4153-b950-03271d94e57c 4:14:06 PM: trace There are 0 verified devices
d96c0013-d62c-4153-b950-03271d94e57c 4:14:03 PM: debug Found TX-NR609 (TX-NR609 by ONKYO)
d96c0013-d62c-4153-b950-03271d94e57c 4:14:03 PM: info parseDESC()
d96c0013-d62c-4153-b950-03271d94e57c 4:14:03 PM: trace [deviceDiscovery] Discovered devices: [:]
d96c0013-d62c-4153-b950-03271d94e57c 4:14:02 PM: debug Verifying 2 devices
d96c0013-d62c-4153-b950-03271d94e57c 4:14:02 PM: trace There are 0 verified devices
d96c0013-d62c-4153-b950-03271d94e57c 4:14:00 PM: debug Found TX-NR609 (TX-NR609 by ONKYO)
d96c0013-d62c-4153-b950-03271d94e57c 4:14:00 PM: info parseDESC()
d96c0013-d62c-4153-b950-03271d94e57c 4:13:59 PM: trace [deviceDiscovery] Discovered devices: [:]
d96c0013-d62c-4153-b950-03271d94e57c 4:13:59 PM: debug Verifying 2 devices
d96c0013-d62c-4153-b950-03271d94e57c 4:13:59 PM: trace There are 0 verified devices
d96c0013-d62c-4153-b950-03271d94e57c 4:13:56 PM: debug Found TX-NR609 (TX-NR609 by ONKYO)
d96c0013-d62c-4153-b950-03271d94e57c 4:13:56 PM: info parseDESC()
d96c0013-d62c-4153-b950-03271d94e57c 4:13:55 PM: trace [deviceDiscovery] Discovered devices: [:]
d96c0013-d62c-4153-b950-03271d94e57c 4:13:55 PM: debug Verifying 2 devices
d96c0013-d62c-4153-b950-03271d94e57c 4:13:55 PM: trace There are 0 verified devices
d96c0013-d62c-4153-b950-03271d94e57c 4:13:52 PM: trace [deviceDiscovery] Discovered devices: [:]
d96c0013-d62c-4153-b950-03271d94e57c 4:13:52 PM: trace discoverDevice() Issuing SSDP request
d96c0013-d62c-4153-b950-03271d94e57c 4:13:52 PM: trace There are 0 verified devices
d96c0013-d62c-4153-b950-03271d94e57c 4:13:49 PM: debug Found TX-NR609 (TX-NR609 by ONKYO)

@Paul_Preston thanks for sharing the logs! Do you already have Kodi setup as a device within Media Renderer? If so, you may need to remove just the Kodi device from Media Renderer and then try the discovery with the Kodi SmartApp.

I found that when I tried out Media Renderer last night, it would not find my Kodi devices which were already setup using Kodi for SmartThings, so I assume the reverse is probably true (eg. Kodi for SmartThings isn’t finding Kodi devices which are already setup in Media Renderer).

My device can see what’s playing on the Media Center, but doesn’t seem to have any control. From the logs I can see it sending the messages, but clearly my device is not accepting them. Configuration issue at my end?

I’m using a OpenELEC (official) 5.0.8 RPi2.arm.

Do you have a username and password set up for Kodi?

This happens if they aren’t entered.

Another item is to verify the URL is correct and use the Override URL if necessary. I needed to override the URL for my PC. It pulled up what was playing correctly, but had another IP address for some reason. Putting in the correct one with port granted me the ability to control using the app.

1 Like

I don’t have a user name or password set.
It seems to be able to have some level of communications, otherwise it wouldn’t know what was playing. Are you sure setting the Override URL would make a difference in this case? According to the live logging it seems to be working fine.

The URL will show up in the app in the bottom left corner when you’re in the device.
Do the URL and port match your media player?

Yep same IP as when I ping the unit.

I’m not able to get to it from my browser though…is the URL supposed to bring up a UI via the browser?

I just tested it for my remote kodi player (Fire TV) and using the address and port does bring up a login for me. I put in the username and password and it brings up a UI

Do you have it set up for Allow Remote Control via HTTP?

Yes, I had made that change when it didn’t work initially.

Are you using the default port of 80?
I had to change mine off 80 to have communication. This was done when I was testing the Callbacks for Kodi SmartApp and Device Type, but I left it that way for this.

2 Likes