Welcome to Smart Home Forum by FIBARO
Dear Guest,
as you can notice parts of Smart Home Forum by FIBARO is not available for you. You have to register in order to view all content and post in our community. Don't worry! Registration is a simple free process that requires minimal information for you to sign up. Become a part of of Smart Home Forum by FIBARO by creating an account.
As a member you can:
- Start new topics and reply to others
- Follow topics and users to get email updates
- Get your own profile page and make new friends
- Send personal messages
- ... and learn a lot about our system!
Regards,
Smart Home Forum by FIBARO Team

Question
Jay Ess 6
I am trying to build a simple array, with a list of device id's and then save it to a globalvariable and then fetch this variable to switch on / off as a group?
so afr i have managed to get this to work.
local tb = {}
if CornerVariable == "true" then
tb[#tb+1]={name=firstToUpper(CornerVariableName),id=ShabbosLightCorner}
end
if DovidVariable == "true" then
tb[#tb+1]={name=firstToUpper(DovidVariableName),id=ShabbosLightDovid}
end
if RifkaVariable == "true" then
tb[#tb+1]={name=firstToUpper(RifkaVariableName),id=ShabbosLightRifka}
end
if ShanaVariable == "true" then
tb[#tb+1]={name=firstToUpper(ShanaVariableName),id=ShabbosLightShana}
end
setGroupVariable = tb
fibaro.setGlobalVariable(GroupVariableName, json.encode(setGroupVariable))
the problem i am having is when i try to fetch the variable i am struggling to control them as they are coming back as a table correctly so, but when i then run this code it does not work.
function TurnOffLights(GroupName)
for k,i in ipairs(GroupName) do
if fibaro.getValue(i, "state") == true then
fibaro.call(i, "turnOff")
end
end
end
been knocking my head trying to get this working and am climbing the walls LOL from frustration, any help would be gratefully recieved.
thank you
3 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.