Jump to content

Door sensor program variable help needed


EricK

Recommended Posts

I have one hidden door sensor working great. Open the door to the basement and the lights for the stairs turn on. I just installed a second sensor in a door from the basement garage to the house. The kids sometimes play in the garage, it is a big boat garage and good for cozy coupes and tricycles. Sometimes the door into the house gets left open. I already have a sensor with io linc on the garage door itself that sends me a notification at 9pm if the door is open and a Kpl button in the bedroom to show me the door status. I want to do the same with this new door sensor.

I think I need to set this up like the leak sensor with an integer variable. Make program(s) if door opens set variable=1, closed=0. Then have a program if time is 9pm and variable=1 send notification.

Not to use this as a security system, which we have, but maybe I need a state variable instead. I could have a time range and if the variable=1, meaning someone opens the door at night, then send notification.

For the Kpl just make a scene with the door sensor as the controller.

Thanks for reading.

Eric

Link to comment

Here is what I have so far, door sensor set to two nodes:

State variable s.ExerciseRoomDoor.

If
       Control 'Basement / Basement Devices / Exercise Room - Door Open' is switched On

Then
       $s.ExerciseRoomDoor  = 1

Else
  - No Actions - (To add one, press 'Action')


If
       Control 'Basement / Basement Devices / Exercise Room - Door Closed' is switched On

Then
       $s.ExerciseRoomDoor  = 0

Else
  - No Actions - (To add one, press 'Action')


Notification:

If
       From    10:00:07PM
       To       6:30:00AM (next day)
   And $s.ExerciseRoomDoor is 1

Then
       Send Notification to 'Eric text' content 'Exercise Room Door is Open'

Else
  - No Actions - (To add one, press 'Action')

Thanks,

Eric

Link to comment

I don't see a reason to use variables or dual nodes for this.

 

I would leave it in one-node mode and put the door sensor in a scene with the desired KPL.

 

Then write one program for the notification.

 

If

Sensor is 'on'

and

Between 10pm - 630am

 

Then

Send Notification

 

Unless you have other uses for when the door is open I'd keep it simple.

Link to comment
I don't see a reason to use variables or dual nodes for this.

 

I would leave it in one-node mode and put the door sensor in a scene with the desired KPL.

 

Then write one program for the notification.

 

If

Sensor is 'on'

and

Between 10pm - 630am

 

Then

Send Notification

 

Unless you have other uses for when the door is open I'd keep it simple.

Will this work with the sensor status, or does it have to be control? I tested and if the sensor triggers I am getting notification. But what if the door opens at 4pm, when it is 10pm will the notification trigger. Not sure about a battery device.

Link to comment

I am with shannong and kman on this. Variables are an unnecessary complication in this case, and STATUS is the correct condition.

 

The suggested progrm will actually do more than you ask. In addition to sending a notice at 9 if the door is open, it will send a notice anytime between 9 and 630 if the door is open, or opened, during this period. This appears consistent with where you were you headed using variables.

Link to comment

I would suggest the addition of a Wait so that when somebody opens the door during the notification period to use the door (but not actually leaving it open) you won't get notifications.

 

 

If

Sensor is 'on'

and

Between 10pm - 630am

 

Then

Wait 60 Seconds

Send Notification

Link to comment

Guys, thank you for your help. I did set the sensor back to single node and this works just as I want. The kpl button in the bedroom responds immediately to the sensor. The notification does work on the status, which I thought might not since it is a battery powered device. No one should be opening the door at night so I am going to leave the delay out.

How does this look. If the door is left open by the kids then I get a notification at 945PM. Or if the door is opened between 1045PM and 630AM I get a notification. Just in case I go into the basement garage at night to get something I pushed the time back. The alarm function I have is really not needed since thedoor from the garage to the outside is on our actual alarm system.

If
       (
            From    10:45:07PM
            To       6:30:00AM (next day)
         Or Time is  9:45:00PM
       )
   And Status  'Basement / Basement Devices / Exercise Room - Door Sensor' is On

Then
       Send Notification to 'Eric text' content 'Exercise Room Door is Open'

Else
  - No Actions - (To add one, press 'Action')


Eric

Link to comment
No one should be opening the door at night so I am going to leave the delay out..... Just in case I go into the basement garage at night to get something I pushed the time back.

Eric

 

Sounds like you could use the Wait. Then you wouldn't need to push the time back or guess when you might need to visit the garage. But as long as it works for you then it's fine.

 

Enjoy.

Link to comment

Shannon,

Let me think about it. The true purpose of the door sensor is just to let me know if the kids left the door open. I probably should just leave it at that. Adding the security function, if the door is opened at night, is probably not needed. However, if someone were to get in and open and then quickly close the door I would not get the notification if there is a wait in the program.

Thanks,

Eric

Link to comment

Archived

This topic is now archived and is closed to further replies.


×
×
  • Create New...