Lua Commands with the AltHue Plugin - Hue, Saturation, Effect etc.

Hell? Fellow Vera Users…

Tryng to command my Hue Lights with Lua from the scene editor…

I searched for some examples on this Forum, but can find mostly stuff related to the old plugin, while I am using AltHUE…

I haven’t been able to find a syntax that works for me…

I have tried:

luup.call_action(“urn:upnp-org:serviceId:AltHue1”, “SetHueAndSaturation”, {Hue=“64879”;Saturation=“253”}, 138)

luup.call_action(“urn:upnp-org:serviceId:AltHue1”, “SetHueAndSaturation”, {Effect=“colorloop”}, 138)

luup.call_action(“urn:upnp-org:serviceId:AltHue1”, “SetHueAndSaturation”, {Hue=“64879”;Saturation=“253”;Effect=“colorloop”}, 138)

These had “PlilipsHue1” originally in place of AltHue1…

None works…

How should I build the command?
Is there a list of the Commands accepted by AltHUE Plugin?
I was specifically trying to start Colorloop as an “Effect”, as in the last command above…

Any Hint, please?
Thank you so much!
Joe

[quote=“Joe Daring, post:1, topic:199572”]luup.call_action(“urn:upnp-org:serviceId:AltHue1”, “SetHueAndSaturation”, {Hue=“64879”;Saturation=“253”}, 138)
luup.call_action(“urn:upnp-org:serviceId:AltHue1”, “SetHueAndSaturation”, {Hue=“64879”;Saturation=“253”;Effect=“colorloop”}, 138)[/quote]

Well, for starters, the separators between array/table elements should be commas (“,”) not semicolons (“;”). But I don’t have any Hue lights to test with to guide you further.

SetHueAndSaturation Is not an action supported by the althue plugin as you can see in the service Sxxxx.xml file.
Instead Althue creates devices that are standard devices and each devices have their own actions using standard services ( SetColor etc )

On the other hand , you do have a up plan action called RunHueScene on the AltHue device and you need to pass the hue scene Id to it, you find data in the althue Hue Scenes tab.

If you run it with ALTUI it is very easy to see what action and parameters are needed for each actions.
Hope that helps

Oh! I see…
There should be no need to use LUA with ALTHUE because of the different philosophy with regards to the devices it creates…

And, yes, I have seen how to choose Brightness and Color (Hue + Saturation) when using an Hue lamp/bulb in scenes…

Fine…

BUT! The reason I was trying to do something with LUA is that I wanted to start Colorloop on some of the Lamps…

ColorLoop is an “Effect” (Actually the ONLY one so far, as it seems…) and not a real scene and, over this, it is something implemented directly in Firmware on each Lamp/Bulb, as I understand it…

As a consequence, in most applications, Colorloop is not listed in the Scene List and has no Scene ID, while some of them (Alexa, for instance…) are able to discover and use it…

In fact, I can initiate a Colorloop via Alexa’s Voice command…

Any chance this could be added to AltHue?

Thank you very much
Joe

Can you send?me Hue data extract from settings tab and which light it is ?

[quote=“Joe Daring, post:4, topic:199572”]Oh! I see…
There should be no need to use LUA with ALTHUE because of the different philosophy with regards to the devices it creates…

And, yes, I have seen how to choose Brightness and Color (Hue + Saturation) when using an Hue lamp/bulb in scenes…

Fine…

BUT! The reason I was trying to do something with LUA is that I wanted to start Colorloop on some of the Lamps…

ColorLoop is an “Effect” (Actually the ONLY one so far, as it seems…) and not a real scene and, over this, it is something implemented directly in Firmware on each Lamp/Bulb, as I understand it…

As a consequence, in most applications, Colorloop is not listed in the Scene List and has no Scene ID, while some of them (Alexa, for instance…) are able to discover and use it…

In fact, I can initiate a Colorloop via Alexa’s Voice command…

Any chance this could be added to AltHue?

Thank you very much
Joe[/quote]

I have made v1.40 on GitHub - amg0/ALTHue: Alternate Hue Plugin with a new UPNP action to contro this. it can also be triggered from the “Hue Device” tab of ALTHUE
not all lamp are compatible, Hue Device tab only proposes the button for the right lamps

UPNP action SetEffect(childId,effect) effect must be the string none or colorloop ( like in Hue api ) childID must be the targeted VERA device ID.

WoW!
Lightning fast, amg0… nice indeed and thanks…

Maybe I should have mentioned that there is also another flag, similar to the “effect=colorloop” one, and that is “Alert”

It is a separate command, not an alternative to ColorLoop…

Not that I’m trying to use it, but just for completeness’ sake…

The choces for “alert” are: ?none?, ?select?, ?lselect? where “select” flashes a bulb once, “lselect” flashes a bulb for 30 seconds (about 15 Flashes…) or less if you set it back to “none”.

But I’m telling you things you already know, for sure… forgive me…

Going to test 1.40… I guess it’s not on the Mios Store yet… Should I just copy the files over? And which one I needs to upload? to just get the plugin updated?

Great Job, BTW, thanks amg0
Joe

Oh!
And thank you also RigPapa for your note about syntax…

Ciao
Joe

Just download the zip from github and upload all files to your vera using the ui7 file upload feature.
Regarding alert I ll look but I am not sure it is used frequently enoug to be fully worthwhile the effort.
Thx !

No problems…
I understand… As I have said, I am not trying to use the alert function myself and I mentioned it just for completeness…

Thank you so much amg0

Joe

[quote=“amg0, post:3, topic:199572”]SetHueAndSaturation Is not an action supported by the althue plugin as you can see in the service Sxxxx.xml file.
Instead Althue creates devices that are standard devices and each devices have their own actions using standard services ( SetColor etc )[/quote]

Can you please point me to some examples / documentation etc on these 'standard services (setcolor etc) you talk of. What do I enter for that? A hex code, a word ‘blue’ in inverted commas, brackets, curly brackets, what is the syntax?

Thanks

[quote=“fyford, post:11, topic:199572”][quote=“amg0, post:3, topic:199572”]SetHueAndSaturation Is not an action supported by the althue plugin as you can see in the service Sxxxx.xml file.
Instead Althue creates devices that are standard devices and each devices have their own actions using standard services ( SetColor etc )[/quote]

Can you please point me to some examples / documentation etc on these 'standard services (setcolor etc) you talk of. What do I enter for that? A hex code, a word ‘blue’ in inverted commas, brackets, curly brackets, what is the syntax?

Thanks[/quote]

you can refer to ALTHue/S_ALTHUE.xml at master · amg0/ALTHue · GitHub ALTHue/I_ALTHUE.xml at master · amg0/ALTHue · GitHub for the action name and parameter and service name to use and ALTHue/L_ALTHUE.lua at master · amg0/ALTHue · GitHub and look at the Userxxx() functions.

the SetColor() expects a new color target which is a string made of a letter and then 0 to 255 and will produce the result based on the following rules
– Warm White: Wx
– Cool White: Dx
– W0 <–> W255 = D0 <–> D255
– 2000K <–> 5500K = 5500K <–> 9000K

the setColorRGB() expects a RGB string , comma separated with red, green, blue values ( 0 to 255 )

the setEffect() expects ‘none’ to ‘colorloop’ ( only 2 effects supported in Hue ).

Thanks!! that sorted me!

Hi!

First of all, thank you so much for this plugin, really appreciate it!

I’m trying to create a Vera scene which sets the HueScene “Bright” for all devices. I can see the HueSceneIds in the tab “Hue Scenes” in the plugin device, but with my limited knowledge I’m not sure how the luup code should look like.
From this thread and the XMLs, it looks like I should use RunHueScene(lul_device,hueSceneID)

Could anyone provide some input if for example I want to trigger the two scenes: TQpUirg9QbVwJ9l, yNjl3gxoMhUM6HL which seem to group by room and include multiple devices.

Thanks!

[quote=“scorp10, post:14, topic:199572”]Hi!

First of all, thank you so much for this plugin, really appreciate it!

I’m trying to create a Vera scene which sets the HueScene “Bright” for all devices. I can see the HueSceneIds in the tab “Hue Scenes” in the plugin device, but with my limited knowledge I’m not sure how the luup code should look like.
From this thread and the XMLs, it looks like I should use RunHueScene(lul_device,hueSceneID)

Could anyone provide some input if for example I want to trigger the two scenes: TQpUirg9QbVwJ9l, yNjl3gxoMhUM6HL which seem to group by room and include multiple devices.

Thanks![/quote]
you can use UI7 advanced scene editor and enter the action / parameters.
or better ALTUI.

both screen shot attached.

you can also use the lua section wth the standard lua code for running a device 's action. do not forget the return true

luup.call_action("urn:upnp-org:serviceId:althue1", "RunHueScene", {["hueSceneID"] = xxxx }, DEVID_ALTHUE)
return true

[quote=“amg0, post:15, topic:199572”][quote=“scorp10, post:14, topic:199572”]Hi!

First of all, thank you so much for this plugin, really appreciate it!

I’m trying to create a Vera scene which sets the HueScene “Bright” for all devices. I can see the HueSceneIds in the tab “Hue Scenes” in the plugin device, but with my limited knowledge I’m not sure how the luup code should look like.
From this thread and the XMLs, it looks like I should use RunHueScene(lul_device,hueSceneID)

Could anyone provide some input if for example I want to trigger the two scenes: TQpUirg9QbVwJ9l, yNjl3gxoMhUM6HL which seem to group by room and include multiple devices.

Thanks![/quote]
you can use UI7 advanced scene editor and enter the action / parameters.
or better ALTUI.

both screen shot attached.

you can also use the lua section wth the standard lua code for running a device 's action. do not forget the return true

luup.call_action("urn:upnp-org:serviceId:althue1", "RunHueScene", {["hueSceneID"] = xxxx }, DEVID_ALTHUE) return true [/quote]

Got it! The advanced editor was new to me, thanks!