Do we know at least if this behaviour has everything to do with OZW or is Domoticz partly managing it?
Maybe gizmocuz has some thoughts on the matter and better still, maybe it's a quick fix

Moderator: leecollings
Code: Select all
<?php
$domoticzurl='http://127.0.0.1:8080/';
$zwaveidx=7;
$devices=json_decode(file_get_contents($domoticzurl.'json.htm?type=openzwavenodes&idx='.$zwaveidx),true);
foreach($devices as $node=>$data) {
if ($node == "result") {
foreach($data as $index=>$eltsNode) {
if ($eltsNode["State"] == "Dead") {
telegram('Node '.$eltsNode['NodeID'].' '.$eltsNode['Description'].' ('.$eltsNode['Name'].') marked as dead, reviving.');
ZwaveHasnodefailed($eltsNode['NodeID']);
sleep(10);
Zwavecancelaction();
}
}
}
}
function ZwaveHasnodefailed ($node) {
global $domoticzurl;
$zwaveurl=$domoticzurl.'ozwcp/refreshpost.html';
$zwavedata=array('fun'=>'hnf','node'=>$node);
$zwaveoptions = array('http'=>array('header'=>'Content-Type: application/x-www-form-urlencoded\r\n','method'=>'POST','content'=>http_build_query($zwavedata),),);
$zwavecontext=stream_context_create($zwaveoptions);
for ($k=1;$k<=5;$k++){
sleep(1);
$result=file_get_contents($zwaveurl,false,$zwavecontext);
if($result=='OK') break;
sleep(1);
}
}
function Zwavecancelaction() {
global $domoticzurl;
$zwaveurl=$domoticzurl.'ozwcp/refreshpost.html';
$zwavedata=array('fun'=>'cancel');
$zwaveoptions = array('http'=>array('header'=>'Content-Type: application/x-www-form-urlencoded\r\n','method'=>'POST','content'=>http_build_query($zwavedata),),);
$zwavecontext=stream_context_create($zwaveoptions);
for ($k=1;$k<=5;$k++){
sleep(1);
$result=file_get_contents($zwaveurl,false,$zwavecontext);
if($result=='OK') break;
sleep(1);
}
}
Users browsing this forum: No registered users and 1 guest