Pass2PHP

Moderator: leecollings

User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Pass2PHP

Post by waaren »

sincze wrote: Sunday 07 October 2018 10:29 A well. I've been running Pass2PHP for several years now and it fits my needs, One step on the stairway and the lights switch on instantly. Keep in mind it does require some learning.. like for me PHP and tweaking the webserver (keep an eye on the logs)
Thanks for your very detailed answer. From reading this I understand that you are as enthusiastic about Pass2PHP as I am about dzVents :D
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
User avatar
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

Post by sincze »

waaren wrote: Sunday 07 October 2018 10:44
sincze wrote: Sunday 07 October 2018 10:29 A well. I've been running Pass2PHP for several years now and it fits my needs, One step on the stairway and the lights switch on instantly. Keep in mind it does require some learning.. like for me PHP and tweaking the webserver (keep an eye on the logs)
Thanks for your very detailed answer. From reading this I understand that you are as enthusiastic about Pass2PHP as I am about dzVents :D
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. :shock:
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 :D .

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 :D . 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.
poudenes
Posts: 667
Joined: Wednesday 08 March 2017 9:42
Target OS: Linux
Domoticz version: 3.8993
Location: Amsterdam
Contact:

Re: Pass2PHP

Post by poudenes »

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
RPi3 B+, Debain Stretch, Domoticz, Homebridge, Dashticz, RFLink, Milight, Z-Wave, Fibaro, Nanoleaf, Nest, Harmony Hub, Now try to understand pass2php
User avatar
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

Post by sincze »

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
Good question indeed. But don't worry. It will all work just fine.
pass2php.php contains the following:
Spoiler: show

Code: Select all

if($_SERVER['REQUEST_METHOD']=='POST'){
		$device=$_POST['d'];
		$status=$_POST['s'];
		if(@include rootdir.'pass2php/'.$device.'.php'){

			//lg('Pass2php: '.$device.' = '.$status);
			setstatus($device,$status);
        }
}
Let's say you have a motion sensor and a lamp with the domoticz names "motion1" and " lamp1" .
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

Code: Select all

<?php

  if(($status=='On')&&(status('lamp1')=='Off')) { sw('lamp1','On'); }

?>
With this code, if the motion sensor is 'on', that will make the lamp1 turn on in the real world and will update the status icon of the lamp1 in domoticz. The motion sensor icon was already updated by domoticz as it was the trigger of the action.
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. :D
Be aware starting with Pass2PHP is like heroin, quite addictive.
With the following code a log line will be written to my domoticz.log Indicating the motion1 was causing the lamp to switch on.
Spoiler: show

Code: Select all

<?php

  if(($status=='On')&&(status('lamp1')=='Off')) { sw('lamp1','On','Motion1 Detected'.$status); }

?>
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.
User avatar
Egregius
Posts: 2582
Joined: Thursday 09 April 2015 12:19
Target OS: Linux
Domoticz version: v2024.7
Location: Beitem, BE
Contact:

Re: Pass2PHP

Post by Egregius »

Thanks sincze for the explanations here, I don't have much time right now, busy developping a huge website, in PHP of course :lol:
poudenes wrote: Saturday 06 October 2018 19:37 I can do everything what we now also can do on dzvents 2.4?
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.
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.
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.
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.
poudenes wrote: Monday 08 October 2018 9:43 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.
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.
User avatar
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

Post by sincze »

@Egregius, could it be this code has a 'bug'' ?

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&param=switchlight&idx='.$idx.'&switchcmd=Set%20Level&level='.$level);
		else{
			if(apcu_fetch($name)!=$level)file_get_contents('http://[::1]:8080/json.htm?type=command&param=switchlight&idx='.$idx.'&switchcmd=Set%20Level&level='.$level);
		}
	}else{
		apcu_store($name,$level);
		apcu_store('T'.$name,time());
	}
}
Pretty much interested in this bit:

Code: Select all

if(apcu_fetch($name)!=$level)file_get_contents('http://[::1]:8080/json.htm?type=command&param=switchlight&idx='.$idx.'&switchcmd=Set%20Level&level='.$level);
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 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.
User avatar
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

Post by sincze »

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. :lol:

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 :D

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.
User avatar
Egregius
Posts: 2582
Joined: Thursday 09 April 2015 12:19
Target OS: Linux
Domoticz version: v2024.7
Location: Beitem, BE
Contact:

Re: Pass2PHP

Post by Egregius »

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);
			}
		}
User avatar
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

Post by sincze »

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);
			}
		}
Did you add the name of the dimmer to the array in the pass2php file?
- Damn... missed that one.. That is why I received the wrong result..
Egregius-Dimmer.png
Egregius-Dimmer.png (28.06 KiB) Viewed 1671 times
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.
User avatar
Egregius
Posts: 2582
Joined: Thursday 09 April 2015 12:19
Target OS: Linux
Domoticz version: v2024.7
Location: Beitem, BE
Contact:

Re: Pass2PHP

Post by Egregius »

No problem, glad you figured it out and it's working as expected now ;)
User avatar
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

Post by sincze »

After running Pass2PHP without any errors for over months now the following shows up... in my /var/log/nginx/error.log.

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"
Line 315 refers to:

Code: Select all

function status($name)
{
    if (strpos($name, " ") !== false) $name=str_replace(" ","_",$name);
    return apcu_fetch($name);                                                           # This is line 315!
}
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...
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.
User avatar
Egregius
Posts: 2582
Joined: Thursday 09 April 2015 12:19
Target OS: Linux
Domoticz version: v2024.7
Location: Beitem, BE
Contact:

Re: Pass2PHP

Post by Egregius »

Are you using device names with spaces in them?
For some reason $name isn't a string.
User avatar
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

Post by sincze »

Egregius wrote: Saturday 02 February 2019 21:35 Are you using device names with spaces in them?
For some reason $name isn't a string.
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.
User avatar
Egregius
Posts: 2582
Joined: Thursday 09 April 2015 12:19
Target OS: Linux
Domoticz version: v2024.7
Location: Beitem, BE
Contact:

Re: Pass2PHP

Post by Egregius »

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

Code: Select all

$items=array('LGTV - Status','tvled','kristal','denon');
foreach($items as $i)${$i}=apcu_fetch($i);
Then you have the statuses in variables:

Code: Select all

${'LGTV - Status'}...
$tvled...
$kristal...
$denon...
After wich you can just use them:

Code: Select all

if(${'LGTV - Status'}=='On')sw('LGTV - Status','Off');
User avatar
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

Post by sincze »

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.
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.
User avatar
Egregius
Posts: 2582
Joined: Thursday 09 April 2015 12:19
Target OS: Linux
Domoticz version: v2024.7
Location: Beitem, BE
Contact:

Re: Pass2PHP

Post by Egregius »

Don't think there's much speed difference. It's mainly to have cleaner code. If($device... is easier than if(apcu_fetch('device')...
User avatar
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

Post by sincze »

Egregius wrote: Sunday 03 February 2019 10:16 Don't think there's much speed difference. It's mainly to have cleaner code. If($device... is easier than if(apcu_fetch('device')...
ok check.
I was still on a different 'fork' / ' branch', using the status functions as you had them before :lol:

Code: Select all

 if ( $scheme=="night" || status('Manual Override')=='On' )	
I found the problem by the way.
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.
ropske
Posts: 483
Joined: Tuesday 12 August 2014 5:37
Target OS: Raspberry Pi / ODroid
Domoticz version: V3_8394
Location: Rumbeke,Belgium
Contact:

Re: Pass2PHP

Post by ropske »

Hi guys,

long time no see :-)
well, i wasn't very active the last months :D

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 :D

Thanks guys
ropske
Posts: 483
Joined: Tuesday 12 August 2014 5:37
Target OS: Raspberry Pi / ODroid
Domoticz version: V3_8394
Location: Rumbeke,Belgium
Contact:

Re: Pass2PHP

Post by ropske »

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
ropske
Posts: 483
Joined: Tuesday 12 August 2014 5:37
Target OS: Raspberry Pi / ODroid
Domoticz version: V3_8394
Location: Rumbeke,Belgium
Contact:

Re: Pass2PHP

Post by ropske »

nevermind on this one, got it working already.
was not saved in unix format
ropske wrote: Wednesday 13 March 2019 23:09
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
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest