[RELEASE] Kodi for SmartThings BETA

smartapp_av
kodi
dth_av

(Phil Pugh) #243

Yes I did have a play and tried every setting, looking at the options I think I have selected the right settings… Hopefully someone with Core experience will help out here :slight_smile:

The screens I do see are:

para

2

Essentially what I am trying to achieve is have a notification pop up when a power outlet drops to 0, is this something Sharp could achieve? I haven’t looked at that yet…


(Joshua Lyon (SharpTools.io Dashboard)) #244

What happens when you hit the ‘Add a String parameter’ option in your first screenshot? What you need is two parameters. So based on the screenshots, I would guess that you would first need to tap Parameters > Add a Parameter and make sure there are two “Value” fields showing. Then in the first value field, enter your desired notification title without any quotes. Then in the second value field, enter your desired message without any quotes.

SharpTools could achieve it, but if you are already using CoRE, then I would think you could accomplish it there too.


(Phil Pugh) #245

You legend!

Somehow I thought I could only pass one parameter… still learning the ropes.
Works a treat now…

Thanks a lot for your help.


(Steve ) #246

Hi Phil
What is it that this does?
Is it to receive notifications when something plays?
Did you say you can’t add his Github ? You should be able to I’m on the UK and it’s connected ok with mine.


(Phil Pugh) #247

Hi Steve,
I must admit I didn’t try to add the github as every time I tried any previously it failed and I read that github integration wasn’t implemented on EU IDE - this may have changed then! :slight_smile:

I have this now setup to send a notification to my Kodi setup when something triggers. The one I have setup so far sends a notification that the dryer cycle has finished when the power outlet drops below 1W for 30 seconds. This is handy as the laundry is the other side of the house as it helps us know when things have finished. I have also done the same for the washing cycle and am now thinking of more and more things I could use.

My next plan is to send an hourly notification when a window is open i.e “downstairs bathroom window has been open for x hours” - main reason being that we often forget to shut it!


(Steve ) #248

Ah right so you mean it will send a on screen message to Kodi?
So it will pop up and tell you about the dryer etc.
I have WebCore set at the moment to dim my room lamp if something starts playing on Kodi and the mode is set to night.


(Phil Pugh) #249

Yes exactly that :slight_smile:slight_smile:

It appears at the top of the screen on the skin I am using where all notification appear. I use a Hue add-on in Kodi to do the same with my lamp but I will look at doing a lot more now I have this SmartApp.


(Steve ) #250

Nice didn’t even think to send notifications that way :slight_smile:
Just had a quick look so what text do you put into the string parameter part ?
And where do you put the message?


(Phil Pugh) #251

You need to add two parameters - this is where I was going wrong!

The first parameter is the title of the notification and the second is the message. See the image below, this is a basic one I did yesterday as a test.


(Steve ) #252

That’s great thanks.
And thanks for the great smartapp @joshua_lyon


#253

FYI if you want to control your lights based on what type of video is playing (movie or TV) you can add a “track type” condition. IE my lights dim when a movie is being played but not a TV show.


(Phil Pugh) #254

Yes!!! That is something I wanted ages ago but thought I would never achieve. Thanks for very much for throwing this in here!

I assume here you would use an if statement with what you have shown above? Do you have a full screenshot of the whole code as I am still learning the ropes…


(Steve ) #255

That’s good to know
Thanks.
So I wonder could I go one step further and set my LED colour depending on the genre of film being played.
Say blue for romance…
Red for the adult entertainment :wink:


#256

Correct. Id give you the backup code for my piston but my ST setup it a bit of a mess right now as we are about to move. It would look something like this


#257

That might be possible, I’m not sure if genre info is passed to ST. Best way to find out would be to play something on kodi and look at the “recently” tab of your kodi device and see if mentions anything about genre.


(Phil Pugh) #258

Great - I assume the else statement brings the lights back up when you pause? Or am I way off the mark here?


#259

Yup you got it. I tried to figure out a way to have it save the light brightness value before the movie was played to a variable so that when it was paused it would go to that value but I couldn’t get it to work so I just set it to 100%


(Steve ) #260

Apparently the part in this piston works to save attributes.
Never tested it though


(Phil Pugh) #261

I am struggling with the only when section, I have tried to do something similar but it doesn’t look the same - is this a restriction i need to be choosing or something else?


(Joshua Lyon (SharpTools.io Dashboard)) #262

If I remember correctly, I’m pulling extra metadata into the trackData attribute (code) and the request is initiated from getVideoPlayerStatus() where a set of desired attributes are passed in (code).

You might have to add "genre" to the array of properties on L725 and then you would either need to parse the trackData json within CoRE or create a new DTH attribute and update it around L415.