Window and door sensor stays open for X minutes

Hello all!

I was wondering if it is possible to have an extra choice for door and window sensors like DW2 for example.

I have three garage doors at work and I want: If door is open more than 10 minutes then trigger the sonoff relay to close it.
If windows are open more than 5 minutes then turn off the AC
if a door or windows is open more than 30 minutes send a notification etc

Is it possible? Thanks!!!

1 Like

Let’s put them on the request list @natalia.long.

And yes, the delay status of the DW should be supported as a trigger of the scenes, for now notification of opening remains for X minutes is available.

1 Like

Just create 2 scenes.
Scene 1:

IF
window open

THEN
wait 5 minutes
AC off

Scene 2:

IF
window closed

THEN
AC on

1 Like

Thanks for the advice but I dont ask that.

I want if a window is open for 5 minutes (continuously) then the AC goes off
If I close the door at 4 minutes for example, I want the AC keeps ON

That is very impoirtant for me for the garage doors when someone goes out and forget to close it. This is happening everyday at work…

Actually, the " continuously" feature is quite difficult for sensors, cuz the no-stop status report need stable power supply while the sensors are mostly battery powered.

Not done this is consideration of quickly consuming of the battery and it’s hard to get the status continuously, and the sensors are designed to report status changes.

The compromise solution is to call the API with certain rules, like at
one minute
tow minutes
three minutes
…
up to ten minutes I thinks, not endless

it’s more like a status request at time point, not continuously, so it’s not accurate as expected.

Two or three years ago I dont remember I had window and door sensors by Xiaomi. They had the feuture “opened for over 5 minutes” and they are battery powered sensors also. Now they have the feature just for 1 minute.

The only I can think for now is something like this

Scene 0 (ENABLED)
-If sensor is open
-Enable Scene 1

Scene 1 (DISABLED)
-If sensor is open
-delay 5 minutes
-Close the garage door

Scene 2 (ENABLED)
If sensor is close
Disable Scene 1

For some reason it doesnt work. I guess because the sensor is already opened when Scene 1 is enabled?

Is imposible to do with ewelink. I had same problem last year. My case was that i want off the ac when a window stay open more than 5 minutes. If you make this:

  • when some window is open
  • wait for 5 minutes
  • then the ac off
    But the problem come now
    -When every windows are closed
    -then ac is on
    But when you closed the window before 5 minutes the first orther ( windows open-wait for 5 minutes and then off) still going and y the ac is off even if windows are closed.
    Is not posible do with ewelink but i found the solutions with the app SmartThings.
    With SmartThings you can to put the next condition:
    If windows have been open for 5 minutes continuously then ac off.
    Then if you closed the windows before the 5 minutes ac on and because has not be 5 minutes continuously the first order don’t work.
    Sorry for my english.


Hope i can help my experience

2 Likes

other platforms like Tuya, SmartThings, Alexa, and of course Home Assistant offers such scene trigger. I guess eWelink just don’t want to spend more penny to offer keeping state of the close/open with timer into a separate variable on their own servers, but instead they prefer stateless implementation. now because of this missing feature, I have decided to slowly migrate all my switches and sensors to other brand like Tuya.

Although SmartThings scene can control eWelink, however I still don’t like the delay caused by cross platform communication. if it allows ever scenes automation to be controlled within 1 app, it will be best.

I was introduced by friends that eWelink were reliable, but seeing this such important feature(for the sake of convenience) missing, I wouldn’t recommend to any new users anymore.

you don’t have to keep pinging status for draining battery. but instead, you can just get the timestamp difference between last known status time and state change time, you have offered the log, why can’t the timestamp be reused?

for example
I want
if device in state A for 5 minutes, do something

the implementation could be : when device is in Non State A, you recorded the log with timestamp. e.g. 12.00pm. this is already available. now record the last known state.

when device is back to State A on 12.03pm, don’t do something first, but start a timer for this scene. during a timer of 5 minutes, if other state changes, then this scene should be killed, but if not detected any state (even if battery dies) the state A still persists on 12.08pm, then do something.

all of these are reading last recorded state, but didn’t involve constant request to the sensor at all.

now the real use case,

someone’s cooking in kitchen, the expectation is, if PIR sensor detects someone in kitchen, keep the kitchen light on
if PIR sensor don’t detect someone for longer than 2 hour, then turn off the light.

nobody want the PIR suddenly turn off the light instantly, the chef could be just stand still monitoring the cooking process without moving for a minute, but PIR sensor thought that no one’s there and it changes to no human state.

if you expect user to use delay then turn off, like you already offered now, if the PIR sensor sense no one , but the chef is still standing there, nothing will happen right away, but after 2 hours, even if the chef is detected and still cooking, the last triggered 2 hours delay will forcefully turn off the light, it may cause trouble to the chef!!

or even providing control to reset the inching could resolve.

e.g. PIR detected, allowing inching state to restart.

When you disable a scene with the command “Enable/Disable auto scenes”, the scene does not disabled until finished.

I don’t kwon the reason that they don’t fix this.
It’s a simple task: When you disable a scene then the scene must be … disabled?

1 Like

Hi all, I’ve found a workaround to obtain the result:

first af all notice that you’ve to “sacrifice” a simple sonoff switch and use it as a phisical variable.

step1, configure a sonoff switch, connected to nothing (only powered) in inching mode, whith inching time X equal to the time you want to chech the status of the sensor, for example 5 minutes.
step2, configure an automatic scene triggered by the sensor open, that switch on the sacrifyed sonoff.
step3, configure a scene triggered by the switch off of sacrifyed sonoff. in this scene you can chek the status of the sensor after X time, 5 minutes in this example, and decide to do things.

hopefully this can help you, unless until ewelink decide to handle the continuous status :slight_smile:

1 Like

I’ve finally done this behavior very easily with smartthings. The app has a direct method to do that