Motion sensor Hallway

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

Moderator: leecollings

Locked
Cndiann

Motion sensor Hallway

Post 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 287 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
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Motion sensor Hallway

Post by waaren »

Please don't crosspost. Seems to be the same as your earlier posted topic

[topic locked]
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
Locked

Who is online

Users browsing this forum: No registered users and 1 guest