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
SDeath 68
Did anybody else use global variables to define all their device ID's to variables?
i.e. I use the global variable ID_FrontDoor = 125, and in all the LUA code I set a local variable to match the value like this:
local FrontDoorID = tonumber(fibaro:getGlobalValue("ID_FrontDoor"))
This way when any device ID changes because we need to re-include it for whatever reason we only have to change this global variable and all LUA should work as it should.
Did anyone already do this for all their LUA coding?
I see lot's of people needing to re-include when testing the latest Beta's and them all having to change their LUA coding because of the new ID's.
Are there any pitfalls in this approach?
I'd like to hear your thoughts about this.
14 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.