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

Icon are set to default value at HC2 reboot


Question

Posted

Dear All

When I reboot my HC2, all the icons from virtual devices are set to default values instead of the last one.

I have some doors sensors that are not ZWAVE. They are created as virtual devices and set using HTTP requests to the HC2 to display the icon related to the status of the door.

When I reboot the HC2, all my doors are displayed as open whereas they are closed (It was the last status that was display before the reboot)

So It will be more correct to record this last status. Else I have to open and close all my doors to initialize my virtual devices

Thanks

David

6 answers to this question

Recommended Posts

  • 0
Posted

Quikdav, add a code in a main loop, that will be executed only at first run of loop and update its state.

  • 0
  • Inquirer
  • Posted
    Quikdav, add a code in a main loop, that will be executed only at first run of loop and update its state.

    what a pity !!! I wanted to avoid code and especially main loop for each of these kind of virtual devices. Setting their icons just by a http request was a "light" and simple solution with requirering any resources from the HC2

    How can I run code in a main loop only once ? because main loop are executed each 3 seconds !!!

    I think it could be a good improvement

    Please login or register to see this image.

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

    Thanks

    David

    • 0
    Posted

    Please login or register to see this code.

    You check if variable is "nil" ( do not initialize it anywhere before in that loop), which is true for every uninitialized variable. At the end of "if" you set it, so condition is not met anytime after 1st loop.

    • 0
  • Inquirer
  • Posted

    Please login or register to see this code.

    You check if variable is "nil" ( do not initialize it anywhere before in that loop), which is true for every uninitialized variable. At the end of "if" you set it, so condition is not met anytime after 1st loop.

    ok thanks a lot

    What do you think about restoring the status after reboot (without any code) ?

    • 0
    Posted

    Quikdav, that would be hard to done, since every virtual is different. For now we do not have any solution for that.

    • 0
  • Inquirer
  • Posted
    Quikdav, that would be hard to done, since every virtual is different. For now we do not have any solution for that.

    Ok I thought that having all the data available (in JSON format) for any virtual devices, these data were recorded so it could be easy to get them in case of reboot.. Obviously, it depends on the choice of implementation you did for the HC2...

    but I think it's important to retrieve a system in the same state it was before a rebooting... adding code is a solution that can be resources consuming...

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