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

Virtual Device Loop stop working after a while


Question

Posted

Hello

I have a virtual device loop to push names into labels in the VD. However, it is working perfectly but after a while it is like freeze. No changes is made to labels.

But after just save the VD (no changes) things will back to normal

Please login or register to see this code.

any help?

11 answers to this question

Recommended Posts

  • 0
Posted

add it as a button and then use a scene to press the button every 3 seconds or more than 3 seconds this is an error in the json that crashes the VD fibaro told me all about it when i had this trouble and they do not seem keen to put some fix in place...

  • 0
Posted

deanrparry, because that is problem in code not in virtual device, add checking response, status, erorcode and script will work all time

  • 0
  • Inquirer
  • Posted

    @A.Socha,

    I couldn't understand this. What do I have to add in the code to make it work?

    [ Added: 2014-07-02, 11:13 ]

    deanrparry,

    Do you think making that scene every 1 second will cause problems in my HC2?

    • 0
    Posted

    HC22 = Net.FHttp("IP",8735)

    response, status, errorCode = HC22:GET("/api/v1/zones/0/nowplaying")

    if tonumber(errorCode) == 0 and tonumber(status) ==200

    then

    xxx

    else

    fibaro:log("error on conection")

    end

    • 0
  • Inquirer
  • Posted

    A.Socha,

    Thanx I have modified my code and will post the result after testing

    Please login or register to see this image.

    /emoticons/default_biggrin.png" alt=":D" srcset="https://forum.fibaro.com/uploads/emoticons/[email protected] 2x" width="20" height="20" />

    • 0
    Posted

    I have notified Fibaro about that a while. Don't use Net.FHttp() inside main loop.

    I will die with error without any way to get it working again after random hours of time.

    I have tried anything to catch errors, but this will not do anything.

    The ONLY way to get your code working :

    Make a button like reload, and in main loop press this button every X seconds... Stupid but fail proof.

    • 0
  • Inquirer
  • Posted

    kiwi,

    Did you try the above code thing?

    Because logically it is the same, the loop will be executed every 3 seconds like the scene exactly.

    I will try both cases. As you have said the scene solution is not reliable i guess.

    Thanx

    Please login or register to see this image.

    /emoticons/default_smile.png" alt=":)" srcset="https://forum.fibaro.com/uploads/emoticons/[email protected] 2x" width="20" height="20" />

    [ Added: 2014-07-02, 13:33 ]

    A.Socha,

    The response, status, errorCode solution didn't work

    Please login or register to see this image.

    /emoticons/default_sad.png" alt=":(" srcset="https://forum.fibaro.com/uploads/emoticons/[email protected] 2x" width="20" height="20" />

    the same problem

    Please login or register to see this image.

    /emoticons/default_sad.png" alt=":(" srcset="https://forum.fibaro.com/uploads/emoticons/[email protected] 2x" width="20" height="20" />

    I will go for adding a button but it is not a solution

    Please login or register to see this image.

    /emoticons/default_sad.png" alt=":(" srcset="https://forum.fibaro.com/uploads/emoticons/[email protected] 2x" width="20" height="20" />

    [ Added: 2014-07-02, 14:08 ]

    kiwi,

    Would you tell me what i am doing wrong?

    Please login or register to see this code.

    i want the scene to be activated every 3 seconds

    • 0
    Posted
    HC22 = Net.FHttp("IP",8735)

    response, status, errorCode = HC22:GET("/api/v1/zones/0/nowplaying")

    if tonumber(errorCode) == 0 and tonumber(status) ==200

    then

    xxx

    else

    fibaro:log("error on conection")

    end

    this check failed aswell for me when i tried it on your last advice... i personally do not use them anymore they simply do not work very well!

    • 0
  • Inquirer
  • Posted

    What do you use then?

    • 0
    Posted

    Move your code in a update button.

    Then in the mainloop do :

    Please login or register to see this code.

    (the "5" in this code is the number of the update button)

    • 0
  • Inquirer
  • Posted

    kiwi,

    Thanx this is working

    Will test it for the whole day and it you know

    Please login or register to see this image.

    /emoticons/default_biggrin.png" alt=":D" srcset="https://forum.fibaro.com/uploads/emoticons/[email protected] 2x" width="20" height="20" />

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