Sign in   |  Join   |  Help

LUA on BLGW

rated by 0 users
This post has 8 Replies | 2 Followers

Chris Hassell
Top 200 Contributor
London
Posts 393
OFFLINE
Bronze Member
Chris Hassell Posted: Mon, Apr 24 2017 11:16 AM
Hi all, I have my BLGW back up and running after moving house. With the capability to change commands to Lua code we can now create IF ELSE statements. So excited!! One button can now turn lights on and then off if they're already on!!!

BeoVision Eclipse 55”, Beolab 18s, Beolab 19s, Beosound 1, Beoplay P2, H3, BeoRemote One IR, BeoRemote One BT, Beoplay S8, Beosound Essence MkII, BeoTime

Seanie_230
Top 50 Contributor
UK
Posts 1,974
OFFLINE
Bronze Member
Great isn't it

One day I will self teach myself how to create drivers

BLGW - Rekindling the love of ML

Chris Hassell
Top 200 Contributor
London
Posts 393
OFFLINE
Bronze Member
Have you done anything interesting with it yet @seanie_230 ? I haven't had a proper play yet but I did a generic lights on/off switch.

BeoVision Eclipse 55”, Beolab 18s, Beolab 19s, Beosound 1, Beoplay P2, H3, BeoRemote One IR, BeoRemote One BT, Beoplay S8, Beosound Essence MkII, BeoTime

Carolpa
Top 100 Contributor
Posts 831
OFFLINE
Bronze Member
Carolpa replied on Mon, Apr 24 2017 6:49 PM

Chris Hassell:
Have you done anything interesting with it yet @seanie_230 ? I haven't had a proper play yet but I did a generic lights on/off switch.
I tried to read the setting temperature of the Nest Thermostate and increase the value +1. Didn't succeed until now. I can adjust it to a value, but I want to make a button to increase / decrease the settings.   

 

boskonay
Top 500 Contributor
Posts 72
OFFLINE
Bronze Member

Any good 'starter' macros or code samples available?

I'd love to have timed events happen, conditional on button presses or other device states...!

Chris Hassell
Top 200 Contributor
London
Posts 393
OFFLINE
Bronze Member
So far I've just created the below as a global way of having an on/off light switch (when turning on I use a scene called 'standard'). Would love to create IF/ELSE statements using time, or time relative to sunset.

__________

function(event, engine)

local result = engine.query(event.area() .. "/" .. event.zone() .. "/DIMMER/*/")

if result[1].get("LEVEL") == "0" then

engine.fire(event.area() .. "/" .. event.zone() .. "/BUTTON/Standard/PRESS");

else

engine.fire(event.area() .. "/" .. event.zone() .. "/DIMMER/*/SET?LEVEL=0");

end

end

__________

BeoVision Eclipse 55”, Beolab 18s, Beolab 19s, Beosound 1, Beoplay P2, H3, BeoRemote One IR, BeoRemote One BT, Beoplay S8, Beosound Essence MkII, BeoTime

mjmedlo
Top 100 Contributor
Posts 921
OFFLINE
Bronze Member
mjmedlo replied on Sat, May 6 2017 2:10 AM
Carolpa:

I tried to read the setting temperature of the Nest Thermostate and increase the value +1. Didn't succeed until now. I can adjust it to a value, but I want to make a button to increase / decrease the settings.

This may be coming to you already in the next updates. Big Smile
Carolpa
Top 100 Contributor
Posts 831
OFFLINE
Bronze Member
Carolpa replied on Sat, May 6 2017 5:02 AM

mjmedlo:
Carolpa:
I tried to read the setting temperature of the Nest Thermostate and increase the value +1. Didn't succeed until now. I can adjust it to a value, but I want to make a button to increase / decrease the settings
This may be coming to you already in the next updates. Big Smile

Still it is a good case to learn LUA

 

ChrisBerlin
Not Ranked
Posts 21
OFFLINE
Bronze Member

Hello,

I want to control lights brightness dependent with Lua, but it doesn’t work. I want to use my KNX-sonsor to set the mode setting dependent on the brightness. The outdoor sensor gives me a lux value displayed in the monitor. But I can not get it to read out the value so that if the value is above a certain lux value the mode is set to day (or light) and night (or dark). I tried it with Lua code but I cant get it work. I have to admit, that i am a total beginner

Here the code:

function(event, engine) 

  local result = engine.query("global/Terrasse/_KNX_Group_Address/Helligkeit")  

  if result[1].get("Value") > "30000" 

  then 

  engine.fire("global/Wohnung/VARIABLE/Tageszeit/SET?VALUE=Hell")

  engine.fire("global/global/SYSTEM/BLGW/SET MODE?mode=Hell") 

  else

    engine.fire("global/Wohnung/VARIABLE/Tageszeit/SET?VALUE=Dunkel")

  engine.fire("global/global/SYSTEM/BLGW/SET MODE?mode=Dunkel")

  end

end 

I got this error:

18-05-01 11:58:59 Event fired global/Terrasse/_KNX_GROUP_ADDRESS/Helligkeit/SET?VALUE=26462

18-05-01 11:58:59 Event fired global/Terrasse/_KNX_GROUP_ADDRESS/Helligkeit/SET_NONZERO

18-05-01 11:58:59 Macro fired global/Wohnen/MACRO/Test Macro Helligkeit

18-05-01 11:58:59 Error: global/Wohnen/MACRO/Test Macro Helligkeit execution error: Line 3: attempt to index field '?' (a nil value)

Anyone here an idea what i did wrong?

Thanks

 

Christof

Page 1 of 1 (9 items) | RSS
Beoworld Security Certificate

SSL