dzVents script shows strange behavior

Moderator: leecollings

Post Reply
Fredom
Posts: 140
Joined: Saturday 19 September 2020 21:02
Target OS: Raspberry Pi / ODroid
Domoticz version: 2022.2
Location: Krimpen aan den IJssel
Contact:

dzVents script shows strange behavior

Post by Fredom »

Dear members
The script below has always worked fine, but it stopped working a week ago.
The script only switches On both during the day and at night.
When I switch the lines nighttime and daytime, the script only switches Off.
How is this possible? Restoring from a backup didn't help either.

Code: Select all

--isDonker (Dummy switch) dzVentz
--Nighttime dummy switch is on (check every xx minutes)
--Daytime dummy switch is off (check every xx minutes)
--After a power failure or reset the dummy always comes back in the right position

return 
{
	active = true,
	
	on = {
		timer = {
         'every 2 minutes at daytime',
         'every 2 minutes at nighttime'
		}
	},
	execute = function(domoticz, device, triggerInfo)
	    local donker = domoticz.devices('isDonker')
                        
	    if (triggerInfo.trigger == 'every 2 minutes at nighttime')
	    then
		    donker.switchOn().checkFirst()		 
		    domoticz.log('isDonker device is switched ON by dzVentz scripts TRIGGER 1');
		elseif (triggerInfo.trigger == 'every 2 minutes at daytime')
		then
		    donker.switchOff().checkFirst()
		    domoticz.log('isDonker device is switched OFF by dzVentz scripts TRIGGER 2');
	end
end
}
Yours sincerely,
Fred

Rasberry Pi 3B+ - Debian Buster - Domoticz 2022.2
RFLink - RFXCom - Zigbee (CC2531)
P1 Smart Meter - KaKu
Fredom
Posts: 140
Joined: Saturday 19 September 2020 21:02
Target OS: Raspberry Pi / ODroid
Domoticz version: 2022.2
Location: Krimpen aan den IJssel
Contact:

Re: dzVents script shows strange behavior

Post by Fredom »

None of the members who can solve this problem for me??
Yours sincerely,
Fred

Rasberry Pi 3B+ - Debian Buster - Domoticz 2022.2
RFLink - RFXCom - Zigbee (CC2531)
P1 Smart Meter - KaKu
User avatar
waltervl
Posts: 5148
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: dzVents script shows strange behavior

Post by waltervl »

Did you upgrade? On what version of Domoticz are you now? Still on 2020.2 as your profile is saying?
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Fredom
Posts: 140
Joined: Saturday 19 September 2020 21:02
Target OS: Raspberry Pi / ODroid
Domoticz version: 2022.2
Location: Krimpen aan den IJssel
Contact:

Re: dzVents script shows strange behavior

Post by Fredom »

waltervl wrote: Thursday 10 June 2021 15:49 Did you upgrade? On what version of Domoticz are you now? Still on 2020.2 as your profile is saying?
Thanks for your response.
Domoticz 2021-1 runs on a Rapberry pi 3b.
Nothing has been changed in the script or in any other configuration.
A week ago this script suddenly showed this behavior
Yours sincerely,
Fred

Rasberry Pi 3B+ - Debian Buster - Domoticz 2022.2
RFLink - RFXCom - Zigbee (CC2531)
P1 Smart Meter - KaKu
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: dzVents script shows strange behavior

Post by waaren »

Fredom wrote: Thursday 10 June 2021 16:29 [Domoticz 2021-1 runs on a Rapberry pi 3b. Nothing has been changed in the script or in any other configuration.
A week ago this script suddenly showed this behavior
Was that before or after the update to 2021.1 ?

Can you have a look at this one ?

Code: Select all

return
{
    on =
    {
        timer =
        {
         'every 2 minutes',
        },
    },

    logging =
    {
        level = domoticz.LOG_DEBUG,
        marker = 'donker',
    },

    execute = function(dz)
        local astroSwitch = dz.devices('isDonker')
        local isDark = astroSwitch.state == 'On'
        local isLight = not(isDark)

        if dz.time.isNightTime and isDark  then
            astroSwitch.switchOn()
            dz.log('isDonker device is switched ON by dzVents scripts TRIGGER 1' , dz.LOG_DEBUG)
        elseif dz.time.isDayTime and isLight then
            astroSwitch.switchOff()
            dz.log('isDonker device is switched OFF by dzVents scripts TRIGGER 2' , dz.LOG_DEBUG)
        end

        dz.utils.dumpTable(dz.time)
        dz.log('dayTime in domoticz.time: ' .. tostring(dz.time.isDayTime) .. ' ; isDark in domoticz switch: ' .. tostring(isDark), dz.LOG_DEBUG )

    end
}
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
Fredom
Posts: 140
Joined: Saturday 19 September 2020 21:02
Target OS: Raspberry Pi / ODroid
Domoticz version: 2022.2
Location: Krimpen aan den IJssel
Contact:

Re: dzVents script shows strange behavior

Post by Fredom »

waaren wrote: Thursday 10 June 2021 18:01
Fredom wrote: Thursday 10 June 2021 16:29 [Domoticz 2021-1 runs on a Rapberry pi 3b. Nothing has been changed in the script or in any other configuration.
A week ago this script suddenly showed this behavior
Was that before or after the update to 2021.1 ?

Can you have a look at this one ?

Code: Select all

return
{
    on =
    {
        timer =
        {
         'every 2 minutes',
        },
    },

    logging =
    {
        level = domoticz.LOG_DEBUG,
        marker = 'donker',
    },

    execute = function(dz)
        local astroSwitch = dz.devices('isDonker')
        local isDark = astroSwitch.state == 'On'
        local isLight = not(isDark)

        if dz.time.isNightTime and isDark  then
            astroSwitch.switchOn()
            dz.log('isDonker device is switched ON by dzVents scripts TRIGGER 1' , dz.LOG_DEBUG)
        elseif dz.time.isDayTime and isLight then
            astroSwitch.switchOff()
            dz.log('isDonker device is switched OFF by dzVents scripts TRIGGER 2' , dz.LOG_DEBUG)
        end

        dz.utils.dumpTable(dz.time)
        dz.log('dayTime in domoticz.time: ' .. tostring(dz.time.isDayTime) .. ' ; isDark in domoticz switch: ' .. tostring(isDark), dz.LOG_DEBUG )

    end
}
Hi Waaren,
This is indeed after the Domoticz update. I think this script still worked after that, but I'm not sure.
Unfortunately your proposal script doesn't work either. If I manually turn on the isDark switch, it stays on and won't turn off.
Yours sincerely,
Fred

Rasberry Pi 3B+ - Debian Buster - Domoticz 2022.2
RFLink - RFXCom - Zigbee (CC2531)
P1 Smart Meter - KaKu
Fredom
Posts: 140
Joined: Saturday 19 September 2020 21:02
Target OS: Raspberry Pi / ODroid
Domoticz version: 2022.2
Location: Krimpen aan den IJssel
Contact:

Re: dzVents script shows strange behavior

Post by Fredom »

waaren wrote: Thursday 10 June 2021 18:01
Fredom wrote: Thursday 10 June 2021 16:29 [Domoticz 2021-1 runs on a Rapberry pi 3b. Nothing has been changed in the script or in any other configuration.
A week ago this script suddenly showed this behavior
Was that before or after the update to 2021.1 ?

Can you have a look at this one ?

Code: Select all

return
{
    on =
    {
        timer =
        {
         'every 2 minutes',
        },
    },

    logging =
    {
        level = domoticz.LOG_DEBUG,
        marker = 'donker',
    },

    execute = function(dz)
        local astroSwitch = dz.devices('isDonker')
        local isDark = astroSwitch.state == 'On'
        local isLight = not(isDark)

        if dz.time.isNightTime and isDark  then
            astroSwitch.switchOn()
            dz.log('isDonker device is switched ON by dzVents scripts TRIGGER 1' , dz.LOG_DEBUG)
        elseif dz.time.isDayTime and isLight then
            astroSwitch.switchOff()
            dz.log('isDonker device is switched OFF by dzVents scripts TRIGGER 2' , dz.LOG_DEBUG)
        end

        dz.utils.dumpTable(dz.time)
        dz.log('dayTime in domoticz.time: ' .. tostring(dz.time.isDayTime) .. ' ; isDark in domoticz switch: ' .. tostring(isDark), dz.LOG_DEBUG )

    end
}
Hi Waaren,
I tested the script with a backup of domoticz 20.2 and there it works as intended.
It also works well when I switch the lines between daytime and nighttime.
So it has indeed to do with the new update of domoticz. Can this still be solved?
Yours sincerely,
Fred

Rasberry Pi 3B+ - Debian Buster - Domoticz 2022.2
RFLink - RFXCom - Zigbee (CC2531)
P1 Smart Meter - KaKu
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: dzVents script shows strange behavior

Post by waaren »

Fredom wrote: Thursday 10 June 2021 20:59 So it has indeed to do with the new update of domoticz. Can this still be solved?
Fixed in 2021.1 - build 13192
Please check this post for hotfix in stable.
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
Fredom
Posts: 140
Joined: Saturday 19 September 2020 21:02
Target OS: Raspberry Pi / ODroid
Domoticz version: 2022.2
Location: Krimpen aan den IJssel
Contact:

Re: dzVents script shows strange behavior

Post by Fredom »

waaren wrote: Thursday 10 June 2021 22:56
Fredom wrote: Thursday 10 June 2021 20:59 So it has indeed to do with the new update of domoticz. Can this still be solved?
Fixed in 2021.1 - build 13192
Please check this post for hotfix in stable.
Hi Waaren,
Thanks for the tip.
The problem is solved.
Yours sincerely,
Fred

Rasberry Pi 3B+ - Debian Buster - Domoticz 2022.2
RFLink - RFXCom - Zigbee (CC2531)
P1 Smart Meter - KaKu
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests