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

VD stops working after 3 - 4 Hours..


Question

Posted

I have a VD that checks status of a Fibaro Door/Window sensor and its working fine for a while but suddenly it seems that the http request wont get an answer and the VD stops working.

 

fibaro:debug("Checking Status..")
VD = Net.FHttp("192.168.2.85",80); 
VD:setBasicAuthentication("user","password");
 
response ,status, errorCode = VD:GET("/api/panels/event?last=1&type=id&deviceID=699");
fibaro:debug("Received answer.. trying to decode it..");
 
Everytime it has stopped, the last thing i see is "Checking Status"..
 
Any ideas?
 
BR

7 answers to this question

Recommended Posts

  • 0
Guest
Posted

I have exactly the same with below code in the main loop (no code elsewhere).

2-3 hours and then stops without any errors. On the debug screen it just shows up to latest check.

Restart home center and it works for another 2-3 hours....................

 

local currentDate = os.date("*t");
 
--Router Connection
router = Net.FHttp("192.168.1.1");
router:setBasicAuthentication("username", "password");
response, status, errorCode = router:GET("/DEV_device2.htm")
 
--Check TH Presence
if(string.find(response, "E8:B9:D0:1A:E0:C4")) then
 fibaro:setGlobal("PresenceTHHome", "Hjemme");
 fibaro:setGlobal("PresenceLastSeenTH",os.date("%H:%M", os.time()))
 fibaro:setGlobal("PresenceStatus", "Hjemme");
  fibaro:call(105, "setProperty", "ui.Label1.value", "Hjemme")
  fibaro:debug("Tor H Hjemme")
else
 fibaro:setGlobal("PresenceTHHome", "Borte");
  fibaro:call(105, "setProperty", "ui.Label1.value", "Ute " .. "siden " .. fibaro:getGlobal('LastSeenTH'))
  fibaro:debug(" Tor H Ute")
end
 
 
fibaro:call(105, "setProperty", "ui.Label4.value", os.date("%D - %H:%M", os.time()))
  • 0
Posted

I have the same error with a VD. Make a workaround and put my code of the main-loop into a button and make a scene, which pushes the button every 2 seconds (In main-loop it runs every 3 seconds). Works good for me. 

  • 0
  • Inquirer
  • Posted

    Yesterday i copied all code inside this VD, deleted it, made a new VD and paste the same content.

    Its been running for 14 Hours now so it seems it did the trick..

    • 0
  • Inquirer
  • Posted

    Yesterday i copied all code inside this VD, deleted it, made a new VD and paste the same content.

    Its been running for 14 Hours now so it seems it did the trick..

     

    And now it has stopped again.. When it worked i had forgot to update the correct VD ID when i update the setProperty, ui.label.value.

     

    Tortho: Can you temporary remove all setProperty value and only use fibaro:log to update info on your VD?

    Just to see if it works for you also?

     

    BR

    • 0
    Posted

    I had this problem to when i had it in main loop.

    Put the code in a button and make a scen that presses the button, and maby your problem will be solved.

    • 0
    Guest
    Posted

    747,

    My new code below. Just restarted, will let you know.

     

    sonnyboy,

    It might help, but thats not what it is supposed to be

    Please login or register to see this image.

    /emoticons/default_icon_wink.gif" alt=";-)" />

     

     

     

    local currentDate = os.date("*t");
     
    --Router Connection
    router = Net.FHttp("192.168.1.1");
    router:setBasicAuthentication("username", "password");
    response, status, errorCode = router:GET("/DEV_device2.htm")
     
    --Check TH Presence
    if(string.find(response, "F8:A9:D0:1A:E0:C4")) then
     fibaro:setGlobal("PresenceTHHome", "Hjemme");
     fibaro:setGlobal("PresenceLastSeenTH",os.date("%H:%M", os.time()))
     fibaro:setGlobal("PresenceStatus", "Hjemme");
     fibaro:log("TH Hjemme");
    --  fibaro:call(105, "setProperty", "ui.Label1.value", "Hjemme")
      fibaro:debug("Tor H Hjemme")
    else
     fibaro:setGlobal("PresenceTHHome", "Borte");
     fibaro:log("TH Ute");
    --  fibaro:call(105, "setProperty", "ui.Label1.value", "Ute " .. "siden " .. fibaro:getGlobal('LastSeenTH'))
      fibaro:debug(" Tor H Ute")
    end
    fibaro:sleep(2000)
    • 0
    Guest
    Posted

    Hi, It worked for about 4 hours, and then it stopped, so no difference between set property or the fibaro:log..

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