[OBSOLETE] Kodi/XBMC Callback Endpoint for Light Control

New version is up with a fix for Android and some changes to settings screen. Apparently there was a bug with the instance icon setting in Android so I removed it =)

Possible feature to add: a section for other lights. I.E. the current section is ā€œDim these lightsā€ and the other section is ā€œTurn off (or on, I guess) these lightsā€

Technically you can set any switch in the ā€œdimā€ section. It should interpret anything less than 100 as off. this way you can even mix dimmers and basic switches.

Hmmm, Iā€™ll play with that. I want to turn off lights in the other room and leave them off, but couldnā€™t figure out how thatā€™d work with these values and normal switches.

With different values from the main set of lights? If just those select them, set all the events to 0. That will turn them off whenever something happens in Kodiā€¦

I have not added different values for different lights yet, maybe in the futureā€¦

1 Like

Thanks for the update.
Iā€™m able to install the app and configure it in Android now, but I get a ā€œYou are not authorizedā€ error when attempting to view the URLs in Android.

I have even gone so far as to wipe the phone and reinstall the ROM, both the stock and the one I normally run.

I have also tested on four separate tablets and get the same issue.

Unfortunately, I do not have any iDevices around, and the Simulator works to show me the install and the icons in the Simulator, but I canā€™t get the URLs from within the simulatorā€¦ It just shows me icons for my Living Room Lampsā€¦

Hmm, I only have two android devices and both are fine with latest code. Have you removed the app from smartthings and re-added with newest code (as opposed to just over-writing old code)?

I overwrote the old code. Iā€™ll redo it here momentarily. :smile:

Edit: I am unable to uninstall it.
Iā€™ve removed it from my SmartApps on my device, but the IDE tells me I canā€™t delete it at this time because it is installed by one or more users.

Iā€™m the only one with itā€¦ Let me keep poking at it.

Ok. I was able to remove it from the IDE (I had forgotten to remove the ā€œHomeā€ from the Location)ā€¦

Reinstalled it in the IDE from scratch, re-added it to my Android. I get the same error. ā€œYou are not authorizedā€ when attempting to view URLs.

Looking at some other posts it seems that might be an error for your account: Getting "You are not authorized" message

Do other app installs work normally? Maybe try opening a support case and see if they find anything oddā€¦

Thanks for the tip. That is possible it is an account issue. Iā€™ll see what they say. :smile:

Thank you for all of your help @thildemarā€¦
It helps if I donā€™t miss the absolutely crucial step of enabling OAuthā€¦

Did that, was up and running and have it integrated with my CinemaVision plugin in Kodi 15.

Is it possible to have the lights fade up/down to their new level rather than do a hard ā€œsetLevelā€ type effect when changes occur?

=) That would do itā€¦

As far as fading the lights my understanding is that is a device specific setting. Trying to fade via an app would require basically a bunch of level commands in quick succession, not so great with the latency over internet and zwave. Ideally the device should have a fade time setting, what device are you controlling?

GE Z-Wave in-wall dimmer switch.

I have multiple lights I plan to shut off with this, but that is the only one I want to fadeā€¦ It controls the top half of all of the living room outlets which all have lamps plugged in.

I have one of those I can test with and it seems there is a duration attribute that is ā€œusuallyā€ supported by the basic dimmer device type. Iā€™ll give it a shot =)

I had a few minutes to spare so I reworked the app into a parent/child app. This will allow control of different groups of lights at different values with one command. I also added fade times to the extent that the native code supports them. I am not going to post here quite yet as I need some time testing at home to verify its working correctly on real devices, but it looks good so far on the virtual devices I have tested with. Soonā€¦

1 Like

To say I am floored is an understatement. Wow.
I look forward to the new release, and am able to test for you this evening as well, as I plan to use my light dimming in two stagesā€¦

Stage one:
CinemaVision will dim the lights as part of its sequence just prior to the trailer segment and again just prior to the movie startā€¦

Stage 2 will have the xbmc.callbacks performing the ā€œOn Pause/Stop/Resumeā€ functions with the URLs provided by your endpoint.

I have not found a way to get CinemaVision to support pause/play/resume commands in order to allow lighting control beyond the initial dim down and dim up.

If you would like for me to help test, Iā€™m more than willing and will be available this evening starting within the next hour or so.

Interesting. I have not yet played with CinemaVision. Sounds like maybe we should add some more event support in my app. Make sure I have this right:

Trailers start with CV - Dim down event call from CV
Actual Playback starts - Play event call from callbacks2
Pause/resume - pause/resume events from callbacks2
Stop - Stop event from callbacks2

Right?

Where does the CV Dim up command factor into things? Also, I would assume callbacks2 is triggering a play event when playing trailers, is this not the case?

Thinking adding a ā€œdimā€ event may not be a bad ideaā€¦

I will send you a PM with the updated code links. You are welcome to try them out, just know they are even more beta than the normal beta =)

Omw home. Detailed response in 30.