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

Question

Posted (edited)

Dear all,

 

I'm facing a little problem with a lua script in a scene.....  the result is always a Unknown exception: /opt/fibaro/scenes/67.lua:10: attempt to index global 'Net' (a nil value)

 

So I read that I need to use the net.HTTPClient instead in a scene but I'm not able to rewrite the existing code of my working VD-button.

 

Could someone help me? That would really be brillant!!!

 

Please login or register to see this code.

Thank you very much for your help...

 

Dan

Edited by Danielos
added things

9 answers to this question

Recommended Posts

  • 0
Posted (edited)
47 minutes ago, Danielos said:

Dear all,

I'm facing a little problem with a lua script in a scene.....  the result is always a Unknown exception: /opt/fibaro/scenes/67.lua:10: attempt to index global 'Net' (a nil value)

So I read that I need to use the net.HTTPClient instead in a scene but I'm not able to rewrite the existing code of my working VD-button.

Could someone help me? That would really be brillant!!!

Thank you very much for your help...

Dan

 

This could work

Please login or register to see this code.

 

Edited by jgab
  • 0
  • Inquirer
  • Posted

    @jgab thank you very much! But unfortunately, I think it doesn't work...

     

    I added a fibaro:debug("test") in the handleResult-function to check if the system handles the results. And no "test" is shown in the debug console.

     

    Please login or register to see this code.

     

    So I think it never starts....... 

     

    Any ideas?

     

    Thanks!

     

    Dan

    • 0
    Posted
    2 hours ago, Danielos said:

    @jgab thank you very much! But unfortunately, I think it doesn't work...

     

    I added a fibaro:debug("test") in the handleResult-function to check if the system handles the results. And no "test" is shown in the debug console.

     

    Please login or register to see this code.

     

    So I think it never starts....... 

    Any ideas?

     

    So, nothing at all? Add some more debugs, but I suspect it hangs on the request.

    Please login or register to see this code.

     

    • 0
  • Inquirer
  • Posted

    @jgab nope... my newest version of the script:

     

    Please login or register to see this code.

     

    And the results in the debug:

     

    Please login or register to see this code.

     

    So the "IST GEGANGEN" debug is never shown what means for me, the function didn't run. What do you mean?

    • 0
    Posted
    3 minutes ago, Danielos said:

    @jgab nope... my newest version of the script:

     

    Please login or register to see this code.

     

    And the results in the debug:

     

    Please login or register to see this code.

     

    So the "IST GEGANGEN" debug is never shown what means for me, the function didn't run. What do you mean?

     

    I think the requests never terminates (which makes the handleResult never being called)- Try to set a shorter timeout and see what happens

    Please login or register to see this code.

     

    • 0
    Posted (edited)

    In handleResult there is an error referencing response instead of result in gmatch (but that's not your main problem)

    Please login or register to see this code.

     

    Edited by jgab
    • 0
  • Inquirer
  • Posted

    @jgab ... 

    Please login or register to see this code.

     

    • 0
    Posted
    2 minutes ago, Danielos said:

    @jgab ... 

    Please login or register to see this code.

     

    Ok, your web server returning the realtime.csv is cooperating that the right way - any chance to debug that? I guess you tried to surf to "http://192.168.178.31:80/realtime.csv"and it works?

    Do you need credentials to access the url? username/password?

     

    If I run 

    Please login or register to see this code.

    with a test.csv file on a local web server that looks like

    Please login or register to see this code.

    I get the output

    Please login or register to see this code.

     

    • 0
  • Inquirer
  • Posted

    @jgab a good question.... I'm configuring that for a friend of mine and I can't open the browser on his computer. But I know that the VD-script from my first post is running perfectly, so I don't think that there are credentials or something else needed.

    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...