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

What does T_END mean?


Question

Posted

Hi,

 

Our bathroom ventilator stops once in while because of an error in my virtual device. What does this error therefore mean, as line 2 of the main loop (and all other code snippets) is empty. Line 1 is however "local hT = json.decode(fibaro:getGlobalValue("HomeTable"))".

 

Many Thanks! 

 

---
[DEBUG] 23:33:22: Temperature shower source: 40.68
[DEBUG] 23:33:22: Humidity bathroom: 55
[DEBUG] 23:33:22: Automatic control activated
[DEBUG] 23:33:22: Control method set to temperature
[DEBUG] 23:33:22: Temp in middle zone
[ERROR] 23:34:25: line 2: Expected value but found T_END at character 1
 

2 answers to this question

Recommended Posts

  • 0
Posted (edited)

It means json.decode got either no data or corrupt data to decode.

 

It's possible this happens randomly, or the global variable got corrupted.

 

You can use some tests to avoid crashing (use "pcall" in your code). Like this:

 

Please login or register to see this code.

 

I tested it in a scene and I've made a quick test in a VD. It's OK

 

I'm not good at coding VDs, but I can tell this... It might make sense to do something else than "debug": add a label to indicate the last error. Also keep in mind "main" runs every 3 seconds.

 

pcall is standard Lua, not a Fibaro extension:

 

Please login or register to see this link.

 

Good Luck! 

Edited by petergebruers
  • 0
Posted

Thanks, think i got it now

 

Please login or register to see this code.

 

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.

×
×
  • Create New...