Logic Machine Forum
getting started with hue - Printable Version

+- Logic Machine Forum (https://forum.logicmachine.net)
+-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1)
+--- Forum: Scripting (https://forum.logicmachine.net/forumdisplay.php?fid=8)
+--- Thread: getting started with hue (/showthread.php?tid=2488)



getting started with hue - GIA - 26.02.2020

Hi,

never ever seen lua scripts before I got this wiser. Huh
So:
I have to ask if some one can guide me in the right direction.
My mission is to get hue lamps work with the knx/ wiser.

SO I am following the application note from Schneider El; Philips Hue lamps controlled from Wiser for KNX.
It stops for me at step 9, I cant get any thing from the hue bridge!
Should I fill in something in the code? I just created a start-up(init) script and paste the code in step 9.

Step 1 Open Wiser for KNX Configurator in your browser.
Step 2 Go to Configurator >> Scripting >> User libraries.
Step 3 Click button Add new library in left bottom corner on the screen.
Step 4 Into field Script name, write upnp. Uncheck Auto load library and click Save.
Step 5 In column Editor, click the icon on the row with created upnp library.
Step 6 Open upnp.lua library attached to this application note and copy the content
to this script opened
in Step 5.
Step 7 Click Save and close.
Step 8 Repeat steps 3 - 7 for the second library named hue.
Step 9 Create e. g. Event script and paste there following code:
local Bridge = require('user.hue').Bridge
log(Bridge.discover())
Step 10 Save and Run script.
Step 11 In the left bottom corner on the screen click Logs. Write down the IP address
of discovered bridg
e(s), it will be needed later. Pay attention information
abou
t https. This parameter indicates the bridge’s capability to communicate
via https protocol. When you see this parameter is set to false, you must
expli
citly set it to false when instantiating class Bridge.


Tanks


RE: getting started with hue - Erwin van der Zwart - 26.02.2020

Hi,

I use my own script, and have not tested this one, but for the IP address you don't realy need a command, you can see it in the HUE app if needed.

Try to skip step 9 and fill in the IP from the app, and see if you can continue the next steps..

Otherwise you might want to use my version of the HUE scripts, see: https://forum.logicmachine.net/showthread.php?tid=890&pid=6549#pid6549

BR,

Erwin


getting started with hue - GIA - 02.03.2020

Tank you Erwin,

that did do the trick. Smile


RE: getting started with hue - MLa - 13.05.2020

Hallo,

Is there a way to read status of groups(rooms) as I understand it, the HUE bridge gives the following status of groups: any_on, all_on, off. How do I read this status in wiser?

BR
Magnus


RE: getting started with hue - Erwin van der Zwart - 13.05.2020

Hi,

See this topic: https://forum.logicmachine.net/showthread.php?tid=890&pid=6250#pid6250

BR,

Erwin


RE: getting started with hue - MLa - 12.06.2020

(13.05.2020, 17:38)Erwin van der Zwart Wrote: Hi,

See this topic: https://forum.logicmachine.net/showthread.php?tid=890&pid=6250#pid6250

BR,

Erwin

Hi,

I have had a look, and I do not understand how to read the status on an entire group.
I et statsus for one lamp, but not for a group.

I'm interested in seeing if any of the outdoor lights are on.

I'm new to Wiser for KNX, and the LUA language.
Any help is appreciated. 

BR Magnus


RE: getting started with hue - Daniel - 15.06.2020

I never used this script but if you can read individual lamp from a group then you can use it as a group feadback. It is the same when you control them together.


RE: getting started with hue - Erwin van der Zwart - 15.06.2020

Hi,

Currently the feedback script uses the command getHueLights() to get the JSON response from the bridge for the induvidual lamps, and this response is processed further to sync the KNX objects according the light states.

If you want this also for groups you need to use the command getHueGroups() and change the feedback script so it will process the JSON response from the bridge in the same way.

So i'ts possible but takes a bit of work.

BR,

Erwin