Device presumed dead

Topics (not sure which fora)
when not sure where to post, post here and mods will move it to right forum.

Moderators: leecollings, remb0

Post Reply
valdoison
Posts: 21
Joined: Monday 03 March 2014 18:33
Target OS: Linux
Domoticz version: beta
Contact:

Device presumed dead

Post by valdoison »

Hello
When a device is "presumed death" the banner of the devicel turns red. The only way to recover is to restart Domoticz.
How can we recover information that do pass the red headband, to use it and revive Domoticz automatically by a script?
User avatar
gizmocuz
Posts: 2499
Joined: Thursday 11 July 2013 18:59
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Top of the world
Contact:

Re: Device presumed dead

Post by gizmocuz »

Not a solution, but you can also disable and enable the openzwave hardware i suppose ?
Quality outlives Quantity!
User avatar
Egregius
Posts: 2590
Joined: Thursday 09 April 2015 12:19
Target OS: Linux
Domoticz version: v2024.7
Location: Beitem, BE
Contact:

Re: Device presumed dead

Post by Egregius »

valdoison
Posts: 21
Joined: Monday 03 March 2014 18:33
Target OS: Linux
Domoticz version: beta
Contact:

Re: Device presumed dead

Post by valdoison »

Thank you for your answer.
However, before putting it into production, I made the following little test with several peripherals:

Code: Select all

<?php
$domoticzurl='http://127.0.0.1:8080/';
$zwaveidx=9;

$devices=json_decode(file_get_contents($domoticzurl.'json.htm?type=openzwavenodes&idx='.$zwaveidx),true);
foreach($devices as $node=>$data)
{
echo $node;
}
?>
[code]

And the answer is always the same "status" and only "status". "Result" never appears as an answer.
oliviers
Posts: 73
Joined: Wednesday 16 September 2015 22:10
Target OS: Raspberry Pi / ODroid
Domoticz version: Stable
Location: Paris area, France
Contact:

Re: Device presumed dead

Post by oliviers »

Hello,
I have a "side" question .....
When a device in not "presumed", but really dead, is there a way to replace it by a new one without having to redo all the settings/parameters/.... of the dead one for the new one ? (I had the case)

I'm thinking of the following, but I would like the "blessing" of a Domoticz insider before doing this.... (Didn't dare to try it ...)

1. In the device list, note the IdX of the dead switch: xx
2. Add a new device in Domoticz, and note the index of the newly created switch: yy
3. Stop Domoticz
4. Update the DB (with SQLITE3)
4a: Delete the new switch (just created) in the DeviceStatus table

Code: Select all

Delete from Devicestatus where ID = yy
4b: Update the old, dead swith in the DeviceStatus table and replace its index (ID column) by the one of the new swith:

Code: Select all

Update DeviceStatus Set ID = yy where ID = xx
5. Restart Domoticz

Would this do the job ?
I could eventually write a WIKI page on this if it is confirmed that it is the right way to perform that kind of device substitution...

Oliviers
Paris area
Raspberry Pi 4 - RFXComm 433 - IrTrans - Zwave
valdoison
Posts: 21
Joined: Monday 03 March 2014 18:33
Target OS: Linux
Domoticz version: beta
Contact:

Re: Device presumed dead

Post by valdoison »

When the band goes to red, the parameter "haveTimeout" goes to 1.
So there definitely has a routine in Domoticz that periodically checks this parameter for each device.
Could we use the result of this routine, for example, to send an SMS or MAIL to the occurrence of a change in this parameter.
User avatar
gizmocuz
Posts: 2499
Joined: Thursday 11 July 2013 18:59
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Top of the world
Contact:

Re: Device presumed dead

Post by gizmocuz »

Correct, but i also hear that devices are working again and domoticz still says it is bad.

For ZWave this is done here:

COpenZWave.cpp

void COpenZWave::OnZWaveNotification(OpenZWave::Notification const* _notification)

case OpenZWave::Notification::Type_Notification:
-- case OpenZWave::Notification::Code_Dead:

when it is dead (or from dead to alive), this function is called:

void ZWaveBase::ForceUpdateForNodeDevices(const unsigned int homeID, const int nodeID)

This function could be extended with the new state (NSTATE_AWAKE, NSTATE_SLEEP, NSTATE_DEAD)

And then we could add a notification for this

But because there are reports that it seems to not work 100% (i dont have this experience), it might not (... yet....) be a good idea for a notification ?
Quality outlives Quantity!
valdoison
Posts: 21
Joined: Monday 03 March 2014 18:33
Target OS: Linux
Domoticz version: beta
Contact:

Re: Device presumed dead

Post by valdoison »

Does the changing of the parameter "haveTimeout" launch the script "script.device.xxx.lua"?
User avatar
gizmocuz
Posts: 2499
Joined: Thursday 11 July 2013 18:59
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Top of the world
Contact:

Re: Device presumed dead

Post by gizmocuz »

no...
Quality outlives Quantity!
madrian
Posts: 231
Joined: Saturday 27 August 2016 1:18
Target OS: -
Domoticz version:
Contact:

Re: Device presumed dead

Post by madrian »

After how much time is marked device as dead? I am testing a notification script and I am waiting 30min, device is still not red (marked as dead).
User avatar
gizmocuz
Posts: 2499
Joined: Thursday 11 July 2013 18:59
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Top of the world
Contact:

Re: Device presumed dead

Post by gizmocuz »

I dont know, i guess when openzwave does not get a response in 3 retries... best to ask this on the openzwave forum
Quality outlives Quantity!
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest