Thanks sincze for the explanations here, I don't have much time right now, busy developping a huge website, in PHP of course
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.