Pass2PHP

Moderator: leecollings

User avatar
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

Post by sincze »

ropske wrote: Sunday 07 April 2019 21:49
sincze wrote: Friday 05 April 2019 8:07 Wall switch are NEO Coolcam.(1 or 2 channel) blue brown and black wire required!!!
Around 20 euro I buy them on AliExpress.

Roller shutters are controlled automatically with Domoticz or with simple remote :) (hardly used) hahaha.


Sent from my ONEPLUS A6003 using Tapatalk
Just searched for this device and it seems nice.
But you can only use it when you have 1 switching point (nederlands: enkel als je een enkelpolige schakelaar hebt)
For example if you need a switching point for 2 places (nederlands: wisselschakelaar)
Is it also possible?
Thanks!
Wisselschakelaar I think indeed not possible. You'll have to fake it but then you have to have a domoticz that is always online..... otherwise... WAF... no go no go. I believe KAKU now has a solution for that ,,, but then again... it is 433 mhz.. So we don't want to go that way. Other idea... Smart bulbs... Leave everything always on .... and control the lights with motion sensors... In case of emergency you use one of the switches to switch on the light. That is how I solved it as well for those specific cases.
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: 1299
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: Monday 08 April 2019 5:19 Published the new version on https://github.com/Egregius/PHP-Floorpl ... r-Domoticz
It's a combined repository for pass2php and php floorplan, because they're very much linked to each other.
From now on the repository is updated automagically :)
Of course, still lot's of work to do in the wiki. Feel free to be a contributor and help with that ;)
Goodie goodie. lets find out. :D
It looks amazing.
Amazing Job.

It seems more DB than CACHE oriented now.
Might scare some of our starting fans.
Did scare me :lol: as I am not using the Floorplans. Maybe I should :P
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 »

ropske wrote: Sunday 07 April 2019 21:49 Just searched for this device and it seems nice.
But you can only use it when you have 1 switching point (nederlands: enkel als je een enkelpolige schakelaar hebt)
For example if you need a switching point for 2 places (nederlands: wisselschakelaar)
Is it also possible?
Thanks!
You can use regular push buttons for that. Everywhere I needed 2 or 3 switches I changed them to push buttons with a Qubino/Fibaro relay or dimmer.
We hardly ever use them because all the lights turn on automatically when there's movement. Basically it's only in the bedrooms that they're used.
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 »

sincze wrote: Monday 08 April 2019 17:58 Goodie goodie. lets find out. :D
It looks amazing.
Amazing Job.

It seems more DB than CACHE oriented now.
Might scare some of our starting fans.
Did scare me :lol: as I am not using the Floorplans. Maybe I should :P
You definitely should try it. It's a lot easier for daily use than the domoticz gui. I have 126 switches on the switches tab, that's just not usable in the domoticz gui on a smartphone. It also gives you the possibility to integrate a lot of other stuff in the same gui, like Kodi control pages, receiver control,...
It makes it also a lot easier to set secondary modes for switches that then bypasses the automatic stuff.
But indeed, everything is MySQL based now. Might look difficult, on the other hand, the apcu stuff before was also not that easy to get working.
User avatar
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

Post by sincze »

Egregius wrote: Tuesday 09 April 2019 6:36
ropske wrote: Sunday 07 April 2019 21:49 Just searched for this device and it seems nice.
But you can only use it when you have 1 switching point (nederlands: enkel als je een enkelpolige schakelaar hebt)
For example if you need a switching point for 2 places (nederlands: wisselschakelaar)
Is it also possible?
Thanks!
You can use regular push buttons for that. Everywhere I needed 2 or 3 switches I changed them to push buttons with a Qubino/Fibaro relay or dimmer.
We hardly ever use them because all the lights turn on automatically when there's movement. Basically it's only in the bedrooms that they're used.
Damn I forgot about that one. Robbshop has detailed installation guides available :D .
But for my wallet it was a bit to expensive as they are hardly used indeed. :lol:
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 »

sincze wrote: Tuesday 09 April 2019 9:11
Egregius wrote: Tuesday 09 April 2019 6:36
ropske wrote: Sunday 07 April 2019 21:49 Just searched for this device and it seems nice.
But you can only use it when you have 1 switching point (nederlands: enkel als je een enkelpolige schakelaar hebt)
For example if you need a switching point for 2 places (nederlands: wisselschakelaar)
Is it also possible?
Thanks!
You can use regular push buttons for that. Everywhere I needed 2 or 3 switches I changed them to push buttons with a Qubino/Fibaro relay or dimmer.
We hardly ever use them because all the lights turn on automatically when there's movement. Basically it's only in the bedrooms that they're used.
Damn I forgot about that one. Robbshop has detailed installation guides available :D .
But for my wallet it was a bit to expensive as they are hardly used indeed. :lol:
Do you have any idea at what time interval you need to reinstall the battery for the motion sensors?
i'm using the fibaro motion sensor and its sending temperature and luminance at 5min interval.
But my battery is getting low fast (3months)

Thanks, and btw, looking awesome to install the new pass2php in my new house :D
User avatar
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

Post by sincze »

ropske wrote: Tuesday 09 April 2019 9:31 Do you have any idea at what time interval you need to reinstall the battery for the motion sensors?
i'm using the fibaro motion sensor and its sending temperature and luminance at 5min interval.
But my battery is getting low fast (3months)

Thanks, and btw, looking awesome to install the new pass2php in my new house :D
A well I use the Zigbee XIAOMI motion sensors and never changed a battery since installation over 1 year ago.
Never changed a NEO Coolcam motion sensor battery as well and they are installed on the stairs and in the Kitchen. so daily used.
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.
gimic
Posts: 50
Joined: Thursday 04 January 2018 8:43
Target OS: Linux
Domoticz version: 3.66
Location: Roeselare, Wvl, BE
Contact:

Re: Pass2PHP

Post by gimic »

What is the main diference between the code published here
https://github.com/Egregius/LUA-Pass2PHP-for-Domoticz
and the new code?

i'm upgrading this saturday to a new debian machine with latest domoticz version. Maybe i need to revise the pass2php code also?
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 »

Biggest difference is that the cache is now stored in a MySQL database instead of APCu cache from PHP.
At the beginning of functions.php that cache is fetched into one big array wich holds all the devices statusses, modes and timestamps.
Therefor you don't need to worry calling a cache again in a script that it could cause overhead or something similar. And it gives a lot more freedom and possibilities in the scripts. It's quite a luxury to have all that data available everywhere you are.
gimic
Posts: 50
Joined: Thursday 04 January 2018 8:43
Target OS: Linux
Domoticz version: 3.66
Location: Roeselare, Wvl, BE
Contact:

Re: Pass2PHP

Post by gimic »

Is it as fast as before or do you notice delay? for me speed is imported as all my switches & lights are controlled by it.
so there is no more a php file needed for every device created in domoticz?
do you have a installation procedure?
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 »

My lights switch within 1 msec. Don't think that it can be any faster than that ;)
Before with the apcu option I was at about 18 msecs.

No, not at the moment. The wiki must be filled.
Basically you'll need a php enabled web server like before and a Mysql server. There's a script to create the database.
From there on it should be quite the same as before.
gimic
Posts: 50
Joined: Thursday 04 January 2018 8:43
Target OS: Linux
Domoticz version: 3.66
Location: Roeselare, Wvl, BE
Contact:

Re: Pass2PHP

Post by gimic »

Ok, il try to make it working tonight.
gimic
Posts: 50
Joined: Thursday 04 January 2018 8:43
Target OS: Linux
Domoticz version: 3.66
Location: Roeselare, Wvl, BE
Contact:

Re: Pass2PHP

Post by gimic »

Can you reply to the question:
so there is no more a php file needed for every device created in domoticz?
Every event or action is hanled by the named function in the pass2php.php file?

now i have php code in each 'device php' file to do some action.

Tnx for your help.
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 »

Sorry, forgot that one.

In pass2php the include is now done at the end with a @ in front of it (to surpress errors):
@include 'pass2php/'.$device.'.php';

So only for devices that you want something to happen you need to have the files. No more empty files needed.

See https://github.com/Egregius/PHP-Floorpl ... e/pass2php for examples
User avatar
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

Post by sincze »

I need a POC environment for this. As in production this is not allowed. WAF -> DIS-APPROVES

18msec -> 1msec.... Goodie goodie.

That is amazing.
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.
gimic
Posts: 50
Joined: Thursday 04 January 2018 8:43
Target OS: Linux
Domoticz version: 3.66
Location: Roeselare, Wvl, BE
Contact:

Re: Pass2PHP

Post by gimic »

That is why i al doing the upgrade this saturday, wife NOT home 😁
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 »

During the transition from old to new you can have some strange behaviour of course.
It took me several hours to rewrite all the files with the new way. Replacing every apcu_fetch('device') with $d['device']['s']...
But now I'm done, everything works better than before so I'm happy :lol:
And the wife? She used to see strange things here :mrgreen:
gimic
Posts: 50
Joined: Thursday 04 January 2018 8:43
Target OS: Linux
Domoticz version: 3.66
Location: Roeselare, Wvl, BE
Contact:

Re: Pass2PHP

Post by gimic »

i'm not using much apcu_fetch('device') i think, only simple stuff sw(device, on/off) so i think the migration will be ok?
only apcu i use is to maintain the last status of the rollershutter. This will be an enhancement for me when writing in db because every day the apache auto restarts at 9h and apcu is empty after that, so status is lost...
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 »

That's indeed another great thing about storing in MySQL, data is persistant.
Before I used to fetch the statusses from domoticz from time to time, no I don't do that anymore and everything stays in sync anyway.
gimic
Posts: 50
Joined: Thursday 04 January 2018 8:43
Target OS: Linux
Domoticz version: 3.66
Location: Roeselare, Wvl, BE
Contact:

Re: Pass2PHP

Post by gimic »

What does your config.php file looks like?
PHP Fatal error: require(): Failed opening required '/var/www/config.php'

Tnx
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest