timer: 'between aa and bb' not working

Moderator: leecollings

Post Reply
Aad3229
Posts: 18
Joined: Wednesday 07 January 2015 10:30
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: NL
Contact:

timer: 'between aa and bb' not working

Post by Aad3229 »

I am on beta 3.8873. I have this script:

Code: Select all

local ESP1_Lux = 111

return {
    on = {
          devices = {[ESP1_Lux] = {'between 06:00 and 16:00', 'every 3 minutes'}}
         },
    execute = function(domoticz)
        --domoticz.devices(ESP1_Lux).dump()
        domoticz.log(domoticz.devices(ESP1_Lux).lux)
        if domoticz.devices(ESP1_Lux).lux < 160 and
        (domoticz.time.hour >= 16 and domoticz.time.hour <= 23) and
        domoticz.variables('IsDarkLux').value == 0 then
            domoticz.devices(IsDonkerS).switchOn()
            domoticz.variables('IsDarkLux').set(1)
        end
        if domoticz.devices(ESP1_Lux).lux > 170 and
        (domoticz.time.hour >= 16 and domoticz.time.hour <= 23) and
            domoticz.variables('IsDarkLux').value == 1 then
            domoticz.devices(IsDonkerS).switchOff()
            domoticz.variables('IsDarkLux').set(0)
        end
        if domoticz.devices(ESP1_Lux).lux < 120 and
        (domoticz.time.hour >= 4 and domoticz.time.hour < 16) and
        domoticz.variables('IsDarkLux').value == 0 then
            domoticz.devices(IsDonkerS).switchOn()
            domoticz.variables('IsDarkLux').set(1)
        end
        if domoticz.devices(ESP1_Lux).lux > 130 and
        (domoticz.time.hour >= 4 and domoticz.time.hour < 16) and
        domoticz.variables('IsDarkLux').value == 1 then
            domoticz.devices(IsDonkerS).switchOff()
            domoticz.variables('IsDarkLux').set(0)
        end
    end
}
This cript is running every 3 minutes, still even now (it is 19:25 and way past 16:00) with this output:

Code: Select all

2018-02-05 19:21:21.975 dzVents: Info: Handling events for: "Lux sensor Esp", value: "0.00"
2018-02-05 19:21:21.976 dzVents: Info: ------ Start internal script: dzV_Check_Lux: Device: "Lux sensor Esp (Dummy)", Index: 111
2018-02-05 19:21:21.976 dzVents: Info: 0
2018-02-05 19:21:21.976 dzVents: Info: ------ Finished dzV_Check_Lux
2018-02-05 19:24:22.134 dzVents: Info: Handling events for: "Lux sensor Esp", value: "0.00"
2018-02-05 19:24:22.134 dzVents: Info: ------ Start internal script: dzV_Check_Lux: Device: "Lux sensor Esp (Dummy)", Index: 111
2018-02-05 19:24:22.134 dzVents: Info: 0
2018-02-05 19:24:22.135 dzVents: Info: ------ Finished dzV_Check_Lux
2018-02-05 19:27:22.306 dzVents: Info: Handling events for: "Lux sensor Esp", value: "0.00"
2018-02-05 19:27:22.306 dzVents: Info: ------ Start internal script: dzV_Check_Lux: Device: "Lux sensor Esp (Dummy)", Index: 111
2018-02-05 19:27:22.306 dzVents: Info: 0
2018-02-05 19:27:22.307 dzVents: Info: ------ Finished dzV_Check_Lux
It should only run between 06:00 and 16:00. Why doesn't it stop running at 16:00? What am I doing wrong here?
Domoticz V4.10717 on Synology, RFXtrx433E USB 433.92MHz Transceiver, 9 x KAKU Switch (APA3-1500R), 1 x ABST-604 KAKU Dusk sensor, MiLight iBox V6, OpenZwave USB-stick Aeon LabS, Zwave PIR, Zwave door sensors, Zwave powerplugs
Aad3229
Posts: 18
Joined: Wednesday 07 January 2015 10:30
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: NL
Contact:

Re: timer: 'between aa and bb' not working

Post by Aad3229 »

Solved, It should be :

'every 3 minutes between 06:00 and 16:00'

In my first post it runs: between 06:00 and 16:00 AND every 3 minutes
Domoticz V4.10717 on Synology, RFXtrx433E USB 433.92MHz Transceiver, 9 x KAKU Switch (APA3-1500R), 1 x ABST-604 KAKU Dusk sensor, MiLight iBox V6, OpenZwave USB-stick Aeon LabS, Zwave PIR, Zwave door sensors, Zwave powerplugs
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest