Problem with lux value (comparing two values)  [Solved]

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

Moderator: leecollings

Post Reply
Marcjeok
Posts: 37
Joined: Wednesday 01 November 2017 19:12
Target OS: -
Domoticz version:
Location: Netherlands
Contact:

Problem with lux value (comparing two values)

Post by Marcjeok »

Hi all,

I have a problem with my script to turn on the lights in my living room. It looks like there is a problem with comparing two values and I can't figure out why it's not working properly. If anyone can help me out would be highly appreciated.

Logging (lights should go on, but are not going on):
2019-10-12 17:58:53.967 Status: dzVents: Info: ------ Start internal script: Lights livingroom: Device: "Woonkamer sensor - Burglar (zwave)", Index: 179
2019-10-12 17:58:53.972 Status: dzVents: Info:
2019-10-12 17:58:53.972 ++++++++++++++++++++
2019-10-12 17:58:53.972 SCRIPT LIGHTS LIVINGROOM:
2019-10-12 17:58:53.972 ....................
2019-10-12 17:58:53.972 Daytime active, lux value: 0 vs. minimum value 17
2019-10-12 17:58:53.972 No action needed
2019-10-12 17:58:53.972 ++++++++++++++++++++
2019-10-12 17:58:53.972 Status: dzVents: Info: ------ Finished Lights livingroom

Or

2019-10-12 17:43:10.872 ++++++++++++++++++++
2019-10-12 17:43:10.872 SCRIPT LIGHTS LIVINGROOM:
2019-10-12 17:43:10.872 ....................
2019-10-12 17:43:10.872 Daytime active, lux value: 10 vs. minimum value 17
2019-10-12 17:43:10.872 No action needed
2019-10-12 17:43:10.872 ++++++++++++++++++++

Logging (lights should stay on, but are going off):
2019-10-12 18:03:04.508 Status: dzVents: Info: ------ Start internal script: Lights livingroom: Device: "WK - Albast lamp (Philips Hue)", Index: 119
2019-10-12 18:03:04.512 Status: dzVents: Info:
2019-10-12 18:03:04.512 ++++++++++++++++++++
2019-10-12 18:03:04.512 SCRIPT LIGHTS LIVINGROOM:
2019-10-12 18:03:04.512 ....................
2019-10-12 18:03:04.512 Daytime active, lux value: 0 vs. minimum value 17
2019-10-12 18:03:04.512 0 is higher then 17
2019-10-12 18:03:04.512 there is enough light, turn off the lights
2019-10-12 18:03:04.512 ++++++++++++++++++++
2019-10-12 18:03:04.512 Status: dzVents: Info: ------ Finished Lights livingroom


Sometimes this is going well, but sometimes it's going wrong like this moment. My family is considering to throw away the sensor and Domoticz, so please help me saving my home automation ;)

This is my script:

Code: Select all

--[[
SCRIPT DESCRIPTION:
This script turns on the lights in the livingroom at motion and depending on lux value. 
If there is no motion anymore, the lights wil be turned off automtically.

DEVICES USED:
Idx 179 = Woonkamer sensor - Burglar
Idx 181 = Woonkamer sensor - Lux
Idx 118 = WK - Staande lamp
Idx 119 = WK - Albast lamp          (primairy lamp for this script)
Idx 121 = WK - Plant spot lamp
]]--

--SET USER INPUT VARIABLES:
local IDLRM = 179
local IDLRL = 181
local IDLRS = 118
local IDLRA = 119           --primairy lamp for this script
local IDLRP = 121
local LOGGINGON = "Yes"     -- turn logging on or off (values: On = "Yes", Off = "No")
local SECLLOFF = 1200       --turn off the lights switch after xx seconds.
local LUXVALUE = 17         --Lux value to turn on/off the lights (lux value is lower then this setting will turn on the lights)

return {
	active = true,
	on = {
		devices = {
		    IDLRM,
		    IDLRL,
		    IDLRA,
		},
	},
	execute = function(domoticz, triggeredItem, info)

        --SET VARIABLES:
        local MOTION = domoticz.devices(IDLRM)
        local LUX = domoticz.devices(IDLRL).lux
        local LIGHTALBAST = domoticz.devices(IDLRA)
        local LIGHTSTANDING = domoticz.devices(IDLRS)
        local LIGHTPLANT = domoticz.devices(IDLRP)
        local LOGGING = "\n++++++++++++++++++++\n".."SCRIPT LIGHTS LIVINGROOM:".."\n...................."

        --EXECUTE SCRIPT
        if domoticz.time.matchesRule('at 06:30-22:00') or domoticz.time.matchesRule('at 06:30-23:59 on fri') or domoticz.time.matchesRule('at 06:30-23:59 on sat') then
            LOGGING = LOGGING .."\n".."Daytime active, lux value: "..LUX.." vs. minimum value "..LUXVALUE
            if (triggeredItem == IDLRM) then
                LOGGING = LOGGING .."\n".."There has been motion detected"
                if (LUX < LUXVALUE) and (LIGHTALBAST.state == "Off") then
                    LOGGING = LOGGING .."\n"..LUX .." is lower then "..LUXVALUE
                    LOGGING = LOGGING .."\n".."Its dark in here, turn on the lights"
                    LIGHTALBAST.switchOn()
                    LIGHTSTANDING.switchOn()
                    LIGHTPLANT.switchOn()
                else
                    LOGGING = LOGGING .."\n".."No action needed"
                end
            elseif (LUX > LUXVALUE) and (LIGHTALBAST.state == "On") or (LIGHTALBAST.state == "Set Color") then
                LOGGING = LOGGING .."\n"..LUX .." is higher then " ..LUXVALUE
                LOGGING = LOGGING .."\n".."there is enough light, turn off the lights"
                LIGHTALBAST.switchOff()
                LIGHTSTANDING.switchOff()
                LIGHTPLANT.switchOff()
            elseif (LUX < LUXVALUE) and (LIGHTALBAST.state == "On") or (LIGHTALBAST.state == "Set Color") then
                LOGGING = LOGGING .."\n".."Resetting timer, turn off the lights in "..SECLLOFF .." seconds"
                LIGHTALBAST.cancelQueuedCommands()
                LIGHTSTANDING.cancelQueuedCommands()
                LIGHTPLANT.cancelQueuedCommands()
                LIGHTALBAST.switchOff().afterSec(SECLLOFF)
                LIGHTSTANDING.switchOff().afterSec(SECLLOFF)
                LIGHTPLANT.switchOff().afterSec(SECLLOFF)
            else
                LOGGING = LOGGING .."\n".."No action needed"
            end
        else
            LOGGING = LOGGING .."\n".."No action needed"
        end
        
        LOGGING = LOGGING .."\n++++++++++++++++++++"
        
        --LOGGING:
        if (LOGGINGON == "Yes") then
            domoticz.log(LOGGING)
        end
	end
}
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Problem with lux value (comparing two values)

Post by waaren »

Marcjeok wrote: Saturday 12 October 2019 18:16 Hi all,

I have a problem with my script to turn on the lights in my living room. It looks like there is a problem with comparing two values and I can't figure out why it's not working properly. If anyone can help me out would be highly appreciated.
Try and change

Code: Select all

            elseif (LUX > LUXVALUE) and (LIGHTALBAST.state == "On") or (LIGHTALBAST.state == "Set Color") then
to

Code: Select all

            elseif (LUX > LUXVALUE) and ((LIGHTALBAST.state == "On") or (LIGHTALBAST.state == "Set Color")) then
And do the same on similar places.
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
Marcjeok
Posts: 37
Joined: Wednesday 01 November 2017 19:12
Target OS: -
Domoticz version:
Location: Netherlands
Contact:

Re: Problem with lux value (comparing two values)

Post by Marcjeok »

Thanks again for the help! I think this is fixing a part of the problem. Yesterday evening it seems to work better (resetting timer and or turn off the lights), but I need to see it works for some time before I can say that it has been fixed definitely. I will report this back later.

Unfortunately there is still a problem with turning on the lights. Looking at my log, it shows the following:
2019-10-13 11:00:33.209 Status: dzVents: Info: ------ Start internal script: Lights livingroom: Device: "Woonkamer sensor - Burglar (zwave)", Index: 179
2019-10-13 11:00:33.213 Status: dzVents: Info:
2019-10-13 11:00:33.213 ++++++++++++++++++++
2019-10-13 11:00:33.213 SCRIPT LIGHTS LIVINGROOM:
2019-10-13 11:00:33.213 ....................
2019-10-13 11:00:33.213 Daytime active, lux value: 130 vs. minimum value 17
2019-10-13 11:00:33.213 No action needed
2019-10-13 11:00:33.213 ++++++++++++++++++++
2019-10-13 11:00:33.213 Status: dzVents: Info: ------ Finished Lights livingroom


I would expect that the log also show the text 'There has been motion detected', but it isn't. So I think this part of the code has also a problem (IDLRM = index 179):

Code: Select all

if (triggeredItem == IDLRM) then
                LOGGING = LOGGING .."\n".."There has been motion detected"
                if (LUX < LUXVALUE) and (LIGHTALBAST.state == "Off") then
                    LOGGING = LOGGING .."\n"..LUX .." is lower then "..LUXVALUE
                    LOGGING = LOGGING .."\n".."Its dark in here, turn on the lights"
                    LIGHTALBAST.switchOn()
                    LIGHTSTANDING.switchOn()
                    LIGHTPLANT.switchOn()
                else
                    LOGGING = LOGGING .."\n".."No action needed"
                end
In an other script this works perfectly, so I'm confused now. Am I doing something wrong here?

Full script after the suggested changes:

Code: Select all

--[[
SCRIPT DESCRIPTION:
This script turns on the lights in the livingroom at motion and depending on lux value. 
If there is no motion anymore, the lights wil be turned off automtically.

DEVICES USED:
Idx 179 = Woonkamer sensor - Burglar
Idx 181 = Woonkamer sensor - Lux
Idx 118 = WK - Staande lamp
Idx 119 = WK - Albast lamp          (primairy lamp for this script)
Idx 121 = WK - Plant spot lamp
]]--

--SET USER INPUT VARIABLES:
local IDLRM = 179
local IDLRL = 181
local IDLRS = 118
local IDLRA = 119           --primairy lamp for this script
local IDLRP = 121
local LOGGINGON = "Yes"     -- turn logging on or off (values: On = "Yes", Off = "No")
local SECLLOFF = 1200       --turn off the lights switch after xx seconds.
local LUXVALUE = 17         --Lux value to turn on/off the lights (lux value is lower then this setting will turn on the lights)

return {
	active = true,
	on = {
		devices = {
		    IDLRM,
		    IDLRL,
		    IDLRA,
		},
	},
	execute = function(domoticz, triggeredItem, info)

        --SET VARIABLES:
        local MOTION = domoticz.devices(IDLRM)
        local LUX = domoticz.devices(IDLRL).lux
        local LIGHTALBAST = domoticz.devices(IDLRA)
        local LIGHTSTANDING = domoticz.devices(IDLRS)
        local LIGHTPLANT = domoticz.devices(IDLRP)
        local LOGGING = "\n++++++++++++++++++++\n".."SCRIPT LIGHTS LIVINGROOM:".."\n...................."

        --EXECUTE SCRIPT
        if domoticz.time.matchesRule('at 06:30-22:00') or domoticz.time.matchesRule('at 06:30-23:59 on fri') or domoticz.time.matchesRule('at 06:30-23:59 on sat') then
            LOGGING = LOGGING .."\n".."Daytime active, lux value: "..LUX.." vs. minimum value "..LUXVALUE
            if (triggeredItem == IDLRM) then
                LOGGING = LOGGING .."\n".."There has been motion detected"
                if (LUX < LUXVALUE) and (LIGHTALBAST.state == "Off") then
                    LOGGING = LOGGING .."\n"..LUX .." is lower then "..LUXVALUE
                    LOGGING = LOGGING .."\n".."Its dark in here, turn on the lights"
                    LIGHTALBAST.switchOn()
                    LIGHTSTANDING.switchOn()
                    LIGHTPLANT.switchOn()
                else
                    LOGGING = LOGGING .."\n".."No action needed"
                end
            elseif (LUX > LUXVALUE) and ((LIGHTALBAST.state == "On") or (LIGHTALBAST.state == "Set Color")) then
                LOGGING = LOGGING .."\n"..LUX .." is higher then " ..LUXVALUE
                LOGGING = LOGGING .."\n".."there is enough light, turn off the lights"
                LIGHTALBAST.switchOff()
                LIGHTSTANDING.switchOff()
                LIGHTPLANT.switchOff()
            elseif (LUX < LUXVALUE) and ((LIGHTALBAST.state == "On") or (LIGHTALBAST.state == "Set Color")) then
                LOGGING = LOGGING .."\n".."Resetting timer, turn off the lights in "..SECLLOFF .." seconds"
                LIGHTALBAST.cancelQueuedCommands()
                LIGHTSTANDING.cancelQueuedCommands()
                LIGHTPLANT.cancelQueuedCommands()
                LIGHTALBAST.switchOff().afterSec(SECLLOFF)
                LIGHTSTANDING.switchOff().afterSec(SECLLOFF)
                LIGHTPLANT.switchOff().afterSec(SECLLOFF)
            else
                LOGGING = LOGGING .."\n".."No action needed"
            end
        else
            LOGGING = LOGGING .."\n".."No action needed"
        end
        
        LOGGING = LOGGING .."\n++++++++++++++++++++"
        
        --LOGGING:
        if (LOGGINGON == "Yes") then
            domoticz.log(LOGGING)
        end
	end
}

Marcjeok
Posts: 37
Joined: Wednesday 01 November 2017 19:12
Target OS: -
Domoticz version:
Location: Netherlands
Contact:

Re: Problem with lux value (comparing two values)

Post by Marcjeok »

I changed the logging a bit, so it's more clear.

Logging:
2019-10-13 11:24:43.105 Status: dzVents: Info: Handling events for: "Woonkamer sensor - Burglar", value: "On"
2019-10-13 11:24:43.105 Status: dzVents: Info: ------ Start internal script: Lights livingroom: Device: "Woonkamer sensor - Burglar (zwave)", Index: 179
2019-10-13 11:24:43.108 Status: dzVents: Info:
2019-10-13 11:24:43.108 ++++++++++++++++++++
2019-10-13 11:24:43.108 SCRIPT LIGHTS LIVINGROOM:
2019-10-13 11:24:43.108 ....................
2019-10-13 11:24:43.108 Daytime active, lux value: 162 vs. minimum value 17
2019-10-13 11:24:43.108 No action needed (status is OK)
2019-10-13 11:24:43.108 ++++++++++++++++++++
2019-10-13 11:24:43.109 Status: dzVents: Info: ------ Finished Lights livingroom

Code:

Code: Select all

--[[
SCRIPT DESCRIPTION:
This script turns on the lights in the livingroom at motion and depending on lux value. 
If there is no motion anymore, the lights wil be turned off automtically.

DEVICES USED:
Idx 179 = Woonkamer sensor - Burglar
Idx 181 = Woonkamer sensor - Lux
Idx 118 = WK - Staande lamp
Idx 119 = WK - Albast lamp          (primairy lamp for this script)
Idx 121 = WK - Plant spot lamp
]]--

--SET USER INPUT VARIABLES:
local IDLRM = 179
local IDLRL = 181
local IDLRS = 118
local IDLRA = 119           --primairy lamp for this script
local IDLRP = 121
local LOGGINGON = "Yes"     -- turn logging on or off (values: On = "Yes", Off = "No")
local SECLLOFF = 1200       --turn off the lights switch after xx seconds.
local LUXVALUE = 17         --Lux value to turn on/off the lights (lux value is lower then this setting will turn on the lights)

return {
	active = true,
	on = {
		devices = {
		    IDLRM,
		    IDLRL,
		    IDLRA,
		},
	},
	execute = function(domoticz, triggeredItem, info)

        --SET VARIABLES:
        local MOTION = domoticz.devices(IDLRM)
        local LUX = domoticz.devices(IDLRL).lux
        local LIGHTALBAST = domoticz.devices(IDLRA)
        local LIGHTSTANDING = domoticz.devices(IDLRS)
        local LIGHTPLANT = domoticz.devices(IDLRP)
        local LOGGING = "\n++++++++++++++++++++\n".."SCRIPT LIGHTS LIVINGROOM:".."\n...................."

        --EXECUTE SCRIPT
        if domoticz.time.matchesRule('at 06:30-22:00') or domoticz.time.matchesRule('at 06:30-23:59 on fri') or domoticz.time.matchesRule('at 06:30-23:59 on sat') then
            LOGGING = LOGGING .."\n".."Daytime active, lux value: "..LUX.." vs. minimum value "..LUXVALUE
            if (triggeredItem == IDLRM) then
                LOGGING = LOGGING .."\n".."There has been motion detected"
                if (LUX < LUXVALUE) and (LIGHTALBAST.state == "Off") then
                    LOGGING = LOGGING .."\n"..LUX .." is lower then "..LUXVALUE
                    LOGGING = LOGGING .."\n".."Its dark in here, turn on the lights"
                    LIGHTALBAST.switchOn()
                    LIGHTSTANDING.switchOn()
                    LIGHTPLANT.switchOn()
                else
                    LOGGING = LOGGING .."\n".."No action needed (there is enough light)"
                end
            elseif (LUX > LUXVALUE) and ((LIGHTALBAST.state == "On") or (LIGHTALBAST.state == "Set Color")) then
                LOGGING = LOGGING .."\n"..LUX .." is higher then " ..LUXVALUE
                LOGGING = LOGGING .."\n".."there is enough light, turn off the lights"
                LIGHTALBAST.switchOff()
                LIGHTSTANDING.switchOff()
                LIGHTPLANT.switchOff()
            elseif (LUX < LUXVALUE) and ((LIGHTALBAST.state == "On") or (LIGHTALBAST.state == "Set Color")) then
                LOGGING = LOGGING .."\n".."Resetting timer, turn off the lights in "..SECLLOFF .." seconds"
                LIGHTALBAST.cancelQueuedCommands()
                LIGHTSTANDING.cancelQueuedCommands()
                LIGHTPLANT.cancelQueuedCommands()
                LIGHTALBAST.switchOff().afterSec(SECLLOFF)
                LIGHTSTANDING.switchOff().afterSec(SECLLOFF)
                LIGHTPLANT.switchOff().afterSec(SECLLOFF)
            else
                LOGGING = LOGGING .."\n".."No action needed (status is OK)"
            end
        else
            LOGGING = LOGGING .."\n".."No action needed (outside time window)"
        end
        
        LOGGING = LOGGING .."\n++++++++++++++++++++"
        
        --LOGGING:
        if (LOGGINGON == "Yes") then
            domoticz.log(LOGGING)
        end
	end
}

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

Re: Problem with lux value (comparing two values)  [Solved]

Post by waaren »

Marcjeok wrote: Sunday 13 October 2019 11:26 I changed the logging a bit, so it's more clear.

Code: Select all

if (triggeredItem == IDLRM) then
IDLRM is a number and triggeredItem is a device. A comparison between these will therefore never evaluate to true. You should change it to

Code: Select all

if (triggeredItem.idx == IDLRM) then
or t0

Code: Select all

if (triggeredItem == domoticz.devices(IDLRM)) then
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
Marcjeok
Posts: 37
Joined: Wednesday 01 November 2017 19:12
Target OS: -
Domoticz version:
Location: Netherlands
Contact:

Re: Problem with lux value (comparing two values)

Post by Marcjeok »

THANKS!!
I should know that, shame on me :oops:

I've change the setting and the log looks like it supposed to be:
2019-10-13 12:22:48.296 Status: dzVents: Info: Handling events for: "Woonkamer sensor - Burglar", value: "On"
2019-10-13 12:22:48.297 Status: dzVents: Info: ------ Start internal script: Lights livingroom: Device: "Woonkamer sensor - Burglar (zwave)", Index: 179
2019-10-13 12:22:48.302 Status: dzVents: Info:
2019-10-13 12:22:48.302 ++++++++++++++++++++
2019-10-13 12:22:48.302 SCRIPT LIGHTS LIVINGROOM:
2019-10-13 12:22:48.302 ....................
2019-10-13 12:22:48.302 Daytime active, lux value: 109 vs. minimum value 17
2019-10-13 12:22:48.302 There has been motion detected
2019-10-13 12:22:48.302 No action needed (there is enough light)
2019-10-13 12:22:48.302 ++++++++++++++++++++
2019-10-13 12:22:48.302 Status: dzVents: Info: ------ Finished Lights livingroom

I've marked this thread as Solved, I'm now pretty much convinced it will work.

My final script:

Code: Select all

--[[
SCRIPT DESCRIPTION:
This script turns on the lights in the livingroom at motion and depending on lux value. 
If there is no motion anymore, the lights wil be turned off automtically.

DEVICES USED:
Idx 179 = Woonkamer sensor - Burglar
Idx 181 = Woonkamer sensor - Lux
Idx 118 = WK - Staande lamp
Idx 119 = WK - Albast lamp          (primairy lamp for this script)
Idx 121 = WK - Plant spot lamp
]]--

--SET USER INPUT VARIABLES:
local IDLRM = 179
local IDLRL = 181
local IDLRS = 118
local IDLRA = 119           --primairy lamp for this script
local IDLRP = 121
local LOGGINGON = "Yes"     -- turn logging on or off (values: On = "Yes", Off = "No")
local SECLLOFF = 1200       --turn off the lights switch after xx seconds.
local LUXVALUE = 17         --Lux value to turn on/off the lights (lux value is lower then this setting will turn on the lights)

return {
	active = true,
	on = {
		devices = {
		    IDLRM,
		    IDLRL,
		    IDLRA,
		},
	},
	execute = function(domoticz, triggeredItem, info)

        --SET VARIABLES:
        local MOTION = domoticz.devices(IDLRM)
        local LUX = domoticz.devices(IDLRL).lux
        local LIGHTALBAST = domoticz.devices(IDLRA)
        local LIGHTSTANDING = domoticz.devices(IDLRS)
        local LIGHTPLANT = domoticz.devices(IDLRP)
        local LOGGING = "\n++++++++++++++++++++\n".."SCRIPT LIGHTS LIVINGROOM:".."\n...................."

        --EXECUTE SCRIPT
        if domoticz.time.matchesRule('at 06:30-22:00') or domoticz.time.matchesRule('at 06:30-23:59 on fri') or domoticz.time.matchesRule('at 06:30-23:59 on sat') then
            LOGGING = LOGGING .."\n".."Daytime active, lux value: "..LUX.." vs. minimum value "..LUXVALUE
            if (triggeredItem == MOTION) then
                LOGGING = LOGGING .."\n".."There has been motion detected"
                if (LUX < LUXVALUE) and (LIGHTALBAST.state == "Off") then
                    LOGGING = LOGGING .."\n"..LUX .." is lower then "..LUXVALUE
                    LOGGING = LOGGING .."\n".."Its dark in here, turn on the lights"
                    LIGHTALBAST.switchOn()
                    LIGHTSTANDING.switchOn()
                    LIGHTPLANT.switchOn()
                else
                    LOGGING = LOGGING .."\n".."No action needed (there is enough light)"
                end
            elseif (LUX > LUXVALUE) and ((LIGHTALBAST.state == "On") or (LIGHTALBAST.state == "Set Color")) then
                LOGGING = LOGGING .."\n"..LUX .." is higher then " ..LUXVALUE
                LOGGING = LOGGING .."\n".."there is enough light, turn off the lights"
                LIGHTALBAST.switchOff()
                LIGHTSTANDING.switchOff()
                LIGHTPLANT.switchOff()
            elseif (LUX < LUXVALUE) and ((LIGHTALBAST.state == "On") or (LIGHTALBAST.state == "Set Color")) then
                LOGGING = LOGGING .."\n".."Resetting timer, turn off the lights in "..SECLLOFF .." seconds"
                LIGHTALBAST.cancelQueuedCommands()
                LIGHTSTANDING.cancelQueuedCommands()
                LIGHTPLANT.cancelQueuedCommands()
                LIGHTALBAST.switchOff().afterSec(SECLLOFF)
                LIGHTSTANDING.switchOff().afterSec(SECLLOFF)
                LIGHTPLANT.switchOff().afterSec(SECLLOFF)
            else
                LOGGING = LOGGING .."\n".."No action needed (status is OK)"
            end
        else
            LOGGING = LOGGING .."\n".."No action needed (outside time window)"
        end
        
        LOGGING = LOGGING .."\n++++++++++++++++++++"
        
        --LOGGING:
        if (LOGGINGON == "Yes") then
            domoticz.log(LOGGING)
        end
	end
}

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest