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
Make a php page that stores a post or get request in cache
Shall I post some code later?
Shall I post some code later?
- Egregius
- Posts: 2582
- Joined: Thursday 09 April 2015 12:19
- Target OS: Linux
- Domoticz version: v2024.7
- Location: Beitem, BE
- Contact:
Re: Pass2PHP
It's on my github already
https://github.com/Egregius/LUA-Pass2PH ... /cache.php
Usage:
cache.php?fetch=devicename returns the value of that cache
cache.php?store=devicename&value=Off = store that value in cache
I only need it internally so my file is in my secure folder.
If you make this available from internat you could ad forexample &token=anystring and use that as a security measurement.
https://github.com/Egregius/LUA-Pass2PH ... /cache.php
Usage:
cache.php?fetch=devicename returns the value of that cache
cache.php?store=devicename&value=Off = store that value in cache
I only need it internally so my file is in my secure folder.
If you make this available from internat you could ad forexample &token=anystring and use that as a security measurement.
- sincze
- Posts: 1299
- Joined: Monday 02 June 2014 22:46
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2024.4
- Location: Netherlands / Breda Area
- Contact:
Re: Pass2PHP
Damn... You completely redesigned pass2php since december 2016....Egregius wrote: ↑Friday 08 September 2017 19:01 It's on my github already
https://github.com/Egregius/LUA-Pass2PH ... /cache.php
Usage:
cache.php?fetch=devicename returns the value of that cache
cache.php?store=devicename&value=Off = store that value in cache
I only need it internally so my file is in my secure folder.
If you make this available from internat you could ad forexample &token=anystring and use that as a security measurement.
It seems I have a working... however outdated version running
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
Indeed, I just rewrote all the cache functions yesterday
It's still a work in progress,still some fine tuning but a lot less than a year ago. Once it does everything you need there's not much left to do.
It's still a work in progress,still some fine tuning but a lot less than a year ago. Once it does everything you need there's not much left to do.
- sincze
- Posts: 1299
- Joined: Monday 02 June 2014 22:46
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2024.4
- Location: Netherlands / Breda Area
- Contact:
Re: Pass2PHP
Hmm have been looking at your latest Github. It looks very nice and I can imagine for the 'starter' this now becomes a little bit more complicated than in December 2016. Even I got lost.
In my mind normally all functions would be in (and known within) pass2php.php that is called by the lua.
Pass2php.php would call (include) the pass2php/devicename.php
As all functions are within the 'root' document they can be used in the childs e.g. devicename.php.
I even got lost now as I can see the separate functions.php, cleaning up pass2php.php.
However I did not find a file that would include the functions.php to actually be able to use it. (I found it witin settings.php).
In addition I can imagine you added security for the floorplan access as well as some nice custom arrows and colours.
Where it used to be floorplans as project 1 and pass2php as project 2 you managed to integrate them both.
Pieuw brainteaser.
I'm still on...
In my mind normally all functions would be in (and known within) pass2php.php that is called by the lua.
Pass2php.php would call (include) the pass2php/devicename.php
As all functions are within the 'root' document they can be used in the childs e.g. devicename.php.
I even got lost now as I can see the separate functions.php, cleaning up pass2php.php.
However I did not find a file that would include the functions.php to actually be able to use it. (I found it witin settings.php).
In addition I can imagine you added security for the floorplan access as well as some nice custom arrows and colours.
Where it used to be floorplans as project 1 and pass2php as project 2 you managed to integrate them both.
Pieuw brainteaser.
I'm still on...
- 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
It's indeed difficult to separate the two things as they work perfectly together
Your json decode is very long time ago...
I wanted to create the settingsfile to have all user specific stuff in there, still some work to do. Once ready it should be a lot easier to update the other files.
Your json decode is very long time ago...
I wanted to create the settingsfile to have all user specific stuff in there, still some work to do. Once ready it should be a lot easier to update the other files.
-
- Posts: 8
- Joined: Thursday 16 June 2016 6:27
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Pass2PHP
Hi Egregius,
I barely started to understand your old pass2php, you have already updated.
Any particular reason you have removed apcu?
on a different note, would you run your programs from devicename.php or would you schedule it in cron jobs? Just some guidance..
Thanks
I barely started to understand your old pass2php, you have already updated.
Any particular reason you have removed apcu?
on a different note, would you run your programs from devicename.php or would you schedule it in cron jobs? Just some guidance..
Thanks
-
- Posts: 8
- Joined: Thursday 16 June 2016 6:27
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Pass2PHP
Hi Egregius,
_cron604800.php is still reflecting apcu functions.
setidx is not used and none of the switch works, because the idx values are zero.
_cron604800.php is still reflecting apcu functions.
setidx is not used and none of the switch works, because the idx values are zero.
- Egregius
- Posts: 2582
- Joined: Thursday 09 April 2015 12:19
- Target OS: Linux
- Domoticz version: v2024.7
- Location: Beitem, BE
- Contact:
Re: Pass2PHP
apcu wasn't stable here on Jessie. Did some very strange things.
My floorplan is based completely on the cache from pass2php. First evening after the update to Jessie it showed 9 of 10 times the good status but 1 of 10 times like a status of half hour before. Of course resulting in some serious flipping of the automated lights.
I instantly started to work on file based cache, have used that before.
Another advantage of this is that you can sync the cache to SD when domoticz stops. So even after a reboot you still have the cache from before.
Also updated cron604800 on github
My floorplan is based completely on the cache from pass2php. First evening after the update to Jessie it showed 9 of 10 times the good status but 1 of 10 times like a status of half hour before. Of course resulting in some serious flipping of the automated lights.
I instantly started to work on file based cache, have used that before.
Another advantage of this is that you can sync the cache to SD when domoticz stops. So even after a reboot you still have the cache from before.
Also updated cron604800 on github
- sincze
- Posts: 1299
- Joined: Monday 02 June 2014 22:46
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2024.4
- Location: Netherlands / Breda Area
- Contact:
Re: Pass2PHP
haha Mr innovator. luckily I was not able to use acpu... back in the days.Egregius wrote: ↑Saturday 09 September 2017 16:25 apcu wasn't stable here on Jessie. Did some very strange things.
My floorplan is based completely on the cache from pass2php. First evening after the update to Jessie it showed 9 of 10 times the good status but 1 of 10 times like a status of half hour before. Of course resulting in some serious flipping of the automated lights.
I instantly started to work on file based cache, have used that before.
Another advantage of this is that you can sync the cache to SD when domoticz stops. So even after a reboot you still have the cache from before.
Also updated cron604800 on github
I did install it on Jessie yesterday so I will not continue with that and use memcached.
Although I already started by digging up some of your old code:
- Spoiler: show
What do your metrics say with file based cache.. Fast .. Faster .. Fastest ??
or reliable, more reliable ...
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
File based is a little bit slower than apcu but almost not measurable in pass2php.
For my floorplan I read about 80 caches, there the time needed is 3msec for apcu, 6msec for file based. So maybe 3msec divided by 80 is the speed difference between apcu en file.
And I made a huge error, it's not on Jessie that apcu wasn't stable but on Stretch (Debian 9).
For my floorplan I read about 80 caches, there the time needed is 3msec for apcu, 6msec for file based. So maybe 3msec divided by 80 is the speed difference between apcu en file.
And I made a huge error, it's not on Jessie that apcu wasn't stable but on Stretch (Debian 9).
-
- 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 Egregius,
i updated my Domoticz to the latest version => V3.8699
and what i see in the Domoticz log file now is that all commands executed by your php script are executed 2 or 3times after eachother.
Please see attached screenshot.
You can help me by pointing me in what direction in need to look for?
Thanks mate!
i updated my Domoticz to the latest version => V3.8699
and what i see in the Domoticz log file now is that all commands executed by your php script are executed 2 or 3times after eachother.
Please see attached screenshot.
You can help me by pointing me in what direction in need to look for?
Thanks mate!
- Attachments
-
- 2017-11-05 13_33_14-Domoticz.jpg (127.36 KiB) Viewed 2368 times
-
- Posts: 40
- Joined: Friday 24 February 2017 21:20
- Target OS: Linux
- Domoticz version: Beta
- Location: Netherlands
- Contact:
Re: Pass2PHP
fixed in beta 8701
- Egregius
- Posts: 2582
- Joined: Thursday 09 April 2015 12:19
- Target OS: Linux
- Domoticz version: v2024.7
- Location: Beitem, BE
- Contact:
Re: Pass2PHP
I've seen topics about double actions so I assume it is/was a domoticz issue.
I don't know because I don't update anymore
I don't know because I don't update anymore
-
- Posts: 483
- Joined: Tuesday 12 August 2014 5:37
- Target OS: Raspberry Pi / ODroid
- Domoticz version: V3_8394
- Location: Rumbeke,Belgium
- Contact:
Re: Pass2PHP
i better staid with my older version, seems domoticz is crashing a lot now
- sincze
- Posts: 1299
- Joined: Monday 02 June 2014 22:46
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2024.4
- Location: Netherlands / Breda Area
- Contact:
Re: Pass2PHP
Happy Birthday Pass2PHP.
Ik has been over a year I started to use this and I must say it has been worthwile. The system is running faster than ever.. Tnx @egregius.
Ik has been over a year I started to use this and I must say it has been worthwile. The system is running faster than ever.. Tnx @egregius.
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
Nice, and you're welcome
I do wonder how far you go with it?
Speeking of fast: I recently moved from a RPi2 to a oversized Intel NUC and virtualized Debian with Domoticz in Proxmox...
In the beginning of this topic I was so happy to get response times lower than 80msec. Now they're down to 6 msec
I do wonder how far you go with it?
Speeking of fast: I recently moved from a RPi2 to a oversized Intel NUC and virtualized Debian with Domoticz in Proxmox...
In the beginning of this topic I was so happy to get response times lower than 80msec. Now they're down to 6 msec
-
- Posts: 52
- Joined: Friday 23 December 2016 9:41
- Target OS: Linux
- Domoticz version:
- Contact:
Re: Pass2PHP
Hear hear!
I was already running Domoticz on a Ubuntu VM on an ESXi NUCEgregius wrote: ↑Friday 22 December 2017 8:48 Nice, and you're welcome
I do wonder how far you go with it?
Speeking of fast: I recently moved from a RPi2 to a oversized Intel NUC and virtualized Debian with Domoticz in Proxmox...
In the beginning of this topic I was so happy to get response times lower than 80msec. Now they're down to 6 msec
- sincze
- Posts: 1299
- Joined: Monday 02 June 2014 22:46
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2024.4
- Location: Netherlands / Breda Area
- Contact:
Re: Pass2PHP
Guys guys. Tell me what to buy. exactly. Need for speed.
Currently running it on CubieTruck with ssd. Seems fast enough haha. It must be low power consuming.
I try to teach people how to use pass2php but if they look at github they are overwhelmed with confusion. And may be it lacks a bit of explanatory documentation. As I have read ALL forum posts I at least understand the power. your latest security additions are still a mystery to me
Sent from my SM-G925F using Tapatalk
Currently running it on CubieTruck with ssd. Seems fast enough haha. It must be low power consuming.
I try to teach people how to use pass2php but if they look at github they are overwhelmed with confusion. And may be it lacks a bit of explanatory documentation. As I have read ALL forum posts I at least understand the power. your latest security additions are still a mystery to me
Sent from my SM-G925F using Tapatalk
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.
Who is online
Users browsing this forum: No registered users and 1 guest