Page 1 of 1

Motion sensor Hallway

Posted: Wednesday 28 October 2020 11:50
by Cndiann
Hello,

I have a motion sensor in the hallway and a FGD212 Dimmer 2. I connected 2 physical momentary switches on it. So If I press once the light 'Lamp trap' goes on.

In blocky I had this event:
blockly.JPG
blockly.JPG (32.42 KiB) Viewed 289 times
It does the job but when I switch the light with the physical switch it trigger the blockly event so the 'Lamp trap' goes out when the motion detector is off even If I do this at 10:00.
And I didn't get manual override to work, so I can switch the physical switch for example on 10:00 and 'Lamp trap' stay on even if there is no motion detected.

I tried in dzVents but only got so far;

Code: Select all

return 
{
    on = 
    {
        devices = 
        {
            ['PIR trap motion'] = { 'between 15:00 and 10:00' }, --only turns on after 15:00 and before 11:00
        },
    },
 
    logging = 
    {
        level = domoticz.LOG_DEBUG,
        marker = 'Trap',
    },

    execute = function(dz, item)
        local light = dz.devices('Lamp trap')
        local offDelay = 120
        
        if item.active then -- state == 'On'
            light.cancelQueuedCommands()
            light.switchOn()
            light.switchOff().afterSec(offDelay)
        end
    end
}
What I want to archieve;
-Set timer to activate between 15:00 and 11:00
- Set level % of 'Lamp trap'
- Set duration time or when motion is off turn 'Lamp trap' off
- Override the script when I press the physical button

Hope I can get some help! Thanks

Re: Motion sensor Hallway

Posted: Wednesday 28 October 2020 13:15
by waaren
Please don't crosspost. Seems to be the same as your earlier posted topic

[topic locked]