Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Allow Open Initially" sensor names in Armed alert as a wildcard same as "Bypassed" #845

Open
2 tasks done
ideal2545 opened this issue Nov 22, 2023 · 7 comments
Open
2 tasks done

Comments

@ideal2545
Copy link

ideal2545 commented Nov 22, 2023

Checklist

  • I checked for similar existing requests (both open and closed) before posting.
  • My request is generic, other users may benefit from it too.

Proposal

Right now, Alarmo allows us to use the Bypassed wild card when arming the alarm to see what is bypassed, I think it would be great to have the same data for Open Initially.

This request is so that users can see what windows are open so that they can keep track and close the windows later that are open.

Additional info

Add a wild card open in the notifications area similar to Bypassed

@nielsfaber
Copy link
Owner

I agree with your request.
I just don't really know (yet) how to make this happen in the code.
The bypassed sensors are handled differently than sensors which are initially ignored. So I might need to reshuffle some things to be able to add this feature.

@zd3sf
Copy link

zd3sf commented Jan 6, 2025

Okay so I did some digging because I had a similar request open. Here are my findings:

  1. Open sensors get registed inside open_sensors attribute
  2. If alarm is forced and there are open sensors, those open sensors get registered under bypassed_sensors
  3. If sensors are allow open initially, then they're not registered under either open_sensors or bypassed_sensors

here's the append code that handles it. When a sensor is bypassed, its appended to a list. But when its allowed open initially, nothing happends.
image

The only solution is to create a new attribute, I called mine allowed_open but it needs some rewrite:

In Sensors.py

image
image

In alarm control panel.py

image
image
image
image
image
image

###In automations.py
image

I see the value of the new attribute but its value is null. I cant seem to make it work. @nielsfaber Any suggestions how to move forward?

@nielsfaber
Copy link
Owner

@zd3sf
I have to admit I have not given this request the attention it deserves.
Thank you for joining the discussion and for your efforts.

My thoughts on this is as follows:

  1. Currently, the bypassed_sensors attribute (and corresponding wildcard) will only show sensors which are permanently (i.e. until disarming the alarm) bypassed.
  2. The 'allowed open' feature was initially purposed for motion sensors only. For example a motion sensor in the hallway will always be still active when you exit the door. For this usage, I don't think it makes any sense to show this in any attribute or wildcard.
  3. More recently the 'allowed open' feature was enabled for window sensors as well. I think that for this case, it should be visible to the user, so added to the bypassed_sensors attribute/wildcard (and possibly removed later if the window would be closed).
  4. I don't agree with adding more attributes and wildcards for this specific scenario. This will only raise confusion to most users and complicates the notifications unnecessarily.
  5. I am a bit puzzled on how to implement the conflicting cases 2+3 as written above. I prefer not to distinguish between sensor types in the code handling this. Perhaps it was a wrong decision to re-purpose the 'allowed open' setting for case 3, instead a different setting should be created for this, like 'bypass temporarily', which would also be reflected in the bypassed_sensors attribute/wildcard.
  6. I don't consider case 2 as bypassing of a sensor, it's intended for masking the initial on-state due to motion sensors having a 'cooldown time' after detecting motion. Alternatively, we could make such sensors edge-sensitive (so only acting on off->on transitions) which would remove the need for the 'allowed open' setting completely.

Please share your thoughts on the above. Having a clear idea on how the implementation should be is ~80% of the work (changing the code is not a problem).

@zd3sf
Copy link

zd3sf commented Jan 6, 2025

Hi Niels,

I think #1 should stay. We should not mess with bypassed_sensors, The word bypass indicates that no subsequent triggering from the sensor will happen. We must be consistent with the phrase bypass throughout.

I agree with Case #2 and #6, we are not bypassing, we're just allowing them to be open initially.

How about adding an attribute active_sensors_when_armed? I know its a mouthful but it eliminates confusion and doesnt have to pertain window/door/motion sensor. Alternatively if people just care about door/window open_sensors_when_armed might work.

@zd3sf
Copy link

zd3sf commented Jan 12, 2025

Any thoughts?

@nielsfaber
Copy link
Owner

@zd3sf I shared my thoughts in my earlier comment.
As said, I don’t think adding additional attributes/wildcards is helpful nor necessary.

@zd3sf
Copy link

zd3sf commented Jan 12, 2025

No worries. I am desperate for a solution so with the help of chatGPT, I was able to understand Python code, then modify it to add attribute active_when_armed.

Here's the modified code for anyone interested. @nielsfaber Sorry you feel differently, I hope you can consider this addition in the future if you dont find a solution like bullet #5
alarm_control_panel.txt
automations.txt
sensors.txt

imageworks okay
image
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants