This strange thing happens sometimes:
I open the Door but pass2php reports door closed.
I close the door.. and pass2php reports door open..
Code: Select all
2018-01-12 12:33:50.666 telegram sent to Phone: Voordeur is Geopend
2018-01-12 12:33:52.114 Voordeur: Closed
2018-01-12 12:33:55.371 De voordeur is weer gesloten
2018-01-12 12:34:52.143 Voordeur: Open
2018-01-12 12:35:52.595 Voordeur: Open
The cache reports door open however it is still Closed.
- Door Closed.JPG (19.15 KiB) Viewed 2028 times
- Voordeur log.JPG (34.16 KiB) Viewed 2028 times
Any ideas??
I have to force a cache refresh
and it is in sync again.
Code: Select all
function force_cache()
{
$domoticz=json_decode(file_get_contents(domoticz.'json.htm?type=devices&used=true'),true);
if($domoticz){
foreach($domoticz['result'] as $dom){
$name=$dom['Name'];
if(isset($dom['SwitchType']))$switchtype=$dom['SwitchType'];else $switchtype='none';
settimestamp($name,strtotime($dom['LastUpdate']));
setidx($name,$dom['idx']);
if($dom['Type']=='Temp')setstatus($name,str_replace(' C','',$dom['Data']));
elseif($dom['TypeImg']=='current')setstatus($name,str_replace(' Watt','',$dom['Data']));
//elseif($name=='luifel')setstatus($name,str_replace('%','',$dom['Level']));
elseif($switchtype=='Dimmer'){
if($dom['Data']=='Off')setstatus($name,'Off');
else setstatus($name,filter_var($dom['Data'],FILTER_SANITIZE_NUMBER_INT));
}
//else setstatus($name,$dom['Data']);
else {
setstatus($name,$dom['Data']);
lg('Performing setstatus: '.$name.' and data: '.$dom['Data']);
}
}
lg('End of function force update!');
}
}
mmm and after an hour I opened the door again... Same thing..
Code: Select all
2018-01-12 14:20:54.578 telegram sent to Phone: Voordeur is Geopend
2018-01-12 14:20:59.086 De voordeur is weer gesloten
2018-01-12 14:21:09.130 Voordeur: Closed
2018-01-12 14:22:09.303 Voordeur: Closed
2018-01-12 14:23:12.035 Voordeur: Open
2018-01-12 14:24:13.058 Voordeur: Open