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
sarf77 11
Hi all,
The code below forms the beginning of a scene where I only need my staff to populate the ID numbers of any qty of lights up to a maximum of ten and then the rest of the scene references those ID numbers.
The scene is working well but lets say I only have 8 lights (as below) what can I put in between the brackets (as below) that will not create an error. Almost like a 'dummy" number if you will. Keeping in mind the code then calls for the value of that ID further down.
local light1 = (98) --garage flood--
local light2 = (114)--dining pendant--
local light3 = (159)--family room--
local light4 = (109)--backyard--
local light5 = (64)-- kitchen--
local light6 = (69)--island bench--
local light7 = (36)--lounge--
local light8 = (81) --toilet--
local light9 = () --name here--
local light10 =() --name here--
local light1v = tonumber (fibaro:getValue (light1, 'value'));
local light2v = tonumber (fibaro:getValue (light2, 'value'));
local light3v = tonumber (fibaro:getValue (light3, 'value'));
local light4v = tonumber (fibaro:getValue (light4, 'value'));
local light5v = tonumber (fibaro:getValue (light5, 'value'));
local light6v = tonumber (fibaro:getValue (light6, 'value'));
local light7v = tonumber (fibaro:getValue (light7, 'value'));
local light8v = tonumber (fibaro:getValue (light8, 'value'));
local light9v = tonumber (fibaro:getValue (light9, 'value'));
local light10v = tonumber (fibaro:getValue (light10, 'value'));
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.