eliotstocker / Light-Controller

To Control lights from companys such as limitless LED etc
http://eliotstocker.github.io/Light-Controller/
62 stars 24 forks source link

(documentation) of intents to controll lights #42

Closed vitoller closed 9 years ago

vitoller commented 9 years ago

is it already possible to use an intent to control the lights?

I would like to use Llama or a shell script to control the lights.

If it is already implemented, it would be great to have some documentation on how to do it.

(in case someone is interested: I want to control/automate lights from a Kodi tv-player)

mrwhale commented 9 years ago

So do you want to send a command from the tv running kodi to your phone to control the lights? Or have the ability to do it via the kodi android app while you are controlling the tv?

vitoller commented 9 years ago

The Kodi-TV-player is an android box and has Light-Controller installed locally.

A similar scenario would be for the phone (with locally installed Light-COntroller): When Llama (http://kebabapps.blogspot.de) detects that I enter or leave a certain area (home), it could switch the lights automatically.

mrwhale commented 9 years ago

Oooh that makes more sense! Yeah you can api that @eliotstocker is writing up. I'm sure you could integrate tasker into this scenario to get a quick fix.

eliotstocker commented 9 years ago

the intents are there! yeah! check out the Lightcontroller API on my github. Ill try and tidy up the docs etc a little more

On Mon, Aug 3, 2015 at 9:07 AM mrwhale notifications@github.com wrote:

Oooh that makes more sense! Yeah you can api that @eliotstocker https://github.com/eliotstocker is writing up. I'm sure you could integrate tasker into this scenario to get a quick fix.

— Reply to this email directly or view it on GitHub https://github.com/eliotstocker/Light-Controller/issues/42#issuecomment-127157669 .

eliotstocker commented 9 years ago

Hi there, i have finally fixed the Markdown for the LightController API you can view it here: https://github.com/eliotstocker/Light-ControllerAPI

however if you are specifically looking for intents you can use the following: its best to send the flag FLAG_INCLUDE_STOPPED_PACKAGES with all Intents, as that will allow the API receiver to receive the call even if its not currently running

first request permission: Action: tv.piratemedia.lightcontroler.requestAPIPermission Extra: app_id: {Application package name} (You must send your application package name with the request (must be a valid installed package)); light controller will prompt the user to accept your app to use the API

Turn lights on: Action: tv.piratemedia.lightcontroler.LightOn Extras: type: color or white zone: 0-4 app_id : Application package name as above

Turn Lights off: Action: tv.piratemedia.lightcontroler.LightOff Extras: type: color or white zone: 0-4 app_id : Application package name as above

hope that helps, please remember that until the release of v1.7 (super soon!) these intents will only work for beta users.

for examples of implementation checkout the API Client Library code: https://github.com/eliotstocker/Light-ControllerAPI/blob/master/lightcontrollerapi/src/main/java/tv/piratemedia/lightcontroler/api/LightControllerAPI.java

you may also note that you dont have to request permission explicitly, as sending any request will propt the user for permission should they not already have accepted, there is also a content resolver that you can query in order to check if your application has permission, but if youre getting into things like that id recommend using the API Client Library

vitoller commented 9 years ago

Cool, thanks. - i will try it (with v1.7) The documentation  should help  a lot to geht it Wirkung. Cool Software, horst Am 11.08.2015 10:53 vorm. schrieb Eliot Stocker notifications@github.com:Hi there, i have finally fixed the Markdown for the LightController API you can view it here: https://github.com/eliotstocker/Light-ControllerAPI

however if you are specifically looking for intents you can use the following: its best to send the flag FLAG_INCLUDE_STOPPED_PACKAGES with all Intents, as that will allow the API receiver to receive the call even if its not currently running

first request permission: Action: tv.piratemedia.lightcontroler.requestAPIPermission Extra: app_id: {Application package name} (You must send your application package name with the request (must be a valid installed package)); light controller will prompt the user to accept your app to use the API

Turn lights on: Action: tv.piratemedia.lightcontroler.LightOn Extras: type: color or white zone: 0-4 app_id : Application package name as above

Turn Lights off: Action: tv.piratemedia.lightcontroler.LightOff Extras: type: color or white zone: 0-4 app_id : Application package name as above

hope that helps, please remember that until the release of v1.7 (super soon!) these intents will only work for beta users.

for examples of implementation checkout the API Client Library code: https://github.com/eliotstocker/Light-ControllerAPI/blob/master/lightcontrollerapi/src/main/java/tv/piratemedia/lightcontroler/api/LightControllerAPI.java

you may also note that you dont have to request permission explicitly, as sending any request will propt the user for permission should they not already have accepted, there is also a content resolver that you can query in order to check if your application has permission, but if youre getting into things like that id recommend using the API Client Library

—Reply to this email directly or view it on GitHub.