Delay between Zwave PIR and Hue lamps

For Z-Wave related questions in Domoticz

Moderator: leecollings

Post Reply
rizzah
Posts: 75
Joined: Monday 17 October 2016 16:11
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Groningen
Contact:

Delay between Zwave PIR and Hue lamps

Post by rizzah »

Hi all,

I have the following issue; i use a Zwave PIR to control a few Hue lamps in the house. I already noticed a (small) delay on a lamp i have in my bedroom, upon entering the room, the delay is around 3/4 seconds. This was not ideal, but ah well, doable. Last weekend i added the same setup with 3 Hue lamps in a group, so i control the group for switch on/off. The delay is not up to 40 seconds. Is this normal behaviour and should i just control them using a Hue motion sensor or could there be a different problem? To be complete let me show the setup, maybe something there is wrong, or could be done better.

dzVents script:

Code: Select all

return {
    active = true,  
    on = {
        devices = {
            ['Group Overloop boven'] = {'on mon,tue,wed,thu,fri,sat,sun'}
        },
        timer = {
            'every minute on mon,tue,wed,thu,fri,sat,sun'
        },        
    },
    data = {
        counter = { initial = 0 }
    },

    execute = function(domoticz, device)

domoticz.log('[DEVICE][OVERLOOP] Sensor status.: ' ..domoticz.devices('ZW Sensor Overloop Trap').state) 
domoticz.log('[DEVICE][OVERLOOP] Lamp Status...: ' ..domoticz.devices('Group Overloop boven').state)
domoticz.log('[DEVICE][OVERLOOP] Lux Value.....: ' ..domoticz.devices('ZW Lux Overloop Trap').lux) 
domoticz.log('[DEVICE][OVERLOOP] Counter Value.: ' ..domoticz.data.counter) 

            if (domoticz.devices('ZW Sensor Overloop Trap').state == 'On') and 
               (domoticz.devices('Group Overloop boven').state == 'Off') and 
               (domoticz.devices('ZW Lux Overloop Trap').lux <= 15) then
                if (domoticz.time.hour >= 7) and (domoticz.time.hour < 23) then
                    domoticz.scenes('Lamp_Overloop_Overdag').switchOn()
                    domoticz.log('[DEVICE][OVERLOOP] Motion sensor Overloop is aan, schakelaar is aangezet (routine 7-23)')
                end
                if (domoticz.time.hour >= 23) and (domoticz.time.hour < 7) then
                    domoticz.scenes('Lamp_Overloop_Avond').switchOn()
                    domoticz.log('[DEVICE][OVERLOOP] Motion sensor Overloop is aan, schakelaar is aangezet (routine 23-7)')
                end
            end    
               
            if (domoticz.devices('ZW Sensor Overloop Trap').state == 'Off') and 
               (domoticz.devices('Group Overloop boven').state ~= 'Off') then 
                domoticz.devices('Group Overloop boven').switchOff()
                domoticz.log('[DEVICE][OVERLOOP] Schakelaar overloop is uitgezet')
                end
            end
}
Then i have 2 scenes in domoticz which call a script (see attached screenshot), basicly i have this with the 'On Action': script://hue-scripts/Lamp_Overloop_Overdag.sh

The file content of Lamp_Overloop_Overdag.sh is:
#!/bin/bash
curl --request PUT --data "{\"scene\": \"y79k6DsXpJj-eGY\"}" http://192.168.80.117/api/<username>/groups/23/action

Any help would be really appriciated.

Regards,
Peter
Attachments
Scene example
Scene example
Screenshot 2021-01-18 at 20.19.15.png (84.46 KiB) Viewed 353 times
User avatar
waltervl
Posts: 5905
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: Delay between Zwave PIR and Hue lamps

Post by waltervl »

What does de log file say if motion detected? Is it the motion that delays, is it sending the command to Hue Bridge? Is the Hue Bridge slow?
The same if you switch the scene on. What does the log file say?
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
rizzah
Posts: 75
Joined: Monday 17 October 2016 16:11
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Groningen
Contact:

Re: Delay between Zwave PIR and Hue lamps

Post by rizzah »

It seems i had an in my dzvents script. I had device = in the top set to the Hue lamp, instead of the sensor, which probably flood the Hue Bridge a lot. Rookie mistake, but thanks for the responce @walter.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest