How to Dim via Alexa without Python?

Posted on
Sat Sep 22, 2018 10:52 am
ketchup318 offline
Posts: 32
Joined: Aug 04, 2011

How to Dim via Alexa without Python?

Hi, I've installed the Alexa-Hue plugin and everything works great! The only thing I can't figure out is how to dim the lights to a set level without using Python. I've read through the documentation, and have set up dimming variables to capture the dim values. But, the only way I found to dim is to use Python. Is there another way to do this? I'm not a fan of hard-coding ID's, and would rather have the variable names in the code for ease of readability.

My code right now is (taken from one of Jay's posts)
brightness = int(indigo.variables[VARIDHERE].value) # ID of the variable that has the brightness
indigo.dimmer.setBrightness(DIMMERIDHERE, value=brightness)

I've looked at the set brightness option in the lighting controls section, but that requires a fixed integer, not a variable. I've tried the dimmer extender plugin; that allows me to use a variable to set brightness, but the plugin isn't working for some reason.

Thanks

Posted on
Sat Sep 22, 2018 11:02 am
autolog offline
Posts: 3988
Joined: Sep 10, 2013
Location: West Sussex, UK [GMT aka UTC]

Re: How to Dim via Alexa without Python?

Can't you just say (for example):
Alexa dim <YOUR DEVICE NAME> to fifty percent

Posted on
Sat Sep 22, 2018 11:38 am
roussell offline
User avatar
Posts: 1108
Joined: Aug 18, 2008
Location: Alabama

Re: How to Dim via Alexa without Python?

As long as when setting up the device-to-be-dimmed (in the Hue Bridge device you first created), you DIDN'T check the box for treating the dimmable device as an on/off device. It should work as Jon mentioned above, no coding requiring.

Terry

Posted on
Sat Sep 22, 2018 10:02 pm
ketchup318 offline
Posts: 32
Joined: Aug 04, 2011

Re: How to Dim via Alexa without Python?

Maybe I'm going about this all wrong. When I setup the Hue device, I choose Indigo Action for the kitchen lights for example (2 sets of 3-way switches). For the Indigo On action, I choose the KitchenLightsOn action group; for the Indigo Off action, I choose the KitchenLightsOff action group. I don't need the on/off variable, so I leave that as NO VARIABLE

For the Indigo DIM action, I choose the KitchenLightsDim action group, with a dimLight variable specified for the Dim Variable.

So I confusion is how to setup the KitchenLightsDim action group and have it use the dimLight variable. I can see the plugin enters the DIM value when I say 'dim kitchen lights to 50%'. But what type of Action do I use in the Action group? I'm currently using python, but if there's an easier way, I'd prefer to use that.

Roussell, where's the box that you can check to treat the device as on/off? With regards to dimming, I only have 2 dropdown boxes for dimming, the Indigo DIM Action, and the Indigo Dim Action Variable.

Thanks

Posted on
Sun Sep 23, 2018 2:52 am
autolog offline
Posts: 3988
Joined: Sep 10, 2013
Location: West Sussex, UK [GMT aka UTC]

Re: How to Dim via Alexa without Python?

Ok - Thanks for the explanation - I hadn't clocked that you were using action groups. :)

Try this python code for the dim action:
Code: Select all
dimVarValue = int(indigo.variables[987654321].value) # "Your variable" where 987654321 is your Variable Id
indigo.dimmer.setBrightness(12345678, dimVarValue) # "Your device" where 12345678 is your Device Id
The Indigo Dim Action (handle Dim as On/Off) check box is only displayed if you use an Indigo Device rather than an Action to response to the Alexa request- you are using an action which is why it isn't relevant and you can't see it.

Hope this helps :)

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 2 guests