Jump to content

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


  • 0

[Solved] How to create a empty table on Global Vars


FSE
 Share

Question

I like to initialize an empty table (like HomeTable) from a scene if it is not exist. I tried the simple following lua code but it fails.

 

Please login or register to see this code.

It sounds crazy but I stuck on this point for 2 days...and my Bosch/Siemens Home-Connect project (I will share it with you guys) is on halt due to this **small** detail.

Any help is more than welcome!

 

P.S.

@10der I know that you help people (high appreciate, thank you) like me on first steps... 

what a fool....!

here is the code:

 

Please login or register to see this code.

here is the source:

 

Another question is howto check if a variable is a table or something gone wrong during writing (human interaction).

Edited by korniza
Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0
20 minutes ago, korniza said:

I like to initialize an empty table (like HomeTable) from a scene if it is not exist. I tried the simple following lua code but it fails.

 

It sounds crazy but I stuck on this point for 2 days...and my Bosch/Siemens Home-Connect project (I will share it with you guys) is on halt due to this **small** detail.

Any help is more than welcome!

 

P.S.

@10der I know that you help people (high appreciate, thank you) like me on first steps... 

3

 

sorry. but in last HC ver it's pain... and I am lost here... AFAIK when you trying to access to non-exists var you got unexpected HC2 API exception like

[DEBUG] 20:53:28: [1;31m2018-09-14 20:53:28.103913 [ error] API: Not found [DEBUG] 20:53:28: Variable 'TableGlobal' created successfully.

[DEBUG] 20:53:28: [1;31m2018-09-14 20:53:28.103913 [ error] API: Not found
[DEBUG] 20:53:28: Variable 'TableGlobal' created successfully.

but you can try

 

Please login or register to see this code.

 

  • Thanks 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...