Page 1 of 1

Aqara human body sensor

Posted: Tuesday 10 December 2019 20:04
by MikiG
Hello, sorry for my English, I write with the google translator. I have an Aqara human body sensor to activate a scene. The problem is that at the time of deactivating it takes 1.5 minutes. I have configured it in Domoticz to do it in 5 seconds, but it does not and in the log it tells me this:

2019-12-10 19:59:09.992 (Detectores Xiaomi) onCommand: Off, level (0) Color:
2019-12-10 19:59:09.993 (Detectores Xiaomi) Update command has not been implemented for device "Det_mi_luz"
capdomoticz.jpg
capdomoticz.jpg (146.88 KiB) Viewed 864 times

Re: Aqara human body sensor

Posted: Tuesday 10 December 2019 20:20
by waaren
MikiG wrote: Tuesday 10 December 2019 20:04 I have an Aqara human body sensor to activate a scene. The problem is that at the time of deactivating it takes 1.5 minutes.
Can you please tell us why the long deactivation time is a problem for you ? Maybe we can help solving it in another way.

Re: Aqara human body sensor

Posted: Tuesday 10 December 2019 20:41
by MikiG
waaren wrote: Tuesday 10 December 2019 20:20
MikiG wrote: Tuesday 10 December 2019 20:04 I have an Aqara human body sensor to activate a scene. The problem is that at the time of deactivating it takes 1.5 minutes.
Can you please tell us why the long deactivation time is a problem for you ? Maybe we can help solving it in another way.


Yes, since I leave the room the motion sensor takes 1.5 minutes to turn off the light. I just wanted the disconnection time to be shorter to save on the bill

Re: Aqara human body sensor

Posted: Tuesday 10 December 2019 21:01
by waaren
MikiG wrote: Tuesday 10 December 2019 20:41 Yes, since I leave the room the motion sensor takes 1.5 minutes to turn off the light. I just wanted the disconnection time to be shorter to save on the bill
Below dzVents script will do just that

When not yet familiar with dzVents please start with reading Get started Before implementing (~ 5 minutes). Special attention please for "In Domoticz go to Setup > Settings > Other and in the section EventSystem make sure the checkbox 'dzVents disabled' is not checked. Also make sure that in the Security section in the settings you allow 127.0.0.1 to not need a password. dzVents uses that port to send certain commands to Domoticz. Finally make sure you have set your current location in Setup > Settings > System > Location, otherwise there is no way to determine nighttime/daytime state."

Code: Select all

return 
{
    on = { devices = { 'Det_mi_luz' }},

    execute = function(dz, item)
      light = dz.devices('name of your light')
      if item.state == 'On' then
         light.cancelQueuedCommands()
         light.switchOn()
         light.switchOff().afterSec(5)
      end
    end
}

Re: Aqara human body sensor

Posted: Tuesday 10 December 2019 23:02
by MikiG
waaren wrote: Tuesday 10 December 2019 21:01
MikiG wrote: Tuesday 10 December 2019 20:41 Yes, since I leave the room the motion sensor takes 1.5 minutes to turn off the light. I just wanted the disconnection time to be shorter to save on the bill
Below dzVents script will do just that

When not yet familiar with dzVents please start with reading Get started Before implementing (~ 5 minutes). Special attention please for "In Domoticz go to Setup > Settings > Other and in the section EventSystem make sure the checkbox 'dzVents disabled' is not checked. Also make sure that in the Security section in the settings you allow 127.0.0.1 to not need a password. dzVents uses that port to send certain commands to Domoticz. Finally make sure you have set your current location in Setup > Settings > System > Location, otherwise there is no way to determine nighttime/daytime state."

Code: Select all

return 
{
    on = { devices = { 'Det_mi_luz' }},

    execute = function(dz, item)
      light = dz.devices('name of your light')
      if item.state == 'On' then
         light.cancelQueuedCommands()
         light.switchOn()
         light.switchOff().afterSec(5)
      end
    end
}
It works perfectly, but I don't know if I haven't explained myself, or the google translator doesn't work well.
What I want is that while there is movement in the room, the light is on, but if it no longer detects movement in 5 or 10 seconds, turn off the light

Re: Aqara human body sensor

Posted: Tuesday 10 December 2019 23:34
by Geitje
You mean the sensor is not redetecting movement for some time, after it detected movement?

Re: Aqara human body sensor

Posted: Tuesday 10 December 2019 23:41
by waaren
MikiG wrote: Tuesday 10 December 2019 23:02 What I want is that while there is movement in the room, the light is on, but if it no longer detects movement in 5 or 10 seconds, turn off the light
That''s only possible if your sensor supports that. Most sensors do not send a new 'motion detected' signal during the time that is set for it to stay on. The script I posted will work when sensor send a new 'motion detected signal' within the time set.

Re: Aqara human body sensor

Posted: Wednesday 11 December 2019 0:02
by MikiG
waaren wrote: Tuesday 10 December 2019 23:41
MikiG wrote: Tuesday 10 December 2019 23:02 What I want is that while there is movement in the room, the light is on, but if it no longer detects movement in 5 or 10 seconds, turn off the light
That''s only possible if your sensor supports that. Most sensors do not send a new 'motion detected' signal during the time that is set for it to stay on. The script I posted will work when sensor send a new 'motion detected signal' within the time set.
Okay, thank you very much