SmartThings Community

[RELEASE] Kodi for SmartThings BETA


(Joshua Lyon ( Dashboard)) #323

What troubleshooting have you done so far?

The device status is set in one of two ways:

  1. When the UPnP event comes in reflecting the updated status. [Reference]
    Note: This requires that UPnP eventing is setup properly, but this is the primary and preferred way of maintaining the status.
  2. In the JSON response if you manually control Kodi via SmartThings [Reference]

(DJAC) #324

Thank you… But I’m just struggling with the resume.
I can see Kodi is playing and when it stopped.
But pause works excellently but resume does not.
From the hit hub, I actually don’t see resumed, so how does Kodi distinguish between movie started and resumed… ?

(Joshua Lyon ( Dashboard)) #325

Started and Resumed are both just a status of ‘playing’.

(DJAC) #326

thank you. I thought we could be more specific so that when a movie pauses, i switch on a few lights and on resuming, i switch them back on

(Joshua Lyon ( Dashboard)) #327

Playing, Paused, Stopped are the currently monitored status events (from UPnP). Keep in mind there are a number of other attributes the device type exposes as documented here:

Using just the status attribute, you would still be able to do something like:

  1. Dim the lights to 0% when you start playing something
  2. Dim the lights to 50% when you pause something
  3. Dim the lights to 0% when you resume playback (eg. toggle play/pause)
  4. Dim the lights to 100% when you stop playback

Again, the “playing” and “resumed” in this case are both just “playing” statuses… if you wanted to get more fancy than that you would need to use something else to help tie in some additional logic. Maybe consider the last status, or trackDescription, trackData, trackType, currentWindowID, or currentActivity when the status changes to “playing”.

(Gene Clark) #328

I’ve since noticed the execute addon command I’m wondering if anyone can offer tips on finding out what ID of addons would be? It appears to be just the directory of the addon, correct?

(Joshua Lyon ( Dashboard)) #329

@GRClark If I remember correctly, some Kodi skins used to show the add-on ID when viewing its settings. I don’t know if it would always be the directory of the add-on, but the add-on ID should be available in the add-on’s XML file (among other places).

(Gene Clark) #330

Another question: how can I get past this without having to remove device? I’ve checked and re-checked to make sure credentials are correct but this error won’t go away.

(Joshua Lyon ( Dashboard)) #331

The username and password should only get used in commands if the username is set (the cog in the top-right).

I haven’t used Kodi for a long time now, so it’s possible that something changed with their authentication approach if you are using a newer Kodi version?

(Gene Clark) #332

Excuse me for being dense, but capabilities include being music player so I’m wondering is there a way to specify a URL of MP3 and have it played on Kodi? Or can you not send media to Kodi that way?

(Joshua Lyon ( Dashboard)) #333

I noticed you liked the capabilities doc a few posts up - not sure if you found your answer in there but there are options for playing files (even from the web).

The music capability is primarily in there for allowing people to select the device in various rule engines and SmartApps but many of the methods map to other media player methods (this is also documented in the capabilities doc).

playFile(filename) - starts playing a file (can be a local or HTTP streamed file!)

(DJAC) #334

@joshua_lyon Is there any way to decrease the 20 minute Time it takes to refresh when activies are entered so that i do not have to wait or pull out my phone to refresh the smartapp.
I can change something on the IDE code, can i not?

(Joshua Lyon ( Dashboard)) #335

I’m not sure I follow. Have you verified that UPnP eventing is working. Most updates should be sent over as events rather than refreshed / polled.

(DJAC) #336

I mean when Kodi Realises a movie or series has started. Sometimes. It starts immediately and sometimes it takes 15 minutes before the lights adjust.
I just don’t wanna go to the smartapp all the time

(Joshua Lyon ( Dashboard)) #337

Play and pause status, including starting a movie or TV series, should be UPnP event based and near instantaneous. If you aren’t getting the event updates, then something isn’t working as expected.

(DJAC) #338

I’m confused. Cause you yourself have stated
If either of the Run Time values are not within 20 minutes of the current time, you can try manually updating the SmartApp to kickoff the scheduler per How do I manually update the scheduler?
So that is the problem I am having. Has this been updated since…
I don’t want to manually update it

(Joshua Lyon ( Dashboard)) #339

In order to keep an updated state, the integration fundamentally relies upon UPnP Eventing. If something about that is not setup properly, is blocked in your network, or is otherwise not working, then you won’t have updated events and thus won’t have the updated status of your devices.

You quoted a section about the Run Time values not being within 20 minutes of the current time. Are you sure that’s your issue? Without some screenshots/details on what you are seeing and what you have configured, we have no idea what status your system is in.

From what I’ve seen, when people are having issues with the eventing, it’s usually something fundamental with UPnP Eventing - either UPnP wasn’t enabled in the Kodi configuration or something on their device or network is blocking it. (For example, some Android TV boxes with Kodi seem to block UPnP eventing)

And to clarify on the 20 minute refresh… the primary goal of that is to keep the UPnP Event subscriptions fresh and in sync. As a side-effect, it also gets a fresh copy of the state as a baseline. The 20 minute refresh is not intended as the primary method for keeping the attributes updated.

(DJAC) #340

Yes I’m sure that’s the problem. Tonight it worked instantly when a TV show started.
When it ended, lights never resumed. Other nights the take about 20 minutes till they register . Somme nights are instant.
Is there any suggestions. I’m currently on the original version, unless you made an update.

(Joshua Lyon ( Dashboard)) #341

As mentioned above, I’m going to need screenshots and additional details in order to help troubleshoot.

I’m driving blind without more information.

(DJAC) #342

OK. What do you need. Also. Have you perhaps updated the app