home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
71.34k stars 29.88k forks source link

Add missing features for AlarmDecoder #35728

Closed ryanh1986 closed 3 years ago

ryanh1986 commented 4 years ago

While the AlarmDecoder for the Vista series security panels is integrated, the entire featureset isn't present in the add-on.

Environment

Problem-relevant configuration.yaml


# Configure a default setup of Home Assistant (frontend, api, etc)
default_config:

# Uncomment this if you are using SSL/TLS, running in Docker container, etc.
# http:
#   base_url: example.duckdns.org:8123

# Text to speech
tts:
  - platform: google_translate

group: !include groups.yaml
automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml

device_tracker:
  - platform: netgear
    password: !secret netgear

ecovacs:
  username: !secret ecovacsu
  password: !secret ecovacsp
  country: us
  continent: na

ifttt:
  key: !secret ifttt

alarmdecoder:
  device:
    type: serial
  panel_display: true
  zones:
    02:
      name: 'Living Room Glassbreak'
      type: 'sound'
    03:
      name: 'Enclosure Tamper'
      type: 'door'
    10:
      name: 'Patio Window Left'
      type: 'window'
      rfid: '0518263'
      loop: '2'
    11:
      name: 'Patio Window Center'
      type: 'window'
      rfid: '0215314'
      loop: '2'
    12:
      name: 'Patio Window Right'
      type: 'window'
      rfid: '0228957'
      loop: '2'
    13:
      name: 'Landing - Garage Entry'
      type: 'door'
      rfid: '0599735'
      loop: '1'
    14:
      name: 'Landing - Front Door'
      type: 'door'
      rfid: '0231910'
      loop: '1'
    15:
      name: 'Landing Motion'
      type: 'motion'
      rfid: '0426962'
      loop: '1'
    16:
      name: 'Living Room Motion'
      type: 'motion'
      rfid: '0437916'
      loop: '1'
    17:
      name: 'Living Room Smoke/Heat Detector'
      type: 'smoke'
      rfid: '0405672'
      loop: '1'
    18:
      name: 'Hall CO Detector'
      type: 'gas'
      rfid: '0377604'
      loop: '1'
    19:
      name: 'Garage Overhead Door'
      type: 'garage_door'
      rfid: '0742151'
      loop: '1'
    20:
      name: 'Guest Bedroom Flood'
      type: 'moisture'
      rfid: '1006348'
      loop: '1'
    21:
      name: 'Aquarium Too Hot'
      rfid: '0857280'
      loop: '1'
    22:
      name: 'Aquarium Too Cold'
      rfid: '0902971'
      loop: '1'
    23:
      name: 'Living Automation Motion'
      type: 'motion'
      rfid: '0902158'
      loop: '1'
    24:
      name: 'Guest Automation Motion'
      type: 'motion'
      rfid: '0280608'
      loop: '1'
    25:
      name: 'Garage Motion'
      type: 'motion'
      rfid: '0280608'
      loop: '1'
    26:
      name: 'Test Switch 2 loop 2'
      rfid: '0805473'
      loop: '2'
    27:
      name: 'Test Switch 2 loop 4'
      rfid: '0805473'
      loop: '4'

Traceback/Error logs

Additional information

Can not access or utilize partitions 2/3 without the system scrolling through them all. Can not access night-stay mode (it arms instant instead). Arming night seems to arm_home in HA. Instant and Night on the Vista 20 are two completely different modes, and night_stay is the intended night time mode as per the manufacturer instruction. This allows users of the system to enable certain sensors that instant mode does not allow (motions in areas where motion should not be at night).

The best way to go about this is to give access to all arming modes at the control panel, and make instant a "home" mode and night stay the "night" mode, as this is the correct operation of a Vista panel.

probot-home-assistant[bot] commented 4 years ago

alarmdecoder documentation alarmdecoder source (message by IssueLinks)

probot-home-assistant[bot] commented 4 years ago

Hey there @ajschmidt8, mind taking a look at this issue as its been labeled with a integration (alarmdecoder) you are listed as a codeowner for? Thanks! (message by CodeOwnersMention)

ajschmidt8 commented 4 years ago

hey @ryanh1986, thanks for opening this issue. I'm the codeowner for Home Assistant so i can chime in on the 2 issues you mentioned.

I'm not very familiar with using multiple partitions since my home only uses 1. If you could elaborate on this and provide some resources with additional information I could try to look into it. Additional context would also be helpful (i.e. what's the current behavior, what's the expected behavior. I'm not sure what you mean when you say "without the system scrolling through them all").

HomeAssistant previously used Night-Stay for AlarmDecoder. I changed the behavior in this PR #32292 based on the documentation that said alarm_arm_night should use Instant mode and not Night-Stay mode. It seems like this wasn't a popular change, though (another use emailed me about it). I can make this option configurable so that users can choose between Instant or Night-Stay mode for alarm_arm_night.

Regarding _Arming night seems to armhome in HA, I'll have to do some investigating in AlarmDecoder to see if there's a way to distinguish between being armed in home vs night mode.

ryanh1986 commented 4 years ago

Thanks for the quick reply! To be up front, I'm new to coding and still taking my first footsteps with Python and YAML. I am however well versed in alarm system and low voltage work in general, so I'm better suited at explaining the intended operation of the panel and alarm decoder. That said.. here goes my explanation attempt lol

  • Can not access or utilize partitions 2/3 without the system scrolling through them all.

I'm not very familiar with using multiple partitions since my home only uses 1. If you could elaborate on this and provide some resources with additional information I could try to look into it. Additional context would also be helpful (i.e. what's the current behavior, what's the expected behavior. I'm not sure what you mean when you say "without the system scrolling through them all").

The AlarmDecoder operates by assigning itself onto any or all partitions which have been configured for it. For example, if I have keypads 16,17 set for partition 1, and 18,19 for partition 2, 20,21 for partition 3... the Alarm Decoder receives all of this information. The AD plugin/addon for other automation software has the ability to assign a "keypad" or in HA's case, a "control panel" to any given partition number. This allows having essentially a separate system contained within the same panel.

For my use case, partition 1 is house burglary alarm, partition 2 is my gun safe (only I can disarm that), and partition 3 is used for automation devices and none of them are programmed to send an alarm to the central station.

Since moving to HA from Vera/ST, I've had to do away with the Alarm Decoder having access to those partitions, since all 3 of them try to come into the same "Alarm Control Panel" at once. If #2 is armed but #1 is disarmed, the display in HA will flip between "ARMED MAXIMUM" and "Ready to Arm" randomly, as it is seeing both partitions.

  • Can not access night-stay mode (it arms instant instead). Arming night seems to arm_home in HA. Instant and Night on the Vista 20 are two completely different modes, and night_stay is the intended night time mode as per the manufacturer instruction. This allows users of the system to enable certain sensors that instant mode does not allow (motions in areas where motion should not be at night).

HomeAssistant previously used Night-Stay for AlarmDecoder. I changed the behavior in this PR #32292 based on the documentation that said alarm_arm_night should use Instant mode and not Night-Stay mode. It seems like this wasn't a popular change, though (another use emailed me about it). I can make this option configurable so that users can choose between Instant or Night-Stay mode for alarm_arm_night.

The reason AD decided to document it this way is because many users were adding the device to ADT branded Vista panels. It's not common knowledge outside of the security industry, but the ADT branded Vistas have less features, including Night Stay mode. Adding to that, many alarm installers are lazy and do not set up Night Stay programming and just tell the homeowner to use Instant. They were getting posts on their help board about Night mode not working repeatedly. This unfortunately means that the option was taken away for HA users who have a legitimate, full featured Vista 20P.

Regarding Arming night seems to arm_home in HA, I'll have to do some investigating in AlarmDecoder to see if there's a way to distinguish between being armed in home vs night mode.

I think I misconstrued this in the original issue. What I mean is that if I use arm night in HA, it arms instant, but the Alarm Control Panel says that I am armed "Home". Is there a way for it to recognize that it is armed in "Night" mode? I had several automations based off of these four states (disarmed, armed_home, armed_away, armed_night).

I can provide any panel documentation that you may require to further learn about these features.

ajschmidt8 commented 4 years ago

@ryanh1986, I'm wrapping up some changes to make night mode configurable now. I'll have a pull request (PR) open shortly (just have to finish the documentation). After that, you should be able to set a new configuration parameter, alt_night_mode to true in your config to switch from Instant to Night-Stay mode when using Arm Night in Home Assistant.

Once that PR is accepted, I'll submit another fix to correctly show that the panel is armed in Night mode instead of Home mode when using Arm Night in Home Assistant.

After all that, I'll circle back to get the partition stuff sorted out. I think I'll have to read up a little bit on both HomeAssistant and AlarmDecoder before I can work on that one.

ryanh1986 commented 4 years ago

@ryanh1986, I'm wrapping up some changes to make night mode configurable now. I'll have a pull request (PR) open shortly (just have to finish the documentation). After that, you should be able to set a new configuration parameter, alt_night_mode to true in your config to switch from Instant to Night-Stay mode when using Arm Night in Home Assistant.

Once that PR is accepted, I'll submit another fix to correctly show that the panel is armed in Night mode instead of Home mode when using Arm Night in Home Assistant.

After all that, I'll circle back to get the partition stuff sorted out. I think I'll have to read up a little bit on both HomeAssistant and AlarmDecoder before I can work on that one.

Where do I start to view the changes in code and possibly help out? I'm learning Python just to be a contributor. Even if I can't help yet, I think seeing the changes would help me out as I already know the desired outcome, and can mostly make out what's happening in code at least.

ajschmidt8 commented 4 years ago

@ryanh1986, the PR with my code changes can be viewed here #35761. You'll see a Files Changed tab near the top of the page that lets you view the code changes. The entire existing AlarmDecoder integration (without my changes) for HomeAssistant can be viewed at the link below. Happy to answer any questions you might have.

https://github.com/home-assistant/core/tree/dev/homeassistant/components/alarmdecoder

ajschmidt8 commented 4 years ago

@ryanh1986 , just an update. the previous PR i mentioned was rejected, but I have two new ones currently open

they should address 2 out of 3 of the issues you mentioned. if they're accepted, then i'll start looking into multiple partition support. :crossed_fingers:

stale[bot] commented 4 years ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue now has been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.