Thanks for your very detailed answer. From reading this I understand that you are as enthusiastic about Pass2PHP as I am about dzVents
Pass2PHP
Moderator: leecollings
- waaren
- Posts: 6028
- Joined: Tuesday 03 January 2017 14:18
- Target OS: Linux
- Domoticz version: Beta
- Location: Netherlands
- Contact:
Re: Pass2PHP
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
- sincze
- Posts: 1300
- Joined: Monday 02 June 2014 22:46
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2024.4
- Location: Netherlands / Breda Area
- Contact:
Re: Pass2PHP
Indeed, When I started with Pass2PHP there was no dzVents. I had everything in LUA and was experiencing delays.
Then I found the first version of Pass2PHP and had to rewrite/learn everything in my Christmas Holiday to PHP.
Thanks to this forum thread and google I managed to do so.
But the speed gain was worth it.
Now I have rewritten even most of my perl and python stuff to PHP.
For me dzVents and Pass2PHP work in the 'same' way as they both used to speed up the responsiveness of Domoticz.
A well it just a different language. From my view It seems dzVents has a bit more followers and nice / cewl widgets .
I don't have a visual interface in the house. The house is running on it's own. No light switches have to be used, lights will adjust to whatever is playing on the KODI, Chromecast, or if the room is occupied. Heating is adjusted. Rain and hard winds will move the screens in a safe position. Unifi Wifi stuff can follow me around the house and there is so much more.
Whatever floats somebodys boat I would say . But still the core it is Domoticz and that enables you to bring your imagination come to life. At the moment no 'closed' hardware system can do what I have running now. So Domoticz it is
For people that start with LUA and want more complex things I direct them to dzVents (unfortunately my support then is limited so I direct them towards the forum), for friends with Coding / PHP experience I move them towards Pass2PHP.
Pass2php
LAN: RFLink, P1, OTGW, MySensors
USB: RFXCom, ZWave, Sonoff 3
MQTT: ZIgbee2MQTT,
ZWAVE: Zwave-JS-UI
WIFI: Mi-light, Tasmota, Xiaomi Shelly
Solar: Omnik, PVOutput
Video: Kodi, Harmony HUB, Chromecast
Sensors: You name it I got 1.
LAN: RFLink, P1, OTGW, MySensors
USB: RFXCom, ZWave, Sonoff 3
MQTT: ZIgbee2MQTT,
ZWAVE: Zwave-JS-UI
WIFI: Mi-light, Tasmota, Xiaomi Shelly
Solar: Omnik, PVOutput
Video: Kodi, Harmony HUB, Chromecast
Sensors: You name it I got 1.
-
- Posts: 667
- Joined: Wednesday 08 March 2017 9:42
- Target OS: Linux
- Domoticz version: 3.8993
- Location: Amsterdam
- Contact:
Re: Pass2PHP
Thanks for explanation!!! One little question : changing light status will be stored in cache variables. But will they also change in Domoticz? If system crash the cache is gone... Actual change in Domoticz is stored in dB.
Verzonden vanaf mijn iPhone met Tapatalk Pro
Verzonden vanaf mijn iPhone met Tapatalk Pro
RPi3 B+, Debain Stretch, Domoticz, Homebridge, Dashticz, RFLink, Milight, Z-Wave, Fibaro, Nanoleaf, Nest, Harmony Hub, Now try to understand pass2php
- sincze
- Posts: 1300
- Joined: Monday 02 June 2014 22:46
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2024.4
- Location: Netherlands / Breda Area
- Contact:
Re: Pass2PHP
Good question indeed. But don't worry. It will all work just fine.poudenes wrote: ↑Monday 08 October 2018 9:43 Thanks for explanation!!! One little question : changing light status will be stored in cache variables. But will they also change in Domoticz? If system crash the cache is gone... Actual change in Domoticz is stored in dB.
Verzonden vanaf mijn iPhone met Tapatalk Pro
pass2php.php contains the following:
- Spoiler: show
Then if you have a close look at the code as shown above.
Pass2PHP once a device is triggered it will look for a file named after the triggered $device -> motion1.php / lamp1.php (in this example).
These can be dummy (empty) files, but if php code is present in the file, it will be executed (see examples below for motion)
motion1.php
- Spoiler: show
The status of (any sensor) in this case the motion detector can be queried by the status() function as illustrated in the examples. But it can be queried from everywhere else.
With the following code a log line will be written to my domoticz.log Indicating the motion1 was causing the lamp to switch on.Be aware starting with Pass2PHP is like heroin, quite addictive.
- Spoiler: show
Pass2php
LAN: RFLink, P1, OTGW, MySensors
USB: RFXCom, ZWave, Sonoff 3
MQTT: ZIgbee2MQTT,
ZWAVE: Zwave-JS-UI
WIFI: Mi-light, Tasmota, Xiaomi Shelly
Solar: Omnik, PVOutput
Video: Kodi, Harmony HUB, Chromecast
Sensors: You name it I got 1.
LAN: RFLink, P1, OTGW, MySensors
USB: RFXCom, ZWave, Sonoff 3
MQTT: ZIgbee2MQTT,
ZWAVE: Zwave-JS-UI
WIFI: Mi-light, Tasmota, Xiaomi Shelly
Solar: Omnik, PVOutput
Video: Kodi, Harmony HUB, Chromecast
Sensors: You name it I got 1.
- Egregius
- Posts: 2582
- Joined: Thursday 09 April 2015 12:19
- Target OS: Linux
- Domoticz version: v2024.7
- Location: Beitem, BE
- Contact:
Re: Pass2PHP
Thanks sincze for the explanations here, I don't have much time right now, busy developping a huge website, in PHP of course
Since I moved to a Intel Nuc my speed is even more decreased to 25msec between pir and light switch command.
I also find that running PHP completely separate from Domoticz has the advantage that Domoticz can do what it has to do: controlling the swithes and receiving updates from devices. Nothing more, nothing less. With Pass2PHP all the rest of the logic is handled in PHP.
I guess the main speed difference has something to do with how Domoticz (or lua) handles the commandarray. Since we don't use it here we have no downside of that.
In my case I use a lot of switch commands that stay in PHP only because they have names that don't exist in Domoticz.
For example:
I have a switch in Domoticz called 'switch'.
If I execute sw('switch','On') in pass2php the switch will be turned on in Domoticz.
I don't have a switch called 'dummy', so when I execute sw('dummy','On') it will not be sent to domoticz and kept in pass2php as a dummy switch.
For the case the system crashes I save the cache to disk every hour, never needed it anymore since I moved to the NUC.
Well, lua, dzVents, PHP, use the one that you know the best, or the one that you think is easiest to learn.
For me that was clearly PHP. Altough I had no programming skills at all, the only thing I did in the past was make some changes for my SMF forum or my Wordpress sites. The biggest learning curve was starting with pass2php and my PHP Floorplan.
Now, several years later I'm even developping dynamic user websites for hundreds of thousands users. Just to say, if you want to learn PHP, you can, thanks to the enormous amount of code and users on the net.
As stated by sincze before, for PHP there are millions of users and code examples on the net. So the only limit for using it is your learning curve and your imagination.
Actually, php has never been loaded from Domoticz in my case. There's only one lua script that does a curl to the php page.waaren wrote: ↑Sunday 07 October 2018 9:51 Please correct if I am wrong but what I read in the post with the speed comparison is that the difference from >1000 ms to < 100 ms is the result of loading the PHP with a Lua script (which is described there as being much faster) compared to loading PHP from domoticz. I don't read anything about comparing pure PHP speed with pure Lua speed.
Since I moved to a Intel Nuc my speed is even more decreased to 25msec between pir and light switch command.
I also find that running PHP completely separate from Domoticz has the advantage that Domoticz can do what it has to do: controlling the swithes and receiving updates from devices. Nothing more, nothing less. With Pass2PHP all the rest of the logic is handled in PHP.
I guess the main speed difference has something to do with how Domoticz (or lua) handles the commandarray. Since we don't use it here we have no downside of that.
Yes, all values will be in Domoticz also, that is as soon as you sent a switch command (or any other command) back to domoticz.
In my case I use a lot of switch commands that stay in PHP only because they have names that don't exist in Domoticz.
For example:
I have a switch in Domoticz called 'switch'.
If I execute sw('switch','On') in pass2php the switch will be turned on in Domoticz.
I don't have a switch called 'dummy', so when I execute sw('dummy','On') it will not be sent to domoticz and kept in pass2php as a dummy switch.
For the case the system crashes I save the cache to disk every hour, never needed it anymore since I moved to the NUC.
Well, lua, dzVents, PHP, use the one that you know the best, or the one that you think is easiest to learn.
For me that was clearly PHP. Altough I had no programming skills at all, the only thing I did in the past was make some changes for my SMF forum or my Wordpress sites. The biggest learning curve was starting with pass2php and my PHP Floorplan.
Now, several years later I'm even developping dynamic user websites for hundreds of thousands users. Just to say, if you want to learn PHP, you can, thanks to the enormous amount of code and users on the net.
- sincze
- Posts: 1300
- Joined: Monday 02 June 2014 22:46
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2024.4
- Location: Netherlands / Breda Area
- Contact:
Re: Pass2PHP
@Egregius, could it be this code has a 'bug'' ?
Pretty much interested in this bit:
As this if statement is false all the time: if(apcu_fetch($name)!=$level)
$level is a number I would like the dimmer to go to and the apcu_fetch($name) response in my case says "Set Level". hence not the same. And will never be the same. Am I missing a crucial piece of information here
I was building a dimmer function so it would go slowly up or down to a specific level and my debug log showed the 'Set Level' all the time in stead of the value of the dimmed lamp.
Code: Select all
function sl($name,$level,$check=false){
global $user;
$idx=idx($name);
lg(' (SETLEVEL) | '.$user.' => '.$name.' '.$level);
if($idx>0){
if($check==false)file_get_contents('http://[::1]:8080/json.htm?type=command¶m=switchlight&idx='.$idx.'&switchcmd=Set%20Level&level='.$level);
else{
if(apcu_fetch($name)!=$level)file_get_contents('http://[::1]:8080/json.htm?type=command¶m=switchlight&idx='.$idx.'&switchcmd=Set%20Level&level='.$level);
}
}else{
apcu_store($name,$level);
apcu_store('T'.$name,time());
}
}
Code: Select all
if(apcu_fetch($name)!=$level)file_get_contents('http://[::1]:8080/json.htm?type=command¶m=switchlight&idx='.$idx.'&switchcmd=Set%20Level&level='.$level);
$level is a number I would like the dimmer to go to and the apcu_fetch($name) response in my case says "Set Level". hence not the same. And will never be the same. Am I missing a crucial piece of information here
I was building a dimmer function so it would go slowly up or down to a specific level and my debug log showed the 'Set Level' all the time in stead of the value of the dimmed lamp.
Code: Select all
function sla($name,$requestedlevel) {
$idx=idx($name);
$json_string=curl(domoticz.'json.htm?type=devices&rid='.$idx); // retrieve current level
$parsed_json = json_decode($json_string, true);
$parsed_json = $parsed_json['result'][0];
$currentlevel = $parsed_json['Level'];
$currentstatus = $parsed_json['Status'];
$switchtype = $parsed_json['SwitchType'];
if ($currentstatus=='Off') $currentlevel=0;
if( $switchtype=='Dimmer' && $requestedlevel >= 0 && $requestedlevel <= 100 && $idx>0 ) {
if ($requestedlevel >= $currentlevel) {
while ($currentlevel-1 != $requestedlevel) {
sl($name,$currentlevel);
$currentlevel++;
sleep(0.5);
}
}
elseif ($requestedlevel <= $currentlevel) {
while ($currentlevel+1 != $requestedlevel) {
sl($name,$currentlevel);
$currentlevel--;
sleep(0.5);
}
}
}
}
Pass2php
LAN: RFLink, P1, OTGW, MySensors
USB: RFXCom, ZWave, Sonoff 3
MQTT: ZIgbee2MQTT,
ZWAVE: Zwave-JS-UI
WIFI: Mi-light, Tasmota, Xiaomi Shelly
Solar: Omnik, PVOutput
Video: Kodi, Harmony HUB, Chromecast
Sensors: You name it I got 1.
LAN: RFLink, P1, OTGW, MySensors
USB: RFXCom, ZWave, Sonoff 3
MQTT: ZIgbee2MQTT,
ZWAVE: Zwave-JS-UI
WIFI: Mi-light, Tasmota, Xiaomi Shelly
Solar: Omnik, PVOutput
Video: Kodi, Harmony HUB, Chromecast
Sensors: You name it I got 1.
- sincze
- Posts: 1300
- Joined: Monday 02 June 2014 22:46
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2024.4
- Location: Netherlands / Breda Area
- Contact:
Re: Pass2PHP
Sometimes the status('device') function did not retrieve the value from domoticz I was looking for.
Like I know a VIDEO or AUDIO is playing on my kodi machine, but don't know what title is playing, so I created this function.
Ofcourse it can be modified in many ways, to return a full array of data. But at the moment it does help me. Feel free to comment.
Or this also nice, just enter something you look for
Like I know a VIDEO or AUDIO is playing on my kodi machine, but don't know what title is playing, so I created this function.
Ofcourse it can be modified in many ways, to return a full array of data. But at the moment it does help me. Feel free to comment.
Code: Select all
function nvalue($name,$nvalue)
{
$idx=idx($name);
$json_string=curl(domoticz.'json.htm?type=devices&rid='.$idx); // retrieve current information
$parsed_json = json_decode($json_string, true);
$parsed_json = $parsed_json['result'][0]; // We are only interested in the results bit.
switch ($nvalue) // Determening the IP Address of KODI Machine.
{
case 'Level':
$value=$parsed_json['Level']; // THis data I can use to find out what is the current DIM value of a dimmer
break;
case 'Status':
$value=$parsed_json['Status']; // Well just an example
break;
case 'SwitchType':
$value=$parsed_json['SwitchType']; // Another example I used this to determine if a device is a Dimmer option
break;
case 'Data':
$value=$parsed_json['Data']; // "Data" : "The Big Bang Theory [S1E1], Pilot (2007)",
break;
default:
$value='NA';
break;
}
return $value;
}
Or this also nice, just enter something you look for
Code: Select all
function nvalue($name,$nvalue)
{
$idx=idx($name);
$json_string=curl(domoticz.'json.htm?type=devices&rid='.$idx); // retrieve current information
$parsed_json = json_decode($json_string, true);
$parsed_json = $parsed_json['result'][0]; // We are only interested in the results bit.
if(array_key_exists($nvalue, $parsed_json)) {
$value=$parsed_json[$nvalue];
}
else $value='NA';
return $value;
}
Pass2php
LAN: RFLink, P1, OTGW, MySensors
USB: RFXCom, ZWave, Sonoff 3
MQTT: ZIgbee2MQTT,
ZWAVE: Zwave-JS-UI
WIFI: Mi-light, Tasmota, Xiaomi Shelly
Solar: Omnik, PVOutput
Video: Kodi, Harmony HUB, Chromecast
Sensors: You name it I got 1.
LAN: RFLink, P1, OTGW, MySensors
USB: RFXCom, ZWave, Sonoff 3
MQTT: ZIgbee2MQTT,
ZWAVE: Zwave-JS-UI
WIFI: Mi-light, Tasmota, Xiaomi Shelly
Solar: Omnik, PVOutput
Video: Kodi, Harmony HUB, Chromecast
Sensors: You name it I got 1.
- Egregius
- Posts: 2582
- Joined: Thursday 09 April 2015 12:19
- Target OS: Linux
- Domoticz version: v2024.7
- Location: Beitem, BE
- Contact:
Re: Pass2PHP
apcu_fetch($name) should return a number.
Can you check the Current State in domoticz (in the events window)?
Did you add the name of the dimmer to the array in the pass2php file?
Can you check the Current State in domoticz (in the events window)?
Did you add the name of the dimmer to the array in the pass2php file?
Code: Select all
elseif(in_array($device,array('eettafel','zithoek','kamer','tobi','alex','Xvol','Rliving','Rbureel','RkeukenL','RkeukenR','RkamerL','RkamerR','Rtobi','Ralex','luifel'))){
if($status=='Off'||$status=='Open'){
apcu_store($device,0);
}elseif($status=='On'||$status=='Closed'){
apcu_store($device,100);
}else{
$status=filter_var($status,FILTER_SANITIZE_NUMBER_INT);
apcu_store($device,$status);
}
}
- sincze
- Posts: 1300
- Joined: Monday 02 June 2014 22:46
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2024.4
- Location: Netherlands / Breda Area
- Contact:
Re: Pass2PHP
Did you add the name of the dimmer to the array in the pass2php file?Egregius wrote: ↑Tuesday 06 November 2018 12:15 apcu_fetch($name) should return a number.
Can you check the Current State in domoticz (in the events window)?
Did you add the name of the dimmer to the array in the pass2php file?Code: Select all
elseif(in_array($device,array('eettafel','zithoek','kamer','tobi','alex','Xvol','Rliving','Rbureel','RkeukenL','RkeukenR','RkamerL','RkamerR','Rtobi','Ralex','luifel'))){ if($status=='Off'||$status=='Open'){ apcu_store($device,0); }elseif($status=='On'||$status=='Closed'){ apcu_store($device,100); }else{ $status=filter_var($status,FILTER_SANITIZE_NUMBER_INT); apcu_store($device,$status); } }
- Damn... missed that one.. That is why I received the wrong result..
Pass2php
LAN: RFLink, P1, OTGW, MySensors
USB: RFXCom, ZWave, Sonoff 3
MQTT: ZIgbee2MQTT,
ZWAVE: Zwave-JS-UI
WIFI: Mi-light, Tasmota, Xiaomi Shelly
Solar: Omnik, PVOutput
Video: Kodi, Harmony HUB, Chromecast
Sensors: You name it I got 1.
LAN: RFLink, P1, OTGW, MySensors
USB: RFXCom, ZWave, Sonoff 3
MQTT: ZIgbee2MQTT,
ZWAVE: Zwave-JS-UI
WIFI: Mi-light, Tasmota, Xiaomi Shelly
Solar: Omnik, PVOutput
Video: Kodi, Harmony HUB, Chromecast
Sensors: You name it I got 1.
- Egregius
- Posts: 2582
- Joined: Thursday 09 April 2015 12:19
- Target OS: Linux
- Domoticz version: v2024.7
- Location: Beitem, BE
- Contact:
Re: Pass2PHP
No problem, glad you figured it out and it's working as expected now
- sincze
- Posts: 1300
- Joined: Monday 02 June 2014 22:46
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2024.4
- Location: Netherlands / Breda Area
- Contact:
Re: Pass2PHP
After running Pass2PHP without any errors for over months now the following shows up... in my /var/log/nginx/error.log.
Line 315 refers to:
What am I missing here. As I could not find the cause I restarted php7.0-fpm and after that the PI iteself. No results...
Code: Select all
2019/02/02 17:28:11 [error] 707#707: *15171 FastCGI sent in stderr: "PHP message: PHP Warning: apcu_fetch(): apc_fetch() expects a string or array of strings. in /var/www/html/secure2/pass2php_include/functions_pass2php.php on line 315" while reading response header from upstream, client: 127.0.0.1, server: pc-domoticz, request: "POST /secure2/pass2php.php HTTP/1.1", upstream: "fastcgi://unix:/run/php/php7.0-fpm.sock:", host: "127.0.0.1"
2019/02/02 17:28:26 [error] 706#706: *15439 FastCGI sent in stderr: "PHP message: PHP Warning: apcu_fetch(): apc_fetch() expects a string or array of strings. in /var/www/html/secure2/pass2php_include/functions_pass2php.php on line 315" while reading response header from upstream, client: 127.0.0.1, server: pc-domoticz, request: "POST /secure2/pass2php.php HTTP/1.1", upstream: "fastcgi://unix:/run/php/php7.0-fpm.sock:", host: "127.0.0.1"
2019/02/02 17:29:26 [error] 702#702: *16795 FastCGI sent in stderr: "PHP message: PHP Warning: apcu_fetch(): apc_fetch() expects a string or array of strings. in /var/www/html/secure2/pass2php_include/functions_pass2php.php on line 315" while reading response header from upstream, client: 127.0.0.1, server: pc-domoticz, request: "POST /secure2/pass2php.php HTTP/1.1", upstream: "fastcgi://unix:/run/php/php7.0-fpm.sock:", host: "127.0.0.1"
Code: Select all
function status($name)
{
if (strpos($name, " ") !== false) $name=str_replace(" ","_",$name);
return apcu_fetch($name); # This is line 315!
}
Pass2php
LAN: RFLink, P1, OTGW, MySensors
USB: RFXCom, ZWave, Sonoff 3
MQTT: ZIgbee2MQTT,
ZWAVE: Zwave-JS-UI
WIFI: Mi-light, Tasmota, Xiaomi Shelly
Solar: Omnik, PVOutput
Video: Kodi, Harmony HUB, Chromecast
Sensors: You name it I got 1.
LAN: RFLink, P1, OTGW, MySensors
USB: RFXCom, ZWave, Sonoff 3
MQTT: ZIgbee2MQTT,
ZWAVE: Zwave-JS-UI
WIFI: Mi-light, Tasmota, Xiaomi Shelly
Solar: Omnik, PVOutput
Video: Kodi, Harmony HUB, Chromecast
Sensors: You name it I got 1.
- Egregius
- Posts: 2582
- Joined: Thursday 09 April 2015 12:19
- Target OS: Linux
- Domoticz version: v2024.7
- Location: Beitem, BE
- Contact:
Re: Pass2PHP
Are you using device names with spaces in them?
For some reason $name isn't a string.
For some reason $name isn't a string.
- sincze
- Posts: 1300
- Joined: Monday 02 June 2014 22:46
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2024.4
- Location: Netherlands / Breda Area
- Contact:
Re: Pass2PHP
Yes Domoticz device names and files sometimes have spaces Indeed. But normally the famous string space to _ replacement function would solve the issue.
$name not a string is interesting. Now I only need to find out... Which one the system is complaining about. Pfff
Pass2php
LAN: RFLink, P1, OTGW, MySensors
USB: RFXCom, ZWave, Sonoff 3
MQTT: ZIgbee2MQTT,
ZWAVE: Zwave-JS-UI
WIFI: Mi-light, Tasmota, Xiaomi Shelly
Solar: Omnik, PVOutput
Video: Kodi, Harmony HUB, Chromecast
Sensors: You name it I got 1.
LAN: RFLink, P1, OTGW, MySensors
USB: RFXCom, ZWave, Sonoff 3
MQTT: ZIgbee2MQTT,
ZWAVE: Zwave-JS-UI
WIFI: Mi-light, Tasmota, Xiaomi Shelly
Solar: Omnik, PVOutput
Video: Kodi, Harmony HUB, Chromecast
Sensors: You name it I got 1.
- Egregius
- Posts: 2582
- Joined: Thursday 09 April 2015 12:19
- Target OS: Linux
- Domoticz version: v2024.7
- Location: Beitem, BE
- Contact:
Re: Pass2PHP
I only have a few with a space in, so I don't use the str_replace on all apcu_fetch calls.
What I often do is start the script with all the variables I need and store them in php variables
Then you have the statuses in variables:
After wich you can just use them:
What I often do is start the script with all the variables I need and store them in php variables
Code: Select all
$items=array('LGTV - Status','tvled','kristal','denon');
foreach($items as $i)${$i}=apcu_fetch($i);
Code: Select all
${'LGTV - Status'}...
$tvled...
$kristal...
$denon...
Code: Select all
if(${'LGTV - Status'}=='On')sw('LGTV - Status','Off');
- sincze
- Posts: 1300
- Joined: Monday 02 June 2014 22:46
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2024.4
- Location: Netherlands / Breda Area
- Contact:
Re: Pass2PHP
Ok let me check your GitHub to see if I can figure out why and where you did this .
As you are a Domoticz-perfornance-speed-junky there must be some serious advantages I need to investigate.
I will also update to latest beta version.
As you are a Domoticz-perfornance-speed-junky there must be some serious advantages I need to investigate.
I will also update to latest beta version.
Pass2php
LAN: RFLink, P1, OTGW, MySensors
USB: RFXCom, ZWave, Sonoff 3
MQTT: ZIgbee2MQTT,
ZWAVE: Zwave-JS-UI
WIFI: Mi-light, Tasmota, Xiaomi Shelly
Solar: Omnik, PVOutput
Video: Kodi, Harmony HUB, Chromecast
Sensors: You name it I got 1.
LAN: RFLink, P1, OTGW, MySensors
USB: RFXCom, ZWave, Sonoff 3
MQTT: ZIgbee2MQTT,
ZWAVE: Zwave-JS-UI
WIFI: Mi-light, Tasmota, Xiaomi Shelly
Solar: Omnik, PVOutput
Video: Kodi, Harmony HUB, Chromecast
Sensors: You name it I got 1.
- Egregius
- Posts: 2582
- Joined: Thursday 09 April 2015 12:19
- Target OS: Linux
- Domoticz version: v2024.7
- Location: Beitem, BE
- Contact:
Re: Pass2PHP
Don't think there's much speed difference. It's mainly to have cleaner code. If($device... is easier than if(apcu_fetch('device')...
- sincze
- Posts: 1300
- Joined: Monday 02 June 2014 22:46
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2024.4
- Location: Netherlands / Breda Area
- Contact:
Re: Pass2PHP
ok check.
I was still on a different 'fork' / ' branch', using the status functions as you had them before
Code: Select all
if ( $scheme=="night" || status('Manual Override')=='On' )
As the error came every minute I checked __cron60.php and found a function called 'donker' that had a 'status' function usage typo mistake. Causing the acpu_fetch to fail. Luckily the change was documented "// 27-01-2019 Manual Light Override". In the end easy fix. But still interested in your variables solution. Will look into that.
Pass2php
LAN: RFLink, P1, OTGW, MySensors
USB: RFXCom, ZWave, Sonoff 3
MQTT: ZIgbee2MQTT,
ZWAVE: Zwave-JS-UI
WIFI: Mi-light, Tasmota, Xiaomi Shelly
Solar: Omnik, PVOutput
Video: Kodi, Harmony HUB, Chromecast
Sensors: You name it I got 1.
LAN: RFLink, P1, OTGW, MySensors
USB: RFXCom, ZWave, Sonoff 3
MQTT: ZIgbee2MQTT,
ZWAVE: Zwave-JS-UI
WIFI: Mi-light, Tasmota, Xiaomi Shelly
Solar: Omnik, PVOutput
Video: Kodi, Harmony HUB, Chromecast
Sensors: You name it I got 1.
-
- Posts: 483
- Joined: Tuesday 12 August 2014 5:37
- Target OS: Raspberry Pi / ODroid
- Domoticz version: V3_8394
- Location: Rumbeke,Belgium
- Contact:
Re: Pass2PHP
Hi guys,
long time no see
well, i wasn't very active the last months
some questions:
the cron.sh, at what interval is it running? can you show me your input please?
i see your crons are splitted in several files, is it faster that all in one? (mine is still all in one)
i see in your _cron60.php that you are saving the temperatures into your mysql database
Are these devices battery powered? and what kind of devices are they? If i put mine to update every 60 seconds, my battery is dead in 3months
I bought a new house and it needs to be renovated, i wanted to install again my zwave+ devices and this php script; but what should you guys do if you need to redo the electrical wiring in your house?
Again domoticz with this script? Or something else?
Wired domotica instead of what im using now zwave+ ?
Give me your opinion
Thanks guys
long time no see
well, i wasn't very active the last months
some questions:
the cron.sh, at what interval is it running? can you show me your input please?
i see your crons are splitted in several files, is it faster that all in one? (mine is still all in one)
i see in your _cron60.php that you are saving the temperatures into your mysql database
Are these devices battery powered? and what kind of devices are they? If i put mine to update every 60 seconds, my battery is dead in 3months
I bought a new house and it needs to be renovated, i wanted to install again my zwave+ devices and this php script; but what should you guys do if you need to redo the electrical wiring in your house?
Again domoticz with this script? Or something else?
Wired domotica instead of what im using now zwave+ ?
Give me your opinion
Thanks guys
-
- Posts: 483
- Joined: Tuesday 12 August 2014 5:37
- Target OS: Raspberry Pi / ODroid
- Domoticz version: V3_8394
- Location: Rumbeke,Belgium
- Contact:
Re: Pass2PHP
Egregius wrote: ↑Wednesday 20 June 2018 14:56 That's the one
https://github.com/Egregius/LUA-Pass2PH ... re/cron.sh
You can adjust the sleeps in it and remove lines as needed.
Add it to cron with sudo crontab -e
* * * * * /path/to/script/cron.sh
The script will also check if domoticz is still online and reboot if needed.
when running this cron.sh i receive this error:
cron.sh: 61: cron.sh: Syntax error: end of file unexpected (expecting "then")
you know why?
Thanks
-
- Posts: 483
- Joined: Tuesday 12 August 2014 5:37
- Target OS: Raspberry Pi / ODroid
- Domoticz version: V3_8394
- Location: Rumbeke,Belgium
- Contact:
Re: Pass2PHP
nevermind on this one, got it working already.
was not saved in unix format
was not saved in unix format
ropske wrote: ↑Wednesday 13 March 2019 23:09Egregius wrote: ↑Wednesday 20 June 2018 14:56 That's the one
https://github.com/Egregius/LUA-Pass2PH ... re/cron.sh
You can adjust the sleeps in it and remove lines as needed.
Add it to cron with sudo crontab -e
* * * * * /path/to/script/cron.sh
The script will also check if domoticz is still online and reboot if needed.
when running this cron.sh i receive this error:
cron.sh: 61: cron.sh: Syntax error: end of file unexpected (expecting "then")
you know why?
Thanks
Who is online
Users browsing this forum: No registered users and 1 guest