Anamico / node-red-contrib-alarm

Nodes to build your own home alarm system. Designed to work easily with (but does not require) homekit.
MIT License
24 stars 9 forks source link

Proposal 2 - allow the state change to be delayed #26

Open macinspak opened 3 years ago

macinspak commented 3 years ago

Originally from #24, submitted by @bartbutenaers

When I change the state (e.g. from Off to Away), I want to have some time to leave the building. However during that time some of the sensors might detect my presence, but I don't want to trigger an alarm in that time period.

I think this might be solved by adding a delay input field to the change-state node:

image

So the new state would become active only after that specified delay.

Of course this timer need to be stopped automatically when meantime a new state change request arrives. For example I have changed the state from Off to Away, but then I suddenly realize that I have left my jacket in the kitchen. So I switch the state back from Away to Off. This means that the running timer should be stopped automatically.

P.S. not sure what would be the best way to implement this, because multiple timings might be useful. E.g. from Off to Away might be 60 seconds, while from Away to Off will most probably be 0 seconds.

macinspak commented 3 years ago

Yes, I've been thinking about exit delays. Entry delays were not so hard to work around and make configurable.

I reverted to just arming the panel via iphone or siri after leaving home and just thought that made more sense as there is no physical "keypad" so to speak.

Happy however to add a function like this. So let's figure out the best idea, post ideas here and any comment on @bartbutenaers suggestions so we can come up with a really good solution.

bartbutenaers commented 3 years ago

I reverted to just arming the panel via iphone

I was doing the same here, although via Android ;-) But then we keep on cheating, because we cannot delay the state ...

A use case:

  1. You mount a physical touch screen in a room, to show a keypad via the Node-RED dashboard.
  2. When you go away from home, you activate the Away mode on your touch screen.
  3. In that room is a PIR sensor, that detects your movement after you have activated the Away mode.
  4. You go to the outside of the house, and now you want the alarm to be activated (after N seconds).

This means that the alarms triggered by the PIR sensor between step 3 and 4 need to be ignored. So I "assume" this simple rule would be sufficient: All sensor values (that contain a trigger value) should be ignored when they arrive when the timer is active.

I am curious whether somebody else has another use case, where this rule is not sufficient...