refreshzwave script no longer working

Please use template to report bugs and problems. Post here your questions when not sure where else to post
Only for bugs in the Domoticz application! other problems go in different subforums!
Forum rules
Before posting here, make sure you are on the latest Beta or Stable version.
If you have problems related to the web gui, clear your browser cache + appcache first.

Use the following template when posting here:

Version: xxxx
Platform: xxxx
Plugin/Hardware: xxxx
Description:
.....

If you are having problems with scripts/blockly, always post the script (in a spoiler or code tag) or screenshots of your blockly

If you are replying, please do not quote images/code from the first post

Please mark your topic as Solved when the problem is solved.
Post Reply
commentator
Posts: 96
Joined: Thursday 23 June 2016 14:41
Target OS: Raspberry Pi
Domoticz version: beta
Location: NL
Contact:

refreshzwave script no longer working

Post by commentator » Monday 03 December 2018 17:38

beta v4.10242
rpi3

since v4.10241 the refreshzwavescript is no longer working.

Code: Select all

#!/bin/bash
#~ Specify the ZWAVE NodeID to refresh
devid="$1"
name="$2"
#~ Check whether the refrsh is already running for this device and only fire when not.
chk=`sudo ps x | grep "refreshzwave.php $devid" | grep -cv grep`
if  [ "$chk" = "0" ] ; then
   /usr/bin/php /home/pi/domoticz/scripts/refreshzwave.php $devid $name
#>> /var/log/domoticz.log 2>&1 &
else
   echo "$(date +%Y-%m-%d) $(date +%X)     Zwave refresh already running for $devid $name"
#>> /var/log/domoticz.log 2>&1 &
fi

Code: Select all

#!/usr/bin/php
<?php
$devices=file_get_contents('http://ip:port/json.htm?type=openzwavenodes&idx=idxzwavecontroller'); //Change IDX to IDX of your zwave controller
function RefreshZwave($node,$name) {
   echo date("Y-m-d H:i:s "),"     ZWave Refresh Started for $node $name\n";
   $zwaveurl='http://ip:port/ozwcp/refreshpost.html';
   $zwavedata=array('fun'=>'racp','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);
   // print_r($zwaveoptions);
   // print_r($zwavecontext);
   for ($k=1;$k<=5;$k++){
           sleep(2);
           $result=file_get_contents($zwaveurl,false,$zwavecontext);
           echo date("Y-m-d H:i:s "),"     ZWave Refresh ",$node," ",$name," ",$result,"\n";
           if($result=='OK') break;}
}
if(!empty($argv[1])&&!empty($argv[2])) {
   RefreshZwave($argv[1],$argv[2]);
   }
else {
   echo date("Y-m-d H:i:s "),"     ZWave Refresh: no idx or name defined\r\n";
   }
?>
sometimes a zwavenode is not working as expected and the state in Domoticz is different from the real state. Before last weekends update the above scripts corrected this issue. But now it doesn't work anymore

commentator
Posts: 96
Joined: Thursday 23 June 2016 14:41
Target OS: Raspberry Pi
Domoticz version: beta
Location: NL
Contact:

Re: refreshzwave script no longer working

Post by commentator » Friday 14 December 2018 0:35

anyone? How to get right device state from zwavedevice in domoticz?

User avatar
Siewert308SW
Posts: 624
Joined: Monday 29 December 2014 16:47
Target OS: Raspberry Pi
Domoticz version: Beta
Location: The Netherlands - Zoutkamp (gn)
Contact:

Re: refreshzwave script no longer working

Post by Siewert308SW » Friday 14 December 2018 7:10

Don't know if this is Domo related.
I know last week there was a php update for the RPi.
Did you upgrade, if so maybe this is something related.
Unfortunately i can't test as i don't have any php scripts running.
Setup:
- RPi3 - PIco HV3.0A / Domo Beta 3.9XXX / RFXtrx433E / Aeotec Gen5
- RPi3 - PIco HV3.0A / PiHole / PiVPN / NAS / Print Server
- Youless Elec&Gas
- FI9803P Cams
- KD101 detectors
- Zwave & KaKu

MyDomoticz scripts: @GitHub
PIco UPS Toolkit: @GitHub

commentator
Posts: 96
Joined: Thursday 23 June 2016 14:41
Target OS: Raspberry Pi
Domoticz version: beta
Location: NL
Contact:

Re: refreshzwave script no longer working

Post by commentator » Friday 14 December 2018 8:54

Siewert308SW wrote:
Friday 14 December 2018 7:10
Don't know if this is Domo related.
I know last week there was a php update for the RPi.
php update is days after the domo update

commentator
Posts: 96
Joined: Thursday 23 June 2016 14:41
Target OS: Raspberry Pi
Domoticz version: beta
Location: NL
Contact:

Re: refreshzwave script no longer working

Post by commentator » Tuesday 18 December 2018 21:30

it looks like when clicking update status from zwave cp it doesn't update the status of switches in domoticz

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest