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


Recommended Posts

2 hours ago, dcspock said:

Is this really the case? Is checking the status not also sending a command to the device to receive its current status?

No, commands like "if tonumber(fibaro:getValue(999,"value"))==0" do not communicate with the device. "Checking the status" as you call it is what "polling" is for (Lua: fibaro:call(817, "poll")). Checking values in Lua uses a cached value, it does not communicate with the device. All recent devices report status eg when you push a button and the device changes state, it will notify your HC. And if you send "turn ON" (on a healthy network) you can be almost certain, the device is doing what you've asked. It is a valid assumption to cache that value and avoid polling after a change. There are corner cases, and it is a bit more complex, but I think it would lead us too far (in this topic) to discuss them.

 

2 hours ago, dcspock said:

Is this more efficient than sending an on/off command? 

Because checking values in Lua uses a cached value, it is more efficient. But what about "polling" a device? That is going to cause real extra communication before sending an on/off so polling is to be avoided unless you have some sort of reliability problem (or a very, VERY old device, one that does not report eg switch status). And things like "soft reconfigure" and "read configuration" cause a truckload of communication. Usually the cached value is correct, if it is not then your situation warrants investigation... with Zniffer ;)

 

2 hours ago, dcspock said:

Or is the HC2 taking the last status it has got in its database?

Status is cached in the sqlite3 database on your HC2/HCL.

Link to comment
Share on other sites

  • Topic Author
  • 6 hours ago, dcspock said:

    Is this really the case? Is checking the status not also sending a command to the device to receive its current status? Is this more efficient than sending an on/off command? Or is the HC2 taking the last status it has got in its database? I hope its the first...?

     

    Yes, it really is the case. 

    The state of devices is stored locally on the HC2. When you check the state all you are doing is checking the last reported state as stored in the HC2, so it's an internal request within the HC2.

    When you send a command e.g. on/off, you are sending a zwave command which the HC2 zwave controller executes. You can create a lot of traffic and also probably add a little to CPU by not checking the state of a device before making a change to its state.

     

    More importantly, very happy you found the device and fixed the problem. Well done!

     

    EDIT: OMG, I clicked on page 3 of this thread after writing my answer and as I should have half expected @petergebruers answered your question about 10 times more thoroughly than me. haha!

     

    Edited by amilanov
    Link to comment
    Share on other sites

    On 11/19/2019 at 11:03 AM, petergebruers said:

    If it is not there... my script cannot help you.

    I had checked the API, it is simply not there... that why my comment Getting from Fibaro's device ID to the node is easy - the other way around seems impossible... ;-)

    @dcspock

    It's not so hard to get device ID from node ID

    Please login or register to see this code.

     

    Link to comment
    Share on other sites

    @cag014 I have liked your post because of the Lua code you have posted, but I would like to point out that your code would not return anything in @dcspock's case because the device was simply missing on HC2 (it was not in /api/devices). People might falsely assume that your Lua code has some magic tricks to find devices that have gone missing, this is not the case. Only Zniffer made it clear that such a device existed.

    Link to comment
    Share on other sites

    @petergebruers

    Indeed I don't want users to believe in Lua magic.

    I've just answered to @dcspock's statement that impossible to get device ID from node ID assuming if he can get node ID therefore device exist.

    I had checked the API, it is simply not there... that why my comment Getting from Fibaro's device ID to the node is easy - the other way around seems impossible... ;-)

    Link to comment
    Share on other sites

    • 4 weeks later...

    Hi, I can't retreive anymore on silicon labs site pc programmer, zniffer and associate tools. Only pc controller, sdk ... are accessible. Am i doing something wrong ? or an idea on why it has been removed ?  can somebody provide them to me ? I also have an zwame.me that i'll need to flash, so the full pack dev pack is wellcome :)  thanks guys for your help.

    EDIT: many thanks to @amilanov that has resubmitted them to me !

    Edited by Tony270570
    Link to comment
    Share on other sites

    • 1 month later...

    Hi

    I'm happy to read that reading a devices value from LUA does not cause any z-wave traffic because the reading comes from a cached value. Just for the record, is this the case for devices read through the HC2 API?

    Link to comment
    Share on other sites

    13 minutes ago, tnesheim said:

    Hi

    I'm happy to read that reading a devices value from LUA does not cause any z-wave traffic because the reading comes from a cached value. Just for the record, is this the case for devices read through the HC2 API?

    Yes, it is.

    Link to comment
    Share on other sites

    • 1 month later...
    Guest Kint

    Hi

     

    I don't know if this is the right tread, but I experience some issues when I try to do external backup on my HC2. 

    It's been creating backup for more than 15 hours and the prosess bar have not moved at all. How long time is this supposed to take? The prosess bar is "rotating". 

     

    Regards 

    Kint

    Link to comment
    Share on other sites

    @KintA backup usually takes two to three minutes so something has gone wrong with your backup.
    Try restarting your HC2. If it does not respond to the power switch, you can disconnect the mains voltage for approx. 10 seconds. Then try again.
    Also tell us which version of firmware you have, but I hope it is version 4.500 or later and that you have then removed the Recovery stick.

    Link to comment
    Share on other sites

    • 1 year later...

    10tender

    a saw your picture and wonder where i can find this script to my pc

    i had it in the past but lost it

     

    Please login or register to see this image.

    /monthly_2019_11/29554131-86F4-4BF0-B3CA-7850FC0B8768.thumb.jpeg.3f17f3c7ed3af22de2104b73098cca9f.jpeg" />

    Link to comment
    Share on other sites

    • 1 month later...
  • Topic Author
  • On 7/9/2021 at 5:39 AM, Kage said:

    10tender

    a saw your picture and wonder where i can find this script to my pc

    i had it in the past but lost it

     

    Please login or register to see this link.

     

    Why do you want the picture?

     

    I fixed my zwave issues without any pictures :)

    Link to comment
    Share on other sites

    not the picture duh!?

     

    But the script for it on de desktop

     

    thx btw

    • 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
    Reply to this topic...

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