Page 1 of 1

forMin() problems

Posted: Tuesday 02 April 2019 12:27
by brommetje
Domoticz 4.10590

Just started with dzVents and try to convert a blocky script to dzVents and have some problems.

SwitchOn is working but after 3 minutes the switch should be switchOff that doesn't happen any idea?

Code: Select all

return {
        on = {
                devices = {
                  ['MOTION_Sensor_GANG'] = {'between 23:00 and 30 minutes after sunrise'}
                  }
       },

        execute = function(domoticz, device)
        if
                {(device.name == 'MOTION_Sensor_GANG' and device.state == 'On') and
                (device.name == 'IKEA Gang' and device.state == 'Off')}
        then
                domoticz.devices('IKEA Gang').switchOn().forMin(3)
                domoticz.log('Effe lamp in de gang aanzetten voor 3 minuten !!!')
        else
                domoticz.log('Effe niets doen !!!')
        end
       end
}

Re: forMin() problems

Posted: Tuesday 02 April 2019 12:48
by SweetPants
Try:

domoticz.devices('IKEA Gang').switchOn()
domoticz.devices('IKEA Gang').switchOff().afterMin(3)

Re: forMin() problems

Posted: Tuesday 02 April 2019 13:06
by waaren
brommetje wrote: Tuesday 02 April 2019 12:27 Just started with dzVents and try to convert a blocky script to dzVents and have some problems.
SwitchOn is working but after 3 minutes the switch should be switchOff that doesn't happen any idea?
This is a classic phenomenon in domoticz / dzVents. Described in the wiki as follows:

" Important note when using forXXX(): Let's say you have a light that is triggered by a motion detector. Currently the light is Off and you do this: light.switchOn().forMin(5). What happens inside Domoticz is this: at t0 Domoticz issues the switchOn() command and schedules a command to restore the current state at t5 which is Off. So at t5 it will switch the light off.

If, however, before the scheduled switchOff() happens at t5, new motion is detected and you send this command again at t2 then something unpredictable may seem to happen: the light is never turned off! This is what happens:

At t2 Domoticz receives the switchOn().forMin(5) command again. It sees a scheduled command at t5 and deletes that command (it is within the new interval). Then Domoticz performs the (unnecessary, it's already on) switchOn() command. Then it checks the current state of the light which is On!! and schedules a command to return to that state at t2+5=t7. So, at t7 the light is switched on again. And there you have it: the light is not switched off and never will be because future commands will always be checked against the current on-state.

That's just how it works and you will have to deal with it in your script"

Can you try this ?

Code: Select all

return {
        on = {
                devices =     {
                  ['MOTION_Sensor_GANG'] = {'between 23:00 and 30 minutes after sunrise'}
                            }
       },

        execute = function(domoticz, device)
            
            if device.state == 'On' then
                local ganglamp = domoticz.devices('IKEA Gang')
                ganglamp.switchOn().checkFirst()
                ganglamp.cancelQueuedCommands()
                ganglamp.switchOff().afterMin(3)
                domoticz.log('Effe lamp in de gang aanzetten voor (weer) 3 minuten !!!')
            else
                domoticz.log('Effe niets doen !!!')
            end
       end
}

Re: forMin() problems

Posted: Tuesday 02 April 2019 19:51
by brommetje
Hi @sweetpants I replaced my line ForMin(3) for your two lines ...SwitchOn() and .switchOff().afterMin(3) now it works.

Hi @waaren thanks for your explanation I tried your script but nothing happens ..checkFirst() and .cancelQueuedCommands() is not working, maybe it has to do with my IKEA light is a TradFri one, so maybe with this combination the command doesn't work.

It is working now with afterMin(3)

Thanks a lot.

Re: forMin() problems

Posted: Wednesday 03 April 2019 1:23
by waaren
brommetje wrote: Tuesday 02 April 2019 19:51 Hi @sweetpants I replaced my line ForMin(3) for your two lines ...SwitchOn() and .switchOff().afterMin(3) now it works.

Hi @waaren thanks for your explanation I tried your script but nothing happens ..checkFirst() and .cancelQueuedCommands() is not working, maybe it has to do with my IKEA light is a TradFri one, so maybe with this combination the command doesn't work.

It is working now with afterMin(3)

Thanks a lot.
@brommetje,
issue with only using switchOn() and switchOff().afterMin(3) is that it will not deliver the expected results when the Motion Sensor kicks in more than once.
  • Scenario:
    • 23:05 Motion Sensor senses motion and change state to On (And it is between 23:00 and 30 minutes after sunrise.)
      IKEA Gang will be switched On and switch Off command is scheduled for 3 minutes from now. Lets call this scheduled time t2
    • 23:06 Motion Sensor does no longer sense motion and change state to Off
      No action "Effe niets doen !!!"
    • 23:07 Motion Sensor senses motion and change state to On (And it is between 23:00 and 30 minutes after sunrise.)
      IKEA Gang will be switched On and switch Off command is scheduled for 3 minutes from now. Lets call this scheduled time t3
    • 23:08 It is now t2; the scheduled switch Off will kick in and switches the light Off while there is still motion and time is still between 23:00 and 30 minutes after sunrise
    • 23:09 WAF drops 2 points. She switches the IKEA light manually to On
    • 23:10 It is now t3; the scheduled switch Off will kick in and switches the light Off while there is still motion and time is still between 23:00 and 30 minutes after sunrise.
      WAF drops more points than you earned last week...
The checkFirst() and cancelQueuedCommands() methods should work for any light.
Could it be that the condition " between 23:00 and 30 minutes after sunrise" was not met ?

I switched on debug logging in attached script. Can you please execute it and show the relevant logfiles ?
That might help in identifying why you see different behavior than expected.

Thanks !

Code: Select all

return {
        on = {
                devices =        {
                                    ['MOTION_Sensor_GANG'] = {'between 23:00 and 30 minutes after sunrise'}
                                }
            },

        logging =    {
                        level       = domoticz.LOG_DEBUG,  -- switch to LOG_ERROR when satisfied with the result
                        marker      = 'PIR issue'
                    },
       
        execute = function(domoticz, device)
            
            if device.state == 'On' then
                local ganglamp = domoticz.devices('IKEA Gang')
                ganglamp.switchOn().checkFirst()
                ganglamp.cancelQueuedCommands()
                ganglamp.switchOff().afterMin(3)
                domoticz.log('Effe lamp in de gang aanzetten voor (weer) 3 minuten !!!',domoticz.LOG_FORCE) 
            else
                domoticz.log('Effe niets doen !!!',domoticz.LOG_FORCE)
            end
       end
}

Re: forMin() problems

Posted: Wednesday 03 April 2019 18:39
by brommetje
Hi @waaren I will test ASAP but this evening because of visit to the hospital I do not have the time. And of course if I test I change the starting time of the script :roll:

Re: forMin() problems

Posted: Friday 05 April 2019 13:55
by brommetje
Hi @waaren I copied your script and this is the output the only problem is that the Light is not switch ON ???

Code: Select all

2019-04-05 13:31:00.428  Status: dzVents: Info:  ------ Start external script: Poortdeur_open_v2.lua:, trigger: every minute
2019-04-05 13:31:00.466  Status: dzVents: Info:  ------ Finished Poortdeur_open_v2.lua
2019-04-05 13:32:00.440  Status: dzVents: Info:  ------ Start external script: Poortdeur_open_v2.lua:, trigger: every minute
2019-04-05 13:32:00.458  Status: dzVents: Info:  ------ Finished Poortdeur_open_v2.lua
2019-04-05 13:32:34.802  Status: dzVents: Info:  Handling events for: "MOTION_Sensor_GANG", value: "On"
2019-04-05 13:32:34.803  Status: dzVents: Info:  PIR issue: ------ Start external script: LightOn_WC_GANG_v7.lua: Device: "MOTION_Sensor_GANG (AeonGen5-ZWave)", Index: 375
2019-04-05 13:32:34.804  Status: dzVents: Debug: PIR issue: Processing device-adapter for IKEA Gang: Switch device adapter
2019-04-05 13:32:34.804  Status: dzVents: Debug: PIR issue: Constructed timed-command: On
2019-04-05 13:32:34.804  Status: dzVents: Debug: PIR issue: Constructed timed-command: On
2019-04-05 13:32:34.804  Status: dzVents: Debug: PIR issue: Constructed timed-command: Off
2019-04-05 13:32:34.804  Status: dzVents: Debug: PIR issue: Constructed timed-command: Off AFTER 180 SECONDS
2019-04-05 13:32:34.805  Status: dzVents: !Info: PIR issue: Effe lamp in de gang aanzetten voor (weer) 3 minuten !!!
2019-04-05 13:32:34.805  Status: dzVents: Info:  PIR issue: ------ Finished LightOn_WC_GANG_v7.lua
2019-04-05 13:32:34.806  Status: EventSystem: Script event triggered: /home/pi/domoticz/dzVents/runtime/dzVents.lua
2019-04-05 13:33:06.018  Status: dzVents: Info:  Handling events for: "MOTION_Sensor_GANG", value: "Off"
2019-04-05 13:33:06.019  Status: dzVents: Info:  PIR issue: ------ Start external script: LightOn_WC_GANG_v7.lua: Device: "MOTION_Sensor_GANG (AeonGen5-ZWave)", Index: 375
2019-04-05 13:33:06.019  Status: dzVents: !Info: PIR issue: Effe niets doen !!!
2019-04-05 13:33:06.019  Status: dzVents: Info:  PIR issue: ------ Finished LightOn_WC_GANG_v7.lua
So I change the script just by adding a remark for the line ..checkFirst() and .. cancelQueedCommands and then the light is switched ON

Code: Select all

 if device.state == 'On' then
                local ganglamp = domoticz.devices('IKEA Gang')
                -- ganglamp.switchOn().checkFirst()
                ganglamp.switchOn()
                -- ganglamp.cancelQueuedCommands()
                ganglamp.switchOff().afterMin(3)

Code: Select all

2019-04-05 13:41:12.795  Status: dzVents: Info:  Handling events for: "MOTION_Sensor_GANG", value: "On"
2019-04-05 13:41:12.795  Status: dzVents: Info:  PIR issue: ------ Start external script: LightOn_WC_GANG_v7.lua: Device: "MOTION_Sensor_GANG (AeonGen5-ZWave)", Index: 375
2019-04-05 13:41:12.796  Status: dzVents: Debug: PIR issue: Processing device-adapter for IKEA Gang: Switch device adapter
2019-04-05 13:41:12.797  Status: dzVents: Debug: PIR issue: Constructed timed-command: On
2019-04-05 13:41:12.797  Status: dzVents: Debug: PIR issue: Constructed timed-command: Off
2019-04-05 13:41:12.797  Status: dzVents: Debug: PIR issue: Constructed timed-command: Off AFTER 180 SECONDS
2019-04-05 13:41:12.797  Status: dzVents: !Info: PIR issue: Effe lamp in de gang aanzetten voor (weer) 3 minuten !!!
2019-04-05 13:41:12.797  Status: dzVents: Info:  PIR issue: ------ Finished LightOn_WC_GANG_v7.lua
2019-04-05 13:41:12.797  Status: dzVents: Info:  ------ Start external script: MotionGang_v1.lua: Device: "MOTION_Sensor_GANG (AeonGen5-ZWave)", Index: 375
2019-04-05 13:41:12.798  Status: dzVents: Info:  IKEA Gang motion detected !!!
2019-04-05 13:41:12.798  Status: dzVents: Info:  ------ Finished MotionGang_v1.lua
2019-04-05 13:41:12.799  Status: EventSystem: Script event triggered: /home/pi/domoticz/dzVents/runtime/dzVents.lua
2019-04-05 13:41:43.921  Status: dzVents: Info:  Handling events for: "MOTION_Sensor_GANG", value: "Off"
2019-04-05 13:41:43.921  Status: dzVents: Info:  PIR issue: ------ Start external script: LightOn_WC_GANG_v7.lua: Device: "MOTION_Sensor_GANG (AeonGen5-ZWave)", Index: 375
2019-04-05 13:41:43.921  Status: dzVents: !Info: PIR issue: Effe niets doen !!!
2019-04-05 13:41:43.921  Status: dzVents: Info:  PIR issue: ------ Finished LightOn_WC_GANG_v7.lua
the only differents I see is that when it doesn't work you have two time the line ... PIR issue: Constructed timed-command: On

Re: forMin() problems

Posted: Friday 05 April 2019 14:40
by waaren
Thx for testing !
Can you please add the line

Code: Select all

ganglamp.dump() 
below the line

Code: Select all

local ganglamp = domoticz.devices('IKEA Gang')
and report the complete output ?
That might help me in identifying a root cause.

Thx !

Re: forMin() problems

Posted: Friday 05 April 2019 14:58
by brommetje
Added the line, light is not switched ON and did also an update to the latest beta v4.10602

Code: Select all

2019-04-05 14:55:43.816  Status: dzVents: Info:  PIR issue: ------ Start external script: LightOn_WC_GANG_v7.lua: Device: "MOTION_Sensor_GANG (AeonGen5-ZWave)", Index: 375
2019-04-05 14:55:43.818  Status: dzVents: Debug: PIR issue: Processing device-adapter for IKEA Gang: Switch device adapter
2019-04-05 14:55:43.818  Status: dzVents: > deviceType: Light/Switch
2019-04-05 14:55:43.818  Status: dzVents: > updateSetPoint()
2019-04-05 14:55:43.818  Status: dzVents: > updateGas()
2019-04-05 14:55:43.818  Status: dzVents: > updateWind()
2019-04-05 14:55:43.818  Status: dzVents: > usedByCamera: false
2019-04-05 14:55:43.818  Status: dzVents: > updateAirQuality()
2019-04-05 14:55:43.818  Status: dzVents: > bState: false
2019-04-05 14:55:43.818  Status: dzVents: > updateP1()
2019-04-05 14:55:43.818  Status: dzVents: > deviceId: 65540
2019-04-05 14:55:43.818  Status: dzVents: > updateUV()
2019-04-05 14:55:43.818  Status: dzVents: > switchSelector()
2019-04-05 14:55:43.818  Status: dzVents: > toggleSwitch()
2019-04-05 14:55:43.818  Status: dzVents: > dimTo()
2019-04-05 14:55:43.818  Status: dzVents: > open()
2019-04-05 14:55:43.818  Status: dzVents: > setDescription()
2019-04-05 14:55:43.818  Status: dzVents: > close()
2019-04-05 14:55:43.818  Status: dzVents: > protected: false
2019-04-05 14:55:43.818  Status: dzVents: > kodiPause()
2019-04-05 14:55:43.818  Status: dzVents: > kodiStop()
2019-04-05 14:55:43.818  Status: dzVents: > hardwareTypeValue: 94
2019-04-05 14:55:43.818  Status: dzVents: > level: 24
2019-04-05 14:55:43.818  Status: dzVents: > onkyoEISCPCommand()
2019-04-05 14:55:43.818  Status: dzVents: > kodiExecuteAddOn()
2019-04-05 14:55:43.818  Status: dzVents: > _adapters:
2019-04-05 14:55:43.819  Status: dzVents: >     1: Switch device adapter
2019-04-05 14:55:43.819  Status: dzVents: > kodiPlayFavorites()
2019-04-05 14:55:43.819  Status: dzVents: > updateRadiation()
2019-04-05 14:55:43.819  Status: dzVents: > changed: false
2019-04-05 14:55:43.819  Status: dzVents: > _state: Off
2019-04-05 14:55:43.819  Status: dzVents: > updateCustomSensor()
2019-04-05 14:55:43.819  Status: dzVents: > isTimer: false
2019-04-05 14:55:43.819  Status: dzVents: > setState()
2019-04-05 14:55:43.819  Status: dzVents: > setHotWater()
2019-04-05 14:55:43.819  Status: dzVents: > updatePercentage()
2019-04-05 14:55:43.819  Status: dzVents: > kodiSetVolume()
2019-04-05 14:55:43.819  Status: dzVents: > updateCounter()
2019-04-05 14:55:43.819  Status: dzVents: > pause()
2019-04-05 14:55:43.819  Status: dzVents: > switchOn()
2019-04-05 14:55:43.819  Status: dzVents: > switchTypeValue: 7
2019-04-05 14:55:43.819  Status: dzVents: > startPlaylist()
2019-04-05 14:55:43.819  Status: dzVents: > kodiSwitchOff()
2019-04-05 14:55:43.819  Status: dzVents: > updateMode()
2019-04-05 14:55:43.819  Status: dzVents: > isVariable: false
2019-04-05 14:55:43.819  Status: dzVents: > _data:
2019-04-05 14:55:43.819  Status: dzVents: >     changed: false
2019-04-05 14:55:43.819  Status: dzVents: >     deviceType: Light/Switch
2019-04-05 14:55:43.819  Status: dzVents: >     switchTypeValue: 7
2019-04-05 14:55:43.819  Status: dzVents: >     batteryLevel: 255
2019-04-05 14:55:43.819  Status: dzVents: >     rawData:
2019-04-05 14:55:43.819  Status: dzVents: >         1: 24
2019-04-05 14:55:43.819  Status: dzVents: >     lastLevel: 24
2019-04-05 14:55:43.820  Status: dzVents: >     timedOut: false
2019-04-05 14:55:43.820  Status: dzVents: >     subType: Switch
2019-04-05 14:55:43.820  Status: dzVents: >     description:
2019-04-05 14:55:43.820  Status: dzVents: >     deviceID: 65540
2019-04-05 14:55:43.820  Status: dzVents: >     name: IKEA Gang
2019-04-05 14:55:43.820  Status: dzVents: >     id: 2297
2019-04-05 14:55:43.820  Status: dzVents: >     lastUpdate: 2019-04-05 14:44:06
2019-04-05 14:55:43.820  Status: dzVents: >     baseType: device
2019-04-05 14:55:43.820  Status: dzVents: >     data:
2019-04-05 14:55:43.820  Status: dzVents: >         _state: Off
2019-04-05 14:55:43.820  Status: dzVents: >         hardwareID: 22
2019-04-05 14:55:43.820  Status: dzVents: >         icon: dimmer
2019-04-05 14:55:43.820  Status: dzVents: >         protected: false
2019-04-05 14:55:43.820  Status: dzVents: >         hardwareType: IKEA Tradfri
2019-04-05 14:55:43.820  Status: dzVents: >         levelVal: 24
2019-04-05 14:55:43.820  Status: dzVents: >         hardwareTypeValue: 94
2019-04-05 14:55:43.820  Status: dzVents: >         usedByCamera: false
2019-04-05 14:55:43.820  Status: dzVents: >         _nValue: 0
2019-04-05 14:55:43.820  Status: dzVents: >         hardwareName: IKEA Tradfri
2019-04-05 14:55:43.820  Status: dzVents: >         unit: 3
2019-04-05 14:55:43.820  Status: dzVents: >         maxDimLevel: 100
2019-04-05 14:55:43.820  Status: dzVents: >     switchType: Dimmer
2019-04-05 14:55:43.820  Status: dzVents: >     signalLevel: 12
2019-04-05 14:55:43.821  Status: dzVents: > updateRain()
2019-04-05 14:55:43.821  Status: dzVents: > updateWaterflow()
2019-04-05 14:55:43.821  Status: dzVents: > updateBarometer()
2019-04-05 14:55:43.821  Status: dzVents: > updateAlertSensor()
2019-04-05 14:55:43.821  Status: dzVents: > updateYouless()
2019-04-05 14:55:43.821  Status: dzVents: > name: IKEA Gang
2019-04-05 14:55:43.821  Status: dzVents: > updateVoltage()
2019-04-05 14:55:43.821  Status: dzVents: > isDevice: true
2019-04-05 14:55:43.821  Status: dzVents: > updateVisibility()
2019-04-05 14:55:43.821  Status: dzVents: > playFavorites()
2019-04-05 14:55:43.821  Status: dzVents: > updateTempHumBaro()
2019-04-05 14:55:43.821  Status: dzVents: > isScene: false
2019-04-05 14:55:43.821  Status: dzVents: > hardwareName: IKEA Tradfri
2019-04-05 14:55:43.821  Status: dzVents: > setRGB()
2019-04-05 14:55:43.821  Status: dzVents: > updateTempHum()
2019-04-05 14:55:43.821  Status: dzVents: > cancelQueuedCommands()
2019-04-05 14:55:43.821  Status: dzVents: > updateTempBaro()
2019-04-05 14:55:43.821  Status: dzVents: > dump()
2019-04-05 14:55:43.821  Status: dzVents: > isHTTPResponse: false
2019-04-05 14:55:43.821  Status: dzVents: > updateTemperature()
2019-04-05 14:55:43.821  Status: dzVents: > updateDistance()
2019-04-05 14:55:43.821  Status: dzVents: > updateSoilMoisture()
2019-04-05 14:55:43.821  Status: dzVents: > kodiPlayPlaylist()
2019-04-05 14:55:43.821  Status: dzVents: > state: Off
2019-04-05 14:55:43.821  Status: dzVents: > maxDimLevel: 100
2019-04-05 14:55:43.821  Status: dzVents: > armHome()
2019-04-05 14:55:43.821  Status: dzVents: > isSecurity: false
2019-04-05 14:55:43.821  Status: dzVents: > updateWeight()
2019-04-05 14:55:43.821  Status: dzVents: > armAway()
2019-04-05 14:55:43.821  Status: dzVents: > idx: 2297
2019-04-05 14:55:43.821  Status: dzVents: > updateWetness()
2019-04-05 14:55:43.822  Status: dzVents: > description:
2019-04-05 14:55:43.822  Status: dzVents: > switchOff()
2019-04-05 14:55:43.822  Status: dzVents: > disarm()
2019-04-05 14:55:43.822  Status: dzVents: > increaseBrightness()
2019-04-05 14:55:43.822  Status: dzVents: > signalLevel: 12
2019-04-05 14:55:43.822  Status: dzVents: > icon: dimmer
2019-04-05 14:55:43.822  Status: dzVents: > timedOut: false
2019-04-05 14:55:43.822  Status: dzVents: > hardwareType: IKEA Tradfri
2019-04-05 14:55:43.822  Status: dzVents: > setColorBrightness()
2019-04-05 14:55:43.822  Status: dzVents: > setColor()
2019-04-05 14:55:43.822  Status: dzVents: > setHue()
2019-04-05 14:55:43.822  Status: dzVents: > lastUpdate:
2019-04-05 14:55:43.822  Status: dzVents: >     millisecondsAgo: 697743
2019-04-05 14:55:43.822  Status: dzVents: >     secondsSinceMidnight: 53046
2019-04-05 14:55:43.822  Status: dzVents: >     milliSeconds: 0
2019-04-05 14:55:43.822  Status: dzVents: >     hour: 14
2019-04-05 14:55:43.822  Status: dzVents: >     matchesRule()
2019-04-05 14:55:43.822  Status: dzVents: >     isdst: true
2019-04-05 14:55:43.822  Status: dzVents: >     seconds: 6
2019-04-05 14:55:43.822  Status: dzVents: >     ruleIsBeforeCivilTwilightStart()
2019-04-05 14:55:43.822  Status: dzVents: >     secondsAgo: 697
2019-04-05 14:55:43.822  Status: dzVents: >     minutes: 44
2019-04-05 14:55:43.822  Status: dzVents: >     ruleIsOnDay()
2019-04-05 14:55:43.822  Status: dzVents: >     hoursAgo: 0
2019-04-05 14:55:43.822  Status: dzVents: >     isToday: true
2019-04-05 14:55:43.822  Status: dzVents: >     daysAgo: 0
2019-04-05 14:55:43.822  Status: dzVents: >     dDate: 1554468246
2019-04-05 14:55:43.822  Status: dzVents: >     ruleMatchesBetweenRange()
2019-04-05 14:55:43.822  Status: dzVents: >     month: 4
2019-04-05 14:55:43.823  Status: dzVents: >     ruleMatchesTimeRange()
2019-04-05 14:55:43.823  Status: dzVents: >     ruleMatchesTime()
2019-04-05 14:55:43.823  Status: dzVents: >     ruleMatchesHourSpecification()
2019-04-05 14:55:43.823  Status: dzVents: >     ruleIsBeforeSunrise()
2019-04-05 14:55:43.823  Status: dzVents: >     ruleMatchesMinuteSpecification()
2019-04-05 14:55:43.823  Status: dzVents: >     week: 14
2019-04-05 14:55:43.823  Status: dzVents: >     ruleIsAtDayTime()
2019-04-05 14:55:43.823  Status: dzVents: >     ruleIsAtNight()
2019-04-05 14:55:43.823  Status: dzVents: >     isUTC: false
2019-04-05 14:55:43.823  Status: dzVents: >     ruleIsAtCivilDayTime()
2019-04-05 14:55:43.823  Status: dzVents: >     ruleIsAfterCivilTwilightStart()
2019-04-05 14:55:43.823  Status: dzVents: >     ruleIsAfterSunset()
2019-04-05 14:55:43.823  Status: dzVents: >     ruleIsBeforeSunset()
2019-04-05 14:55:43.823  Status: dzVents: >     ruleIsAtSunset()
2019-04-05 14:55:43.823  Status: dzVents: >     minutesAgo: 11
2019-04-05 14:55:43.823  Status: dzVents: >     ruleIsAtCivilNight()
2019-04-05 14:55:43.823  Status: dzVents: >     msAgo: 697743
2019-04-05 14:55:43.823  Status: dzVents: >     year: 2019
2019-04-05 14:55:43.823  Status: dzVents: >     sec: 6
2019-04-05 14:55:43.823  Status: dzVents: >     ruleIsBeforeCivilTwilightEnd()
2019-04-05 14:55:43.823  Status: dzVents: >     compare()
2019-04-05 14:55:43.823  Status: dzVents: >     ruleIsAtSunrise()
2019-04-05 14:55:43.823  Status: dzVents: >     ruleIsAtCivilTwilightStart()
2019-04-05 14:55:43.823  Status: dzVents: >     raw: 2019-04-05 14:44:06
2019-04-05 14:55:43.823  Status: dzVents: >     day: 5
2019-04-05 14:55:43.823  Status: dzVents: >     rawTime: 14:44:06
2019-04-05 14:55:43.823  Status: dzVents: >     milliseconds: 0
2019-04-05 14:55:43.823  Status: dzVents: >     min: 44
2019-04-05 14:55:43.823  Status: dzVents: >     ruleIsOnDate()
2019-04-05 14:55:43.823  Status: dzVents: >     ruleIsInWeek()
2019-04-05 14:55:43.824  Status: dzVents: >     ruleIsAfterCivilTwilightEnd()
2019-04-05 14:55:43.824  Status: dzVents: >     yday: 95
2019-04-05 14:55:43.824  Status: dzVents: >     ruleIsAtCivilTwilightEnd()
2019-04-05 14:55:43.824  Status: dzVents: >     current:
2019-04-05 14:55:43.824  Status: dzVents: >         sec: 43
2019-04-05 14:55:43.824  Status: dzVents: >         wday: 6
2019-04-05 14:55:43.824  Status: dzVents: >         min: 55
2019-04-05 14:55:43.824  Status: dzVents: >         hour: 14
2019-04-05 14:55:43.824  Status: dzVents: >         month: 4
2019-04-05 14:55:43.824  Status: dzVents: >         year: 2019
2019-04-05 14:55:43.824  Status: dzVents: >         isdst: true
2019-04-05 14:55:43.824  Status: dzVents: >         yday: 95
2019-04-05 14:55:43.824  Status: dzVents: >         day: 5
2019-04-05 14:55:43.824  Status: dzVents: >     dayAbbrOfWeek: fri
2019-04-05 14:55:43.824  Status: dzVents: >     utils:
2019-04-05 14:55:43.824  Status: dzVents: >         LOG_FORCE: 0.5
2019-04-05 14:55:43.824  Status: dzVents: >         fromJSON()
2019-04-05 14:55:43.824  Status: dzVents: >         urlDecode()
2019-04-05 14:55:43.824  Status: dzVents: >         print()
2019-04-05 14:55:43.824  Status: dzVents: >         LOG_INFO: 3
2019-04-05 14:55:43.824  Status: dzVents: >         LOG_ERROR: 1
2019-04-05 14:55:43.824  Status: dzVents: >         rgbToHSB()
2019-04-05 14:55:43.824  Status: dzVents: >         osExecute()
2019-04-05 14:55:43.824  Status: dzVents: >         fileExists()
2019-04-05 14:55:43.824  Status: dzVents: >         dumpTable()
2019-04-05 14:55:43.824  Status: dzVents: >         urlEncode()
2019-04-05 14:55:43.824  Status: dzVents: >         hsbToRGB()
2019-04-05 14:55:43.824  Status: dzVents: >         LOG_MODULE_EXEC_INFO: 2
2019-04-05 14:55:43.824  Status: dzVents: >         log()
2019-04-05 14:55:43.824  Status: dzVents: >         DZVERSION: 2.4.17
2019-04-05 14:55:43.824  Status: dzVents: >         toJSON()
2019-04-05 14:55:43.825  Status: dzVents: >         LOG_DEBUG: 4
2019-04-05 14:55:43.825  Status: dzVents: >     wday: 6
2019-04-05 14:55:43.825  Status: dzVents: >     ruleIsAfterSunrise()
2019-04-05 14:55:43.825  Status: dzVents: >     getISO()
2019-04-05 14:55:43.825  Status: dzVents: >     rawDate: 2019-04-05
2019-04-05 14:55:43.825  Status: dzVents: > setHex()
2019-04-05 14:55:43.825  Status: dzVents: > isGroup: false
2019-04-05 14:55:43.825  Status: dzVents: > switchType: Dimmer
2019-04-05 14:55:43.825  Status: dzVents: > volumeUp()
2019-04-05 14:55:43.825  Status: dzVents: > volumeDown()
2019-04-05 14:55:43.825  Status: dzVents: > setWhiteMode()
2019-04-05 14:55:43.825  Status: dzVents: > stop()
2019-04-05 14:55:43.825  Status: dzVents: > setKelvin()
2019-04-05 14:55:43.825  Status: dzVents: > hardwareID: 22
2019-04-05 14:55:43.825  Status: dzVents: > rawData:
2019-04-05 14:55:43.825  Status: dzVents: >     1: 24
2019-04-05 14:55:43.825  Status: dzVents: > lastLevel: 24
2019-04-05 14:55:43.825  Status: dzVents: > setIcon()
2019-04-05 14:55:43.825  Status: dzVents: > levelVal: 24
2019-04-05 14:55:43.825  Status: dzVents: > decreaseBrightness()
2019-04-05 14:55:43.825  Status: dzVents: > updateText()
2019-04-05 14:55:43.825  Status: dzVents: > setDiscoMode()
2019-04-05 14:55:43.825  Status: dzVents: > _nValue: 0
2019-04-05 14:55:43.825  Status: dzVents: > updatePressure()
2019-04-05 14:55:43.825  Status: dzVents: > setVolume()
2019-04-05 14:55:43.825  Status: dzVents: > deviceSubType: Switch
2019-04-05 14:55:43.825  Status: dzVents: > id: 2297
2019-04-05 14:55:43.825  Status: dzVents: > active: false
2019-04-05 14:55:43.825  Status: dzVents: > getColor()
2019-04-05 14:55:43.825  Status: dzVents: > play()
2019-04-05 14:55:43.825  Status: dzVents: > unit: 3
2019-04-05 14:55:43.825  Status: dzVents: > updateHumidity()
2019-04-05 14:55:43.826  Status: dzVents: > update()
2019-04-05 14:55:43.826  Status: dzVents: > updateSoundLevel()
2019-04-05 14:55:43.826  Status: dzVents: > hardwareId: 22
2019-04-05 14:55:43.826  Status: dzVents: > setValues()
2019-04-05 14:55:43.826  Status: dzVents: > updateElectricity()
2019-04-05 14:55:43.826  Status: dzVents: > kodiPlay()
2019-04-05 14:55:43.826  Status: dzVents: > baseType: device
2019-04-05 14:55:43.826  Status: dzVents: > updateLux()
2019-04-05 14:55:43.826  Status: dzVents: > nValue: 0
2019-04-05 14:55:43.826  Status: dzVents: > setNightMode()
2019-04-05 14:55:43.826  Status: dzVents: Debug: PIR issue: Constructed timed-command: On
2019-04-05 14:55:43.826  Status: dzVents: Debug: PIR issue: Constructed timed-command: On
2019-04-05 14:55:43.826  Status: dzVents: Debug: PIR issue: Constructed timed-command: Off
2019-04-05 14:55:43.826  Status: dzVents: Debug: PIR issue: Constructed timed-command: Off AFTER 180 SECONDS
2019-04-05 14:55:43.826  Status: dzVents: !Info: PIR issue: Effe lamp in de gang aanzetten voor (weer) 3 minuten !!!
2019-04-05 14:55:43.826  Status: dzVents: Info:  PIR issue: ------ Finished LightOn_WC_GANG_v7.lua
2019-04-05 14:55:43.826  Status: dzVents: Info:  ------ Start external script: MotionGang_v1.lua: Device: "MOTION_Sensor_GANG (AeonGen5-ZWave)", Index: 375
2019-04-05 14:55:43.826  Status: dzVents: Info:  IKEA Gang motion detected !!!
2019-04-05 14:55:43.826  Status: dzVents: Info:  ------ Finished MotionGang_v1.lua
2019-04-05 14:55:43.828  Status: EventSystem: Script event triggered: /home/pi/domoticz/dzVents/runtime/dzVents.lua
2019-04-05 14:56:00.124  Status: dzVents: Info:  ------ Start external script: Poortdeur_open_v2.lua:, trigger: every minute
2019-04-05 14:56:00.142  Status: dzVents: Info:  ------ Finished Poortdeur_open_v2.lua
2019-04-05 14:56:02.599  Status: User: Admin initiated a switch command (233/TEST_ESP12/Off)
2019-04-05 14:56:15.018  Status: dzVents: Info:  Handling events for: "MOTION_Sensor_GANG", value: "Off"
2019-04-05 14:56:15.018  Status: dzVents: Info:  PIR issue: ------ Start external script: LightOn_WC_GANG_v7.lua: Device: "MOTION_Sensor_GANG (AeonGen5-ZWave)", Index: 375
2019-04-05 14:56:15.018  Status: dzVents: !Info: PIR issue: Effe niets doen !!!
2019-04-05 14:56:15.018  Status: dzVents: Info:  PIR issue: ------ Finished LightOn_WC_GANG_v7.lua

Re: forMin() problems

Posted: Friday 05 April 2019 18:15
by waaren
Thx,

it looks like dzVents is sending the right commands to domoticz but for some reason the tradfri plugin does not like these. I suggest you ask for a confirmation of that assumption in the tradfri topic.

If you are interested I can help with a script to work around it and only switches the ganglamp to Off when no motion has been detected for three minutes.
Just let me know.