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

[SCENE] Dead Device Check


Question

Posted (edited)

Hi All,

 

Can't post in Crowd Solutions, so thought this would be the second best place to go.

 

I've been working on a solution for the issue with not getting notified when you have a dead node in your system. Currently I'm having issues with this so I wrote a script that sends an e-mail if you have a dead node. 

 

it can also try to wake the node, if it then goes dead again it will not try to wake it again (as it is actually dead). You can choose to always get an email notification, or to only receive an e-mail notification if there are new nodes that have gone dead.

 

Please note that, if you choose to wake nodes, you should not run the script every minute, as it can seriously affect your system and cause freezes of 10 to 20 seconds. Personally I use @Sankotronic Time Scene Manager which runs it every 6 hours.

 

Special thanks to @petergebruers who helped create and tweak the script.

 

EDIT: Seems like layout gets a bit scrambled on the forum, added a txt with the code as well

Please login or register to see this code.

 

Please login or register to see this attachment.

Edited by eureka
edited the code, past was missing
  • Thanks 3

12 answers to this question

Recommended Posts

  • 0
Posted (edited)

I replace my old script based on one very old from this forum ;-)

I propose that You put your lua code in download/scenes section. It will be easier to find. Moderator quickly accepts new posts in the download section

Edited by drboss
  • 0
Posted

notice:

Don't overdo wakeUpDeadDevice

 

Thank you for understanding.

 

  • 0
Posted

@eureka for once. why you create DeadNode Global var?

for what?

why you create it as regular Variables, not a Predefined variable?

why you did not save dead nodes?

why script make user SPAM if user scheduled your script every other minute? but last by reason of  you did not save dead nodes back to global var.

fix should be here 

 

Please login or register to see this image.

  • 0
Posted

I think the author wrote this script to control the devices every few hours, a day instead of a cyclical (every minute) wake-up call. That's why it automatically sends an email, even if nothing has changed

  • 0
  • Inquirer
  • Posted
    57 minutes ago, 10der said:

    notice:

    Don't overdo wakeUpDeadDevice

     

    Thank you for understanding.

     

     

    Yes, like stated, please don't run the script every minute! Run it every six hours or so. That will be fine

    • 0
    Posted
    5 minutes ago, drboss said:

    I think the author wrote this script to control the devices every few hours, a day instead of a cyclical (every minute) wake-up call. That's why it automatically sends an email, even if nothing has changed

    if you wanna some troubles with delaying or something of the kind - yes wake-up device it :) the best way for it. @petergebruers is here so I can't lie.

    2 minutes ago, eureka said:

    Yes, like stated

    he-he

    • 0
  • Inquirer
  • Posted (edited)
    25 minutes ago, 10der said:

    @eureka for once. why you create DeadNode Global var?

    for what?

    why you create it as regular Variables, not a Predefined variable?

    why you did not save dead nodes?

    why script make user SPAM if user scheduled your script every other minute? but last by reason of  you did not save dead nodes back to global var.

    fix should be here 

     

    Please login or register to see this link.

     

     

    To minimise the amount of wakeUpDeadDevice calls it makes a global variable in which it stores a table with all the dead devices. If you run the script it will check for dead devices and put them into that table. The next time you run the script it will check whether it already found the deadnode in a previous run. If so, then it means the node is actually dead and it will not try to wake it again. Otherwise you would constantly try to wake it and you don't want to overdo that.

     

    I don't understand what you mean with user SPAM.

     

    with regards to your fix (json.encode(deadnodestablenew), this is incorrect. In that case it will only save the newly found dead nodes and remove the nodes that it has already found. 

     

     

    16 minutes ago, drboss said:

    I think the author wrote this script to control the devices every few hours, a day instead of a cyclical (every minute) wake-up call. That's why it automatically sends an email, even if nothing has changed

     

    It is optional to send an e-mail if nothing has changed. You can also opt for only getting emails when it find a new dead node, or choose to not get e-mails at all. You are however right that I accidentally deleted the setglobal to store the new table. Will amend the scipt in the first post!

    Edited by eureka
    • 0
    Posted

    as startup

     

    Please login or register to see this code.

    may call every minute 

    mark dead devices after 15 min (after wakeup)

    send report only if new deads or new back to alive or if flag full report if true (for example you may call one per day with this flag for getting stat) just call this scene with any params!

    prettyism totally off

     

     

    just one last note (again)

     

    for example, you have 3 room.

    for example, in one room happens power-off (outage)

    for example, in one room you have 5 (five) main powered devices.

    after waking-up (via command) HC2 will check additionally some conditions with this devices. You may get a situation when Z-wave network will overflow and slow on responses what I said before.

     

     

     

     

     

    • 0
    Posted

    This is very helpful. It would be great if you could move the updated version to the download section with the other scenes as it is hard to find on the forum. Thank you!

    • 0
    Posted

    Do not use waikup dead scene without checks it a bad practice and bring some strange artifacts to HC2 Zwave routing 

    It’s just for you info %username%

    • 0
    Posted

    Hi all,

     

    I don't think it is advisable to wake up dead devices with any script. It is OK to check if there is any dead devices, but waking them up with automatic script is in my opinion not recommended. Devices that are regularly or occasionally reported as dead should be checked and some proper action by users should be taken.

     

    There are several reasons why devices can be reported dead and those reasons can be:

    1. Battery devices, battery depleted despite reported good battery level.
    2. Mains powered devices lost power and during that time HC2 try to communicate with them unsuccessfully so marked as dead
    3. Device is placed far away from Home Center and has failed communication
    4. Device is moved to a new location without doing mesh network reconfiguration
    5. Home Center is moved to new location without doing mesh network reconfiguration
    6. Device parameters are out of sync with settings stored on Home Center (mostly for battery operated devices)
    7. Corrupted z-wave devices database on Home Center
    8. More than 60 devices included to z-wave network and not optimized for low communication so high traffic causes some devices to fail communicate with gateway
    9. Radio signal interference caused by some other source device

    Each of the above reasons that causes devices to drop dead can be solved:

    1. Replace battery. If first installation of new battery didn't cause device to wake up and send report then remove battery, wait a bit and reinstall battery again. Device MUST wake up and send report when new battery is installed. Some old version of Fibaro DW sensors and smoke sensors need repeating this until they finally send report
    2. As soon as power is restored and after that device is either pooled or contacted it will wake up
    3. Adding mains powered device between Home Center and that far away device can solve problem. When building wireless networks such is z-wave then planing of devices type (mains or battery powered) and their locations can save you from lots of trouble.
    4. After moving any device to new location it is advisable to make mesh network reconfiguration for that device and nearby devices (not complete network!)
    5. After moving Home Center to new location it is advisable to make mesh network reconfiguration starting with mains powered devices inwards out (nearest first) or do mesh network reconfiguration of all devices at once, but that can take considerable time and will render network unusable for that time depending on number of included devices and number of battery operated devices.
    6. Soft reconfiguration of the device should do the trick and sync settings on device and on gateway. In some cases neither soft or hard reconfiguration will help and then re-inclusion might be the only solution.
    7. Only what can help is restoring backup, so do backups at least once a week. 
    8. Scripts in download section from @petergebruers and @cag014 and

      Please login or register to see this link.

       from @amilanov can help greatly to reduce unnecessary traffic in z-wave network
    9. Without proper hardware it is almost impossible to find source of such problem, so turning off some suspect devices is the only way and patience.

    In the past I always had occasional dead devices, mostly some sensors and even some mains powered devices. After doing following steps I have no more delays in z-wave network and no more dead devices. NOTE my network has 109 physical z-wave devices included of which 55 are battery operated:

    1. After reaching 90 physical devices included and lots of problems I have rebuilded my complete network from scratch and first I included all mains powered devices and then all battery powered devices taking care that mains powered devices are strategically located so can be used as communication relays for other devices placed far away from gateway or in places where radio signal is degraded due to obstacles.
    2. After running @petergebruers and @cag014 scripts I adjusted all devices parameters to lower number or even eliminate reports for temperature, power etc.
    3. I did soft reconfiguration for all my devices that where reported as not synced with HC2
    4. I have greatly optimized my scenes and VD's code so that commands to devices are send only if needed and with small delays between transmissions so that devices can report back. At the moment I have 65 VD's with main loop running and 24 scenes of which 1 is running constantly while other scenes run as needed.
    5. My Z-wave network settings

      Please login or register to see this image.

      Please login or register to see this spoiler.

      Most of my mains powered devices are excluded from pooling. I have just a few set to pooling at some interval, one of them is Aeotec HEM.

    I have Z-Wave Sniffer from Suphammer and I used it only few times to monitor traffic on my network and it helped me to adjust manual parameters for Aeotec MS6 for which I removed template that has bug which causes sensor to send too much temperature reports.

     

    After doing all mentioned above I have no more dead devices for long time and also lags are greatly reduced in my z-wave network. CPU and memory usage has also dropped. System is stable for long time.

     

    I can also write that most of my battery devices are correctly reporting their battery levels and I know that thanks to my

    Please login or register to see this link.

    which not only monitors battery levels but also remembers when was last battery replaced. 21 of 55 battery powered devices battery was replaced 13 months ago and of this 21 devices still 8 devices are reporting battery level at 100% which is insane. At least I know from the time passed that this devices could drop dead due to empty battery despite report says it is at 100%.

     

    Trust me when I write that if you have regularly or occasionally dead devices it is not recommended just to wake them up with some scripts, but it is better to find out cause of this behavior and resolve it.

     

    I want to thank @petergebruers, @cag014 and many other users for their help with solving many problems with z-wave network.

     

     

     

     

     

    • Like 2
    • Thanks 2
    • 0
    Posted

    @Sankotronic

     

    Very useful and valuable post.  Thank you.

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