call dzVent script as Selector Action. script:/// and then?

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

Moderator: leecollings

Post Reply
plugge

call dzVent script as Selector Action. script:/// and then?

Post by plugge »

I'm trying to have a Selector (Type Switch, Selector Switch, Selector) call a dzVents script ("http://" works fine).
It should start with "script://" and is supposed to execute scripts in folder "scripts" beneath Domoticz.
(On Github I read that it should start with "script:///", three forward slashes)
How do I call a dzVents script in "generated_scripts"? (BTW: on a W10 machine)
I've tried several paths, but all I get is (f.e.)

Code: Select all

SQLHelper: Error script not found '/dzVents\generated_scripts\tesyControl.lua'
I couldn't find it in neither the dzVents manual nor the forum.

Anyone succeeded doing this with dzVent scripts in the "generated_scripts" folder?
(Note: on a windows machine, i.e., backward slash)
TIA
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: call dzVent script as Selector Action. script:/// and then?

Post by waaren »

plugge wrote: Sunday 07 March 2021 23:26 I'm trying to have a Selector (Type Switch, Selector Switch, Selector) call a dzVents script ("http://" works fine).

Anyone succeeded doing this with dzVent scripts in the "generated_scripts" folder?
It is not possible to call a dzVents script like this nor needed. The dzVents script can be triggered natively by the update of the selector switch
See below example.

check the wiki for a complete description and howto

Code: Select all

return
{
    on =
    {
        devices =
        {
            'name of your selector switch',
        },
    },

    logging =
    {
        level = domoticz.LOG_DEBUG, -- change to domoticz.LOG_ERROR when all OK
        marker = 'Selector actions',
    },

    execute = function(dz, item)
        if item.levelName == 'level 1' then -- replace level 1 by the actual levelname
            -- do actions for level 1
        elseif item.levelName == 'level 2' then -- replace level 1 by the actual levelname
            -- do actions for level 2
        elseif item.levelName == 'level 3' then -- etc..
            -- etc
        end
    end
}

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

Re: call dzVent script as Selector Action. script:/// and then? [solved]

Post by plugge »

It is not possible to call a dzVents script like this
Ok, thanks.
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 1 guest