Pass2PHP
Moderator: leecollings
- Egregius
- Posts: 2582
- Joined: Thursday 09 April 2015 12:19
- Target OS: Linux
- Domoticz version: v2024.7
- Location: Beitem, BE
- Contact:
Re: Pass2PHP
Lol, seems I have superfast disks
- 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
A well, because we now can read the usage of a Unifi AP-AC-LR
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: 50
- Joined: Thursday 04 January 2018 8:43
- Target OS: Linux
- Domoticz version: 3.66
- Location: Roeselare, Wvl, BE
- Contact:
Re: Pass2PHP
Is it normal that when no events ocure that the _cron60.php is not executed every 60 seconds? or am i missing something?
Tnx
Tnx
- Egregius
- Posts: 2582
- Joined: Thursday 09 April 2015 12:19
- Target OS: Linux
- Domoticz version: v2024.7
- Location: Beitem, BE
- Contact:
Re: Pass2PHP
If you don't trigger the script by cron yes. If you have lot's of devices it gets triggered automatically.
I shall post my cron script tomorrow, or it could be on github.
I shall post my cron script tomorrow, or it could be on github.
-
- Posts: 50
- Joined: Thursday 04 January 2018 8:43
- Target OS: Linux
- Domoticz version: 3.66
- Location: Roeselare, Wvl, BE
- Contact:
Re: Pass2PHP
ok, tnx there is a cron.sh file on git but i don't think that that is the file i need.
- Egregius
- Posts: 2582
- Joined: Thursday 09 April 2015 12:19
- Target OS: Linux
- Domoticz version: v2024.7
- Location: Beitem, BE
- Contact:
Re: Pass2PHP
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.
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.
-
- Posts: 50
- Joined: Thursday 04 January 2018 8:43
- Target OS: Linux
- Domoticz version: 3.66
- Location: Roeselare, Wvl, BE
- Contact:
Re: Pass2PHP
Works, needed also jq package installed
-
- Posts: 50
- Joined: Thursday 04 January 2018 8:43
- Target OS: Linux
- Domoticz version: 3.66
- Location: Roeselare, Wvl, BE
- Contact:
Re: Pass2PHP
Do you have an example or an idea how i can create a button with following function
First time pressed: change status of blinds to ON
Second time pressed: change status of blinds to Stop
Third time pressed: change status of blinds to Off
Fourth time pressed: change status of blinds to Stop
Fifth time pressed: change status of blinds to On
etc...
how can i remember in php the blinds two steps in history so i know if it is stopped i need to do On or Off the next time it is activated?
First time pressed: change status of blinds to ON
Second time pressed: change status of blinds to Stop
Third time pressed: change status of blinds to Off
Fourth time pressed: change status of blinds to Stop
Fifth time pressed: change status of blinds to On
etc...
how can i remember in php the blinds two steps in history so i know if it is stopped i need to do On or Off the next time it is activated?
- Egregius
- Posts: 2582
- Joined: Thursday 09 April 2015 12:19
- Target OS: Linux
- Domoticz version: v2024.7
- Location: Beitem, BE
- Contact:
Re: Pass2PHP
You want ON - STOP - OFF - STOP - ON - STOP - OFF - ...?
No matter what the current status of the blinds is?
And it's a button that acts independently from the blinds? I mean, without script the blinds don't respond to the button?
No matter what the current status of the blinds is?
And it's a button that acts independently from the blinds? I mean, without script the blinds don't respond to the button?
-
- Posts: 50
- Joined: Thursday 04 January 2018 8:43
- Target OS: Linux
- Domoticz version: 3.66
- Location: Roeselare, Wvl, BE
- Contact:
Re: Pass2PHP
yes ON - STOP - OFF - STOP - ON - STOP - OFF - ...?
the stop would only be needed the time it takes to get the blinds up or down, but maybe that i can figure out myself, the main problem is how do i know when i have status Stop, the next push will be On or Off?
The last question i don't understand.
the stop would only be needed the time it takes to get the blinds up or down, but maybe that i can figure out myself, the main problem is how do i know when i have status Stop, the next push will be On or Off?
The last question i don't understand.
- Egregius
- Posts: 2582
- Joined: Thursday 09 April 2015 12:19
- Target OS: Linux
- Domoticz version: v2024.7
- Location: Beitem, BE
- Contact:
Re: Pass2PHP
I think I would do something like this:
Use a cache where you set the last action, write that cache after each action with another value. I used onstop and offstop so you know wich stop action it was.
Code: Select all
<?php
if($status=='On'){
$pushbutton=apcu_fetch('pushbutton');
if($pushbutton=='on'){
//do stop action
apcu_store('pushbutton','onstop');
}elseif($pushbutton=='onstop'){
//do off action
apcu_store('pushbutton','off');
}elseif($pushbutton=='off'){
//do stop action
apcu_store('pushbutton','offstop');
}elseif($pushbutton=='offstop'){
//do on action
apcu_store('pushbutton','on');
}
}
-
- Posts: 50
- Joined: Thursday 04 January 2018 8:43
- Target OS: Linux
- Domoticz version: 3.66
- Location: Roeselare, Wvl, BE
- Contact:
Re: Pass2PHP
Tnx, since i don't know php (yet) i did not know the function to store variables the last in memory. i'l try it next week!
-
- Posts: 667
- Joined: Wednesday 08 March 2017 9:42
- Target OS: Linux
- Domoticz version: 3.8993
- Location: Amsterdam
- Contact:
Re: Pass2PHP
Hi all, I use the latest beta of domoticz 4. Consider to use pass2php but don't know if this will still make difference in speed. Can someone tell me?
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
I believe by default script/event handling is still the same in Domoticz 4.
So speed updates and more complicated calculations can only be made with DzVents and 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
I give it a try Always good to try new things to make it better.
1 question. I cannot find ee5_base64.lua in /domoticz/var/scripts/lua/
RPi3 B+, Debain Stretch, Domoticz, Homebridge, Dashticz, RFLink, Milight, Z-Wave, Fibaro, Nanoleaf, Nest, Harmony Hub, Now try to understand pass2php
- Egregius
- Posts: 2582
- Joined: Thursday 09 April 2015 12:19
- Target OS: Linux
- Domoticz version: v2024.7
- Location: Beitem, BE
- Contact:
Re: Pass2PHP
You don’t need base64 anymore to use pass2php.
-
- Posts: 54
- Joined: Thursday 23 June 2016 14:41
- Target OS: Raspberry Pi / ODroid
- Domoticz version: beta
- Location: NL
- Contact:
Re: Pass2PHP
tried Pass2PHP yesterday
and now the apache error log is filled with
on this line I see
which is strange because on al other itmes there is a , between cronxx and time. Ot isn't that the problem?
and now the apache error log is filled with
Code: Select all
[Sat Aug 11 00:01:25.002212 2018] [:error] [pid 7648] [client 127.0.0.1:39048] PHP Parse error: syntax error, unexpected 'time' (T_STRING), expecting ',' or ')' in /var/www/html/secure/pass2php.php on line 45
Code: Select all
apcu_store('cron120'time());
- 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
what happens if you just add the , in between? I indeed would think that is the issue.
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 forgot about this reply. Indeed, there needs to be a, in it.
apcu_store('cron120',time());
apcu_store('cron120',time());
Who is online
Users browsing this forum: No registered users and 1 guest