problems launching php scripts with dzVents  [Solved]

Easy to use, 100% Lua-based event scripting framework.

Moderator: leecollings

Post Reply
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: problems launching php scripts with dzVents  [Solved]

Post by waaren »

miki8989 wrote: Thursday 29 August 2019 16:11 I have a problem creating a dzVents that launches a php script
he script doesn't start and I don't see any LUA activity in the logs
Can you try

Code: Select all

return 
{
    active = true,
    on = 
    { 
    	timer         = { "every minute" },
    },
       execute = function(domoticz)
	   os.execute ('/var/www/MyScripts/rete.php &')
      end
}
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: problems launching php scripts with dzVents

Post by waaren »

miki8989 wrote: Thursday 29 August 2019 21:38 ..but if i wanted to start the script every 15 seconds ??
It is possible to do this but only with kind of a trick, using a delayed action on a virtual device or delayed call to openurl . Find below an example with a virtual device (type switch) that you will have to define in domoticz before first execution.

Code: Select all

return 
{
    on = 
    { 
    	timer = { 'every 10 minutes' },
        devices = { 'myTrigger' }, -- define this as virtual switch on dummy hardware first. Can be any valid name
    },

       execute = function(dz, item)
            trigger = dz.devices('myTrigger')  
            if item.isTimer then
                for delay=0,545,15 do
                    trigger.switchOn().afterSec(delay)
                end
            else
                os.execute ('/var/www/MyScripts/rete.php &')
            end
      end
}
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: problems launching php scripts with dzVents

Post by waaren »


miki8989 wrote: if I wanted every 10 seconds I should put

Code: Select all

for delay=0,550,10 do
every 20 seconds

Code: Select all

for delay=0,540,20 do
Yes, you got the picture.




Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: problems launching php scripts with dzVents

Post by waaren »


miki8989 wrote:sorry for the picture of what ??
https://www.macmillandictionary.com/dic ... he-picture
Image


Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest