Page 1 of 1

Convert blocky script to dzVents

Posted: Wednesday 29 July 2020 11:24
by raymond1972
Hi all,

Recently I upgraded my Domoticz installation to Domoticz 2020.2
I would like one of my blocky scripts to be converted to dzVentz.

Can anyone help me to get this done properly?

Please find my attached screenshot of the blocky script I want to convert.
Schermafbeelding 2020-07-29 om 11.20.27.png
Schermafbeelding 2020-07-29 om 11.20.27.png (40.12 KiB) Viewed 559 times

Kind Regards,
Raymond

Re: Convert blocky script to dzVents

Posted: Wednesday 29 July 2020 11:55
by waaren
raymond1972 wrote: Wednesday 29 July 2020 11:24 I would like one of my blocky scripts to be converted to dzVentz.
What are the types / subtypes of "Hal verlichting" and "Hal Schemer" as shown on the devices tab ?

Re: Convert blocky script to dzVents

Posted: Wednesday 29 July 2020 13:13
by raymond1972
Hi @Waaren,

Thank you for your quick response.
the device types are:

Hal verlichting : script device - light switch - selector switch
Hal schemer : zwave device - lux - lux
Sensor - Voordeur : zwave device - light switch - switch
Hal Beweging : zwave device - light switch - switch

set group Hal aan ECO : group

Kind Regards,
Raymond

Re: Convert blocky script to dzVents

Posted: Wednesday 29 July 2020 14:36
by waaren
raymond1972 wrote: Wednesday 29 July 2020 13:13 The device types are:
Please check spelling (case etc.. ) before saving

Could look like something below

Code: Select all

return
{
    on =
    {
        devices =
        {
            'Hal verlichting',
            'Sensor - Voordeur',
            'Hal Beweging',
        },
    },

    logging =
    {
        level = domoticz.LOG_DEBUG, -- change to domoticz.LOG_ERROR when all is OK
        marker = 'Hal beweging',
    },

    execute = function(dz, item)
        local halLight = dz.devices('Hal verlichting')
        local halTwilight = dz.devices('Hal Schemer')
        local frontDoor= dz.devices('Sensor - Voordeur')
        local halMotion = dz.devices('Hal Beweging')

        local halECOGroup = dz.groups('Hal aan ECO')

        if halLight.levelName == 'Beweging' and halTwilight.lux < 75 and frontDoor.state == 'Open' and halMotion.active then
            halECOGroup.switchOn()
        else
            halECOGroup.switchOff()
        end

    end
}

Re: Convert blocky script to dzVents

Posted: Wednesday 29 July 2020 16:35
by raymond1972
Hi Waaren,

Thanx for setting me up.
I will definitely try this.

Thanx