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
Nevicare 0
Hi All,
I want to store a table into a variable, this looks fine:
The TableVAR has the following content:
Please login or register to see this attachment.
But now I want the read this TableVAR again back into the Table array.
That is the part I don't get to work..
Gives the error:
/usr/share/lua/5.3/json/util.lua:55: bad argument #1 to 'for iterator' (table expected, got number)
And when I try to read the Global Variable like this:
The output is:
Table"{\"12\":\"1501\",\"13\":\"2500\",\"11\":\"1000\"}"
But the I can't use this as a table..
Gives an error:
main.lua:20: attempt to concatenate a nil value (field '12')
Which part am I missing here? What is the correct way to handle a table in a Global Variable?
Thanks in advance.
5 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.