Page 75 of 76

Re: Pass2PHP

Posted: Sunday 19 February 2023 3:02
by Egregius
First of all, make a good backup ;)
Normally shouldn't be a problem. One thing I noticed in 2023.1 is that the S value of a dimmer isn't passed in the devicechanged lua table. Therefor a dimmer arrives as On/Off in php instead of it's level %. Haven't found a fix yet for that so I returned to 2022.2.

Re: Pass2PHP

Posted: Saturday 01 April 2023 21:27
by gimic
The update has gone surprisingly well. Now updated for 3 days and no big issues yet.
issues i got were:
1 Blinds no longer functioning
-> why? because in old version the status was on, off and stop now it is open, closed and stopped
--> solution: change the every php where the status is checked ;-)

2 Dashticz was not fuctioning correct for screens, up was down and down was up
-> why? old version of dashticz
--> solution: upgrade to latest version.

Re: Pass2PHP

Posted: Sunday 02 April 2023 7:54
by Egregius
Great to read everything want OK. Do you have dimmers?

Re: Pass2PHP

Posted: Tuesday 25 April 2023 23:05
by gimic
No, i don't have dimmers. All lights / roller shutters & blinds are on relay modules.

Re: Pass2PHP

Posted: Saturday 29 April 2023 11:44
by sincze
Egregius wrote: Sunday 19 February 2023 3:02 First of all, make a good backup ;)
Normally shouldn't be a problem. One thing I noticed in 2023.1 is that the S value of a dimmer isn't passed in the devicechanged lua table. Therefor a dimmer arrives as On/Off in php instead of it's level %. Haven't found a fix yet for that so I returned to 2022.2.
Thanks for noticing this.

Re: Pass2PHP

Posted: Saturday 29 April 2023 12:05
by waltervl
sincze wrote: Saturday 29 April 2023 11:44
Egregius wrote: Sunday 19 February 2023 3:02 First of all, make a good backup ;)
Normally shouldn't be a problem. One thing I noticed in 2023.1 is that the S value of a dimmer isn't passed in the devicechanged lua table. Therefor a dimmer arrives as On/Off in php instead of it's level %. Haven't found a fix yet for that so I returned to 2022.2.
Thanks for noticing this.
That is fixed in 2023 beta but a little bit different, it is now in devicechanged_ext, see viewtopic.php?p=299819#p299819

Re: Pass2PHP

Posted: Wednesday 21 June 2023 21:51
by sincze
waltervl wrote: Saturday 29 April 2023 12:05
sincze wrote: Saturday 29 April 2023 11:44
Egregius wrote: Sunday 19 February 2023 3:02 First of all, make a good backup ;)
Normally shouldn't be a problem. One thing I noticed in 2023.1 is that the S value of a dimmer isn't passed in the devicechanged lua table. Therefor a dimmer arrives as On/Off in php instead of it's level %. Haven't found a fix yet for that so I returned to 2022.2.
Thanks for noticing this.
That is fixed in 2023 beta but a little bit different, it is now in devicechanged_ext, see viewtopic.php?p=299819#p299819
@Egregius did you by any chance checked this ?? if we can continue to upgrade ;-0 from 2022.2.
I now have again everything up and running with zigbee2mqtt and zwave-js-ui as replacement of OZW.

Re: Pass2PHP

Posted: Thursday 22 June 2023 7:57
by Egregius
I didn't update anymore. I'm currently working on new cron jobs running in loop instead of single runs and a mqttclient. I was thinking to run zwave-js inside Home assistant as it's easier to update there and then have my php mqtt client receive the zwave signals directly without domoticz.
At this moment I have the new crons operational and the mqtt client. The move to zwave-js will be for after the vacation. I'm not gonna risk to change it now.

Re: Pass2PHP

Posted: Thursday 22 June 2023 9:43
by sincze
Egregius wrote: Thursday 22 June 2023 7:57 The move to zwave-js will be for after the vacation. I'm not gonna risk to change it now.
I can imagine. As it took me 2 weeks to get it stable again. (different post).
Can you share the new idea on the architecture ?
Interested to see these CRONS as well.

Re: Pass2PHP

Posted: Thursday 22 June 2023 16:03
by Egregius
I've seen your post ;)

My idea is to have everything mqtt based. Domoticz publishes updates to mqtt, home assistant does also. In the future il add zwave-js so that's also in mqtt. Then with one mqtt client in php I'll have all data instantly.
Because of this, the lua script isn't used anymore.
The crons are basically the same. Only difference is that it runs in a loop within php instead of being called by cron.sh. Just did that to have things switched at exactly 0,10, 20 seconds etc and not at 2,12,23... :lol:

Re: Pass2PHP

Posted: Friday 23 June 2023 8:48
by sincze
Egregius wrote: Thursday 22 June 2023 16:03 I've seen your post ;)

My idea is to have everything mqtt based. Domoticz publishes updates to mqtt, home assistant does also. In the future il add zwave-js so that's also in mqtt. Then with one mqtt client in php I'll have all data instantly.
Because of this, the lua script isn't used anymore.
The crons are basically the same. Only difference is that it runs in a loop within php instead of being called by cron.sh. Just did that to have things switched at exactly 0,10, 20 seconds etc and not at 2,12,23... :lol:
Is this a Pass2PHP on a few more steroids idea?
I currently have a lot of the easy automating moved from Pass2PHP to NodeRED.
node-red-egregius.PNG
node-red-egregius.PNG (176.93 KiB) Viewed 21705 times
And the difficult stuff (scraping websites e.g.) by Pass2PHP.

Any reason on the 'why to use Home Assistant'. supports more hardware and pushes it quite well to MQTT ??

Can I have a sneak preview in your GIT repo on how to setup the new idea?

Re: Pass2PHP

Posted: Friday 23 June 2023 10:38
by Egregius
Well, where I'm today is always published on https://github.com/Egregius/PHP-Floorpl ... r-Domoticz

More steroids? Perhaps. Everything of my automation is handled by php. Domoticz is barely an interface between php and the hardware.
I started Home Assistant because my Ring doorbell died and I installed an Eufy one instead. Didn't find a good integration for that besides in HA. After that I also bought 10 wifi wall plugs and those are also just working in HA and not in domoticz.

Re: Pass2PHP

Posted: Friday 23 June 2023 10:48
by sincze
Egregius wrote: Friday 23 June 2023 10:38 Well, where I'm today is always published on https://github.com/Egregius/PHP-Floorpl ... r-Domoticz
That one I have bookmarked an now I understand why it starts with: $d=fetchdata();
I was looking for instructions on how to keep the cron php in a loop with the php mqtt client.
Maybe i need to dig a little deeper with your idea in mind.
Egregius wrote: Friday 23 June 2023 10:38 More steroids? Perhaps. Everything of my automation is handled by php. Domoticz is barely an interface between php and the hardware.
I started Home Assistant because my Ring doorbell died and I installed an Eufy one instead. Didn't find a good integration for that besides in HA. After that I also bought 10 wifi wall plugs and those are also just working in HA and not in domoticz.
Gotcha, as expected HA has lots of native integrations, but in a docker my Pi is not that happy with it.
With the whole MQTT thought it is just a collector and the possibilities are then endless.

Re: Pass2PHP

Posted: Friday 23 June 2023 13:21
by Egregius
I have HA running in a Proxmox VM ;)
On the same Proxmox hypervisor as where domoticz runs so all 'network' traffic stays internal.

Re: Pass2PHP

Posted: Saturday 24 June 2023 21:13
by sincze
I'm breaking down the code into blocks to understand the working of the CRON & MQTT idea.

As over the years I think the Pass2PHP approach is becoming more difficult to follow for new-enthusiasts and might scare people off.
egregius_cron.PNG
egregius_cron.PNG (23.58 KiB) Viewed 21652 times

Re: Pass2PHP

Posted: Saturday 24 June 2023 22:03
by Egregius
It was never the intention to make it simple :lol:
Just back in the days the only thing talked about here was lua, lua and lua. Just wanted to prove that other languages could be used as well.

Re: Pass2PHP

Posted: Sunday 24 September 2023 23:22
by sincze
Been looping through your Github again ;-)
Also have Domoticz 2023.x in a docker so can have a look at the dimmer issue as well.

How is HA doing?
For me that one is not working pleasantly in a docker. (Could be an issue whilst still using 32bit OS)

Re: Pass2PHP

Posted: Monday 25 September 2023 8:38
by Egregius
HA is running in a Proxmox VM so it runs 100% stable. But, only used for my Eufy doorbell and some Tuya wifi wall plugs.
Already had issues with HA where stuff didn't work anymore after an update. Had to restore from a backup.
Haven't updated anymore since because it does what it needs to do and it does it stable in that version. Some with Domoticz for me. 2023.2 runs very stable and works perfectly with OpenZwave so why would I change that?
I'm getting a bit scared of updates globally. Recently received a FW update for my Sony HT-5000 speaker, still works but doens't startup automatically anymore whenever I put my TV on. So this one waits for another update and will then block internet access for it.

Re: Pass2PHP

Posted: Sunday 11 February 2024 18:15
by sincze
@egregius, don't know if you moved along with Domoticz 2024 releases ;-)
Currently working on a Docker stack (PHP-FPM + CRON + NGINX ) that handles your pass4mqtt.php idea.

Whilst looking at the code I think this is still pre-2024 Domoticz release.

Code: Select all

elseif ($message['dtype']=='Color Switch') {
					$status=$message['nvalue'];
					lg(' (MQTT) Colorswitch '.$device.' => '.$status);	
					store($device, $status,' (MQTT) Color ');
As for a color switch it now stores '15' (indicating it is a color switch vs nvalue of 0,1 e.g.), however the level (brightness) that is stored in 'svalue1' or "Level" is thrown away,

My assumption correct ?

Re: Pass2PHP

Posted: Monday 12 February 2024 12:39
by Egregius
I'm on stable 2024.4.

Didn't notice anything yet. I must add that I don't really have color switch besides my Xiaomi hub which I only use for a green or red light.