Odianosen25 / Monitor-App

Appdaemon App for Andrew's Monitor Presence Detection System
74 stars 9 forks source link

Idea: Interval scan on open "gateways". #56

Closed pointlevel closed 3 years ago

pointlevel commented 4 years ago

This app is really awesome. Finally i can start using Monitor again.

I have an idea that maybe should be a good thing.

During summer, at least i and probably many with me, is keeping doors open during the day. And if i have this door set as a gateway, the scan will not execute in a very long time. So if we could have "smarter" gateways would be lovely in this kind of scenario. Im thinking like:

home_gateway_sensors:
  frontdoor: (Full example setup)
    entity_id: binary_sensor.frontdoor    (ID of the sensor. Required)
    state_open: 'on'    (What state of this specific sensor is equal to open. Optional)
    state_closed: 'off'    (What state of this specific sensor is equal to closed. Optional)
    scan_if_kept_open: true    (Start interval-scan if open more than some time, 5mins? Optional)
    scan_time: 2    (Time between scans in minutes. Optional)
  backdoor: (Minimum setup, functionality as of today)
    entity_id: binary_sensor.backdoor

Of course this could be made with automation in HomeAssistant, but would preferable live inside this app. See this only as a suggestion, i love the app anyway ;)

Odianosen25 commented 4 years ago

@pointlevel,

Thanks for the compliments, that’s very kind and I am happy I could give something that gives much happiness to ppl.

On your request, if the door is constantly opened, you could have a motion sensor in front of the door and register it as a gateway sensor. That way each time someone passes it, it will scan arrival or depart.

Doesn’t that solve?

pointlevel commented 4 years ago

Yes, sure it would do, but that means i have to have an additional sensor(motion) for this. And also i think it would do better to have a regular scan-interval activated instead of everytime someone passes the motion-sensor...because with a lot of people hanging around, that would be unnecessarily many scans. I know this is only a summertime-problem ;)

Odianosen25 commented 4 years ago

Yeah too many scans, that’s a good point. Let me think abt it some more, will get back to you on what I think.

Regards

skynet01 commented 4 years ago

hmm maybe a more elegant solution is to just have a Monitor App create a binary switch toggle called Continue_Scanning or something like that. Then it can be toggled to ON using automation for whatever reason you might need and off until you don't need it anymore

pointlevel commented 4 years ago

Of course thats an idea to, and handy in some situations. But if i need to make an automation in HA for it to switch on/off when the "door" is open, i can already make an automation that publishes an mqtt for some interval as long as the "door" is open. The convinience with this was to not needing any HA automation and collect the most logic around monitor in this App.

Odianosen25 commented 4 years ago

I am tending towards a solution that does thus;

The only difference the user will see, is to set some time in seconds, for the interval; say “gateway_scan_interval” or something fancy. When the app sees that setting, it knows it’s to scan continuously as long as one of the gateways is opened.

Only thing is it won’t be each gateway having it’s own setting, but a general one across all of them.

Regards

skynet01 commented 4 years ago

Good idea, should there also be a time out for when this logic kicks in? Like start this scan once the door been open for 2 min.

pointlevel commented 4 years ago

As long as you can determine what is the "open"-state for each gateway it would do just great. Now that you also can have different domains/entities(which is lovely) as a gateway that have their own sometimes different states like, on/off, home/away, true/false etc...then different states can mean different things.

But of course, keeping the config as easy as possible is a good thing also.

pointlevel commented 4 years ago

Good idea, should there also be a time out for when this logic kicks in? Like start this scan once the door been open for 2 min.

I think that is what @Odianosen25 means with the timer. Then it just stops when the gateway is closed again.

Odianosen25 commented 4 years ago

also be a time out for when this logic kicks in?

Yeah will build it in

As long as you can determine what is the "open"-state for each gateway it would do just great.

Yeah already have that set up, thanks to previous suggestions from @skynet01, so I will be building it on that

Now that you also can have different domains/entities(which is lovely) as a gateway that have their own sometimes different states like, on/off, home/away, true/false etc...

Built in already

But of course, keeping the config as easy as possible is a good thing also.

Yep why the setup with a simple timer :)

Odianosen25 commented 3 years ago

Ok this has been implemented in dev.

Don't worry I know its great to have this done in Winter right? But who knows maybe you might still need it if your little girl sprays some her special scents into your rub and you need to keep the doors opened to help with the smell :D

Do let me know if anything. Kind regards