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

Call to check communication to device is not lost


Question

Posted

Im wanting to check that a secondary device hasnt lost communication (a fibaro relay) , as a condition  in a scene.

What  is the best way to do this?

Thanks

9 answers to this question

Recommended Posts

  • 1
Posted (edited)
10 hours ago, Jamie mccrostie said:

Im wanting to check that a secondary device hasnt lost communication (a fibaro relay) , as a condition  in a scene.

What  is the best way to do this?

Thanks

 

This requires a long answer and I will write one but probably not today because I am involved in too many topics already...

 

Short answer: there is no way to do that... Mains powered devices do not communicate if they have nothing to tell, so there is no way to find out without doing "something". On a Z-Wave level, the equivalent of "IP ping" exists (called NOP) but it is not available in scenes. It would not be a good idea to start randomly sending NOPs though... Note, in 2017 ping is also not a good tool to determine if a device is online...

 

So if you want to make sure a mains device is alive, you can "poll" it. For background on polling I recommend:

 


 

When does a mains device become "dead"? This happens when the controller had too many problems communicating with it.

Why does it become dead? It is a safeguard, you cannot send to a dead device, this avoids network issues.

 

If you want to send/test a dead device, first you have to make it un-dead. I do not say "make it alive" but that would give the false impression the device is online. No, "un-dead" means simply "remove the dead flag so you can try to communicate again". If the receiver is really dead, it will go dead again.

 

It is not a good idea to "un-dead" and poll dead devices randomly though... because of the "mesh" networking and "explorer frames". If a device is really dead and you send a packet, your network will be very busy for a moment because it tries all different routes. If you put that in a tight loop, you might end up with unresponsive Z-Wave.

 

1 hour ago, 10der said:

Hay @petergebruers, I know what you guru :)  here.

Our question is: how right to check dead circuit (dead) device?

 

Thank you for the compliment. If you heave read the previous part, you probably have guessed "it is complex matter".

I'll answer to that question later.

 

Short answer... If you have never tried what states a device can be in, or go through, if it goes offline and maybe back online, then you probably have no clue how that works, because I did not have a clue at first either! I'll give you a hint before I post my script(s): experiment, and have a close look at the green text on a device in the BUI!

 

9 hours ago, Thomasn said:

Maybe something like

 

check = fibaro:getValue(150,  "Value") -- Where 150 is the ID on the device to be checked

if check == nil then

 

Nope...

 

If you really want to be 99,999% sure a device has received your on or off command, you need something like a "safe send script" and also you have to think about... what am I going to to if the safe send fails? For instance: send a mail to admin, and try again after 5 minutes?

 

Edited by petergebruers
  • 1
Posted (edited)
13 minutes ago, 10der said:

If powered device lost power I'll never know about it remotely. for example, if I have Fibaro binary sensor and power on this device was lost I will see always +5 degrees and be thinking all OK.

Yes. But if you set global polling or use device specific polling, the HC will check the device according to the timing set in polling. In my case, global polling is 15 minutes. If polling fails, it will set the device to "dead". I am not sure it does that after 1 failed attempt - I have to try. But eventually, with polling enabled, it will go "dead". But then your temperature graph still gets stuck at +5 because neither Z-Wave nor HC has a means to store "this is not a valid number"...

Edited by petergebruers
  • 0
Posted (edited)

.

Edited by Thomasn
Stand corrected.
  • 0
Posted (edited)
7 hours ago, Thomasn said:

check = fibaro:getValue(150,  "Value") -- Where 150 is the ID on the device to be checked

if check = "nil" then

    fibaro:debug("device off line")

else

   fibaro:debug("Everything is OK")

end

 

 

 

Please login or register to see this code.

 

and btw, it doesn't work.

for example, I have an unplugged device from power

 

[DEBUG] 10:07:34: 1
[DEBUG] 10:07:34: Everything is OK
[DEBUG] 10:07:41: 1
[DEBUG] 10:07:41: Everything is OK

BUG] 10:07:34: 1
[DEBUG] 10:07:34: Everything is OK
[DEBUG] 10:07:41: 1
[DEBUG] 10:07:41: Everything is OK

 

AFAIK we can check dead value

like fibaro:debug(fibaro:getValue(650, 'dead')) 

but idk when this value will be "1" maybe need some more time. 

Edited by 10der
  • 0
Posted

UPD: after an hour HC2 still think what a device is alive.

 

[DEBUG] 11:02:07: 1
[DEBUG] 11:02:07: 0
[DEBUG] 11:02:07: Everything is OK

 

 

 

Hay @petergebruers, I know what you guru :)  here.

Our question is: how right to check dead circuit (dead) device?

LOfJVpCXxP.png

 

local check = fibaro:getValue(650,  "value") 

[DEBUG] 11:02:17: 1

 

MQ05OKyHKV.png

 

  • 0
Posted
8 minutes ago, 10der said:

UPD: after an hour HC2 still think what a device is alive.

 

[DEBUG] 11:02:07: 1
[DEBUG] 11:02:07: 0
[DEBUG] 11:02:07: Everything is OK

 

 

 

Hmmm. Strange as my scene worked in the beginning - with your corrections. However, now it doesn't work.....?

  • 0
Posted

@petergebruers

so, short total amount. If powered device lost power I'll never know about it remotely. for example, if I have Fibaro binary sensor and power on this device was lost I will see always +5 degrees and be thinking all OK. 

  • 0
Posted (edited)

I have a button I want to check if the button is responsive or if he's away from the fibaro network (-> the button is used as presence detection)

 

I tried the script you posted and exchanged the value 650 with my own ID of the button.

Please login or register to see this code.

But I always receive this status:

 

Quote

DEBUG] 12:00:47: nil
[DEBUG] 12:00:47: device off line

 

Even I know that the device is running... I can push it and it starts scenes. Is there an error in the script? Or how can I check if the device is alive?

 

Thank you very much for your help...

 

 

 

 

Edited by Danielos

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