akasma74 / Hass-Custom-Alarm

It is a fork of "Yet another take on a home assistant custom alarm" that will exist until its author is back to our Earth
78 stars 29 forks source link

Alarm Disable no longer working from automation #113

Open gdtms247 opened 4 years ago

gdtms247 commented 4 years ago

The component:

Home Assistant: 0.112.4 BWAlarm (ak74 edition): v1.12.6 Hassio VM

I've had automated home/away working with the alarm for almost a full week now using a group state to tigger "away" and "home". Today now when my "home" automation triggers the alarm isn't disabled and I see this in the log. I've created some dummy automations just to see if I can trigger the disarm and those also aren't working.

Log Details (ERROR)
Logger: custom_components.bwalarm.alarm_control_panel
Source: custom_components/bwalarm/alarm_control_panel.py:1246
Integration: bwalarm (documentation)
First occurred: 4:04:43 PM (4 occurrences)
Last logged: 4:10:54 PM

[alarm_disarm] Failed to disarm: invalid passcode "None"

Here is my automation for home/away (the away works, home doesn't anymore)

- id: '1595526713690'
  alias: Alarm Mode Away
  description: ''
  trigger:
  - entity_id: group.all_family
    platform: state
    to: not_home
  condition: []
  action:
  - data: {}
    entity_id: alarm_control_panel.house
    service: alarm_control_panel.alarm_arm_away
- id: '1595794667112'
  alias: Alarm Mode Home
  description: ''
  trigger:
  - entity_id: group.all_family
    platform: state
    to: home
  condition: []
  action:
  - data: {}
    entity_id: alarm_control_panel.house
    service: alarm_control_panel.alarm_arm_home
akasma74 commented 4 years ago

Mate, I can see no alarm_disarm service call in your automations so why do you expect it to disarm anything. So I need to see your bwalarm.yaml and the automation(s) that don't work.

gdtms247 commented 4 years ago

What do you mean "no alarm_disarm service call" ?

This works:

- id: '1595526713690'
  alias: Alarm Mode Away

This doesn't:

- id: '1595794667112'
  alias: Alarm Mode Home

Won't let me attach yaml extensions so code below. Is it better to zip it or save as txt for future reference?

platform: bwalarm
panel:
  cameras: []
  round_buttons: false
enable_night_mode: true
states:
  armed_away:
    immediate:
    - binary_sensor.sensor_backdoor
    - binary_sensor.sensor_basebedroomwindow
    - binary_sensor.sensor_basewindow1
    - binary_sensor.sensor_basewindow2
    - binary_sensor.sensor_front_door
    delayed:
    - binary_sensor.sensor_garage_door
    override: []
    pending_time: '30'
    warning_time: 0
    trigger_time: 600
  armed_home:
    immediate: []
    delayed: []
    override: []
    pending_time: 0
    warning_time: 0
    trigger_time: 600
  armed_night:
    immediate:
    - binary_sensor.sensor_backdoor
    - binary_sensor.sensor_basebedroomwindow
    - binary_sensor.sensor_basewindow1
    - binary_sensor.sensor_basewindow2
    - binary_sensor.sensor_front_door
    - binary_sensor.sensor_garage_door
    delayed: []
    override: []
    pending_time: 0
    warning_time: 0
    trigger_time: 600
users:
- id: 9a8f9ea07975453abf7b88135d72399b
  name: Hass.io
  enabled: false
  code: 9a8f9ea07975453abf7b88135d72399b
  picture: ha.png
- id: ecc50921bf80471b882ce874418cb3e7
  name: admin
  enabled: false
  code: ecc50921bf80471b882ce874418cb3e7
  picture: ha.png
- id: 18b801df3a41406e822cc120a1b6ff94
  name: Home Assistant Cloud
  enabled: false
  code: 18b801df3a41406e822cc120a1b6ff94
  picture: ha.png
- id: ac1f752cc5c846308a9094bbe269f449
  name: Brooke
  enabled: false
  code: ac1f752cc5c846308a9094bbe269f449
  picture: ha.png
- id: 65a3857a5de84d6b91e6e9c07c7421b9
  name: tablet
  enabled: false
  code: 65a3857a5de84d6b91e6e9c07c7421b9
  picture: ha.png
- id: dc9515d491244b20a1f2a67dfaead9c5
  name: Justin
  enabled: false
  code: dc9515d491244b20a1f2a67dfaead9c5
  picture: ha.png
- id: 2858208f0f364d2db50c76c8a181c043
  name: ipad
  enabled: false
  code: 2858208f0f364d2db50c76c8a181c043
  picture: ha.png
admin_password: password
enable_persistence: true
passcode_attempts: '3'
passcode_attempts_timeout: 900
log_size: '30'
code: '1234'
akasma74 commented 4 years ago

What do you mean "no alarm_disarm service call" ?

This works:

- id: '1595526713690'
  alias: Alarm Mode Away

This doesn't:

- id: '1595794667112'
  alias: Alarm Mode Home

both your automations make a alarm_arm_xxx service call that arms the alarm but in the issue description you say

the alarm isn't disabled

and it shouldn't unless you use alarm_disarm service call - or I completely missed your point here.

Won't let me attach yaml extensions so code below. Is it better to zip it or save as txt for future reference?

you did the right thing - post it here as a block of code to prevent formatting.

gdtms247 commented 4 years ago

I follow you. I was flipping things around to troubleshoot and didn't change it back sorry about that. The naming is probably confusing I should have explained that "home" means someone returned so disarm the alarm and has nothing to do with the alarms arm_home setting which is unused in my environment.

I've updated my automation back to alarm_disarm service call which is the service that throws the alert. After I updated and saved it I manually executed the automation and got the password [alarm_disarm] Failed to disarm: invalid passcode "None" in the logs.

- id: '1595794667112'
  alias: Alarm Mode Home
  description: ''
  trigger:
  - entity_id: group.all_family
    platform: state
    to: home
  condition: []
  action:
  - data: {}
    entity_id: alarm_control_panel.house
    service: alarm_control_panel.alarm_disarm
akasma74 commented 4 years ago

Well, the error message says exactly what happens - you are trying to disarm the alarm giving no passcode. This component is designed so it does no allow to disarm without a code so you need to supply either master or user passcode. Have a look at how it should be passed to the service call.

gdtms247 commented 4 years ago

I've updated my automation to send the code during the disarm service call and it works now (THANK YOU!)

I've had it running for over a week without any data in the service call and the disarm has worked great. Should I be concerned that it worked fine prior or doesn't work without it now?

akasma74 commented 4 years ago

Well, if you can reproduce disarm without code, I'll look into that..

gdtms247 commented 4 years ago

My friend has been running for months with the following automation and he does not enter his code during disarm call. I got help from him setting mine up and for the initial time we matched. Not sure what I changed on my side that now requires the code but his does not and is still working fine.

Automation:

- id: '1580748247525'
  alias: Coming Home
  description: ''
  trigger:
  - entity_id: group.all_persons
    platform: state
    to: home
  condition: []
  action:
  - entity_id: alarm_control_panel.house
    service: alarm_control_panel.alarm_disarm
  - scene: scene.upstairs_lights_on
  - entity_id: switch.corner_tree
    service: switch.turn_on
  - data:
      preset_mode: Home
    entity_id: climate.ecobee
    service: climate.set_preset_mode

Yaml

code_format: null
changed_by: ''
code_arm_required: false
platform: bwalarm
immediate: []
delayed: []
ignored:
  - binary_sensor.basement_door
  - binary_sensor.laundry_room_sensor_motion
  - binary_sensor.garage_patio_door
  - binary_sensor.living_room_motion
  - binary_sensor.front_door
  - binary_sensor.garage_dining_door
  - binary_sensor.laundry_motion
  - binary_sensor.openclose_35
  - binary_sensor.kitchen_sensor_motion
allsensors:
  - binary_sensor.basement_door
  - binary_sensor.laundry_room_sensor_motion
  - binary_sensor.garage_patio_door
  - binary_sensor.living_room_motion
  - binary_sensor.front_door
  - binary_sensor.garage_dining_door
  - binary_sensor.laundry_motion
  - binary_sensor.openclose_35
  - binary_sensor.kitchen_sensor_motion
ignore_open_sensors: false
code_to_arm: false
panel_locked: false
passcode_attempts: -1
passcode_attempts_timeout: 900
changedbyuser: HA
panic_mode: ACTIVE
arm_state: disarmed
enable_night_mode: true
enable_persistence: true
enable_log: true
log_size: 10
supported_statuses_on:
  - 'on'
  - 'true'
  - unlocked
  - open
  - detected
  - motion
  - motion_detected
  - motion detected
supported_statuses_off:
  - 'off'
  - 'false'
  - locked
  - closed
  - undetected
  - no_motion
  - standby
updateUI: false
default_images_path: /config/custom_components/bwalarm/resources/images
override_images_path: /config/resources/bwalarm/images
default_icon_name: ha.png
admin_password: d98a543d08e173326609d0db3b716ccfbcc9ff2240ce8aa6debac1e7522b197e
py_version:
  - 3
  - 8
  - 3
  - final
  - 0
users:
  - id: cb74cc09c7e94cef98d1d2323a1f48eb
    name: Hass.io
    enabled: false
    code: cb74cc09c7e94cef98d1d2323a1f48eb
    picture: ha.png
    disable_animations: false
  - id: 6f69963d5e674d2d9c718421147fe1aa
    name: Jacob Hopkins
    enabled: false
    code: 6f69963d5e674d2d9c718421147fe1aa
    picture: ha.png
    disable_animations: false
  - id: 082d4ade49814250b1d8efa38fe97ac2
    name: Home Assistant Cast
    enabled: false
    code: 082d4ade49814250b1d8efa38fe97ac2
    picture: ha.png
    disable_animations: false
  - id: 8749bcfe18a84e4f8f5c406c879b0e82
    name: Home Assistant Cloud
    enabled: false
    code: 8749bcfe18a84e4f8f5c406c879b0e82
    picture: ha.png
    disable_animations: false
  - id: c0f3d254047843f99ce367871a3597f9
    name: mqttuser
    enabled: false
    code: c0f3d254047843f99ce367871a3597f9
    picture: ha.png
    disable_animations: false
  - id: c19565228ce14812a11acae499009191
    name: Ashley Phelan
    enabled: false
    code: c19565228ce14812a11acae499009191
    picture: ha.png
    disable_animations: false
  - id: 85cb28cedef746f6b0c5bb697c5334ba
    name: Ashley Phelan
    enabled: false
    code: 85cb28cedef746f6b0c5bb697c5334ba
    picture: ha.png
    disable_animations: false
panel:
  cameras:
    - camera.drwy
  panel_title: ''
  camera_update_interval: ''
  enable_sensors_panel: 'True'
  enable_camera_panel: 'False'
  round_buttons: 'True'
  enable_serif_font: 'False'
  shadow_effect: 'True'
  hide_sensors: 'True'
  hide_sidebar: 'True'
  enable_fahrenheit: 'True'
  hide_passcode: 'True'
  enable_clock_12hr: 'True'
  enable_weather: 'True'
  enable_clock: 'True'
  enable_floorplan_panel: 'False'
  enable_custom_panel: 'True'
logs:
  - - 1595781332.098108
    - HA
    - 5
    - binary_sensor.front_door
  - - 1595781338.553581
    - HA
    - 0
    - null
  - - 1595781626.801357
    - HA
    - 4
    - null
  - - 1595783376.2104247
    - HA
    - 0
    - null
  - - 1595806962.6548433
    - HA
    - 4
    - null
  - - 1595809779.2573075
    - HA
    - 0
    - null
  - - 1595819466.2466164
    - HA
    - 8
    - null
  - - 1595856649.6638277
    - HA
    - 0
    - null
  - - 1595866986.3849475
    - HA
    - 4
    - null
  - - 1595866999.5535555
    - HA
    - 0
    - null
mqtt:
  enable_mqtt: false
  qos: 0
  payload_arm_away: ARM_AWAY
  payload_arm_night: ARM_NIGHT
  payload_disarm: DISARM
  pending_on_warning: false
  command_topic: home/alarm/set
  payload_arm_home: ARM_HOME
  override_code: false
  state_topic: home/alarm
states:
  armed_away:
    immediate:
      - binary_sensor.front_door
      - binary_sensor.openclose_35
      - binary_sensor.basement_door
      - binary_sensor.garage_patio_door
      - binary_sensor.laundry_room_sensor_motion
      - binary_sensor.laundry_motion
      - binary_sensor.kitchen_sensor_motion
    delayed:
      - binary_sensor.garage_dining_door
      - binary_sensor.front_door
      - binary_sensor.living_room_motion
    override:
      - binary_sensor.bedroom_door_contact
    pending_time: 60
    warning_time: 60
    trigger_time: 600
    check_before_arm:
      - binary_sensor.basement_door
      - binary_sensor.laundry_room_sensor_motion
      - binary_sensor.garage_patio_door
      - binary_sensor.living_room_motion
      - binary_sensor.front_door
      - binary_sensor.garage_dining_door
      - binary_sensor.laundry_motion
      - binary_sensor.openclose_35
      - binary_sensor.kitchen_sensor_motion
  armed_home:
    immediate:
      - binary_sensor.front_door
      - binary_sensor.openclose_35
      - binary_sensor.garage_patio_door
    delayed: []
    override:
      - binary_sensor.bedroom_door_contact
      - binary_sensor.laundry_room_sensor_motion
      - binary_sensor.laundry_motion
    pending_time: 0
    warning_time: 0
    trigger_time: 600
    check_before_arm:
      - binary_sensor.front_door
      - binary_sensor.openclose_35
      - binary_sensor.garage_patio_door
  armed_night:
    immediate:
      - binary_sensor.front_door
      - binary_sensor.openclose_35
      - binary_sensor.basement_door
      - binary_sensor.garage_dining_door
      - binary_sensor.garage_patio_door
      - binary_sensor.laundry_room_sensor_motion
      - binary_sensor.laundry_motion
    delayed: []
    override:
      - binary_sensor.bedroom_door_contact
    pending_time: 0
    warning_time: 0
    trigger_time: 600
    check_before_arm:
      - binary_sensor.basement_door
      - binary_sensor.laundry_room_sensor_motion
      - binary_sensor.garage_patio_door
      - binary_sensor.front_door
      - binary_sensor.garage_dining_door
      - binary_sensor.laundry_motion
      - binary_sensor.openclose_35
friendly_name: House
supported_features: 15
akasma74 commented 4 years ago

Yaml

Where did you get it from? It's not bwalarm.yaml, it's more like what Delevoper tools -> States shows (and it's not the same).

gdtms247 commented 4 years ago

bwalarm.yaml below for his HA deployment

platform: bwalarm
panel:
  cameras:
  - camera.drwy
  panel_title: ''
  camera_update_interval: ''
  enable_sensors_panel: 'True'
  enable_camera_panel: false
  round_buttons: 'True'
  enable_serif_font: false
  shadow_effect: 'True'
  hide_sensors: 'True'
  hide_sidebar: 'True'
  enable_fahrenheit: 'True'
  hide_passcode: 'True'
  enable_clock_12hr: 'True'
  enable_weather: 'True'
  enable_clock: 'True'
  enable_floorplan_panel: 'False'
  enable_custom_panel: 'True'
enable_night_mode: true
states:
  armed_away:
    immediate:
    - binary_sensor.front_door
    - binary_sensor.openclose_35
    - binary_sensor.basement_door
    - binary_sensor.garage_patio_door
    - binary_sensor.laundry_room_sensor_motion
    - binary_sensor.laundry_motion
    - binary_sensor.kitchen_sensor_motion
    delayed:
    - binary_sensor.garage_dining_door
    - binary_sensor.front_door
    - binary_sensor.living_room_motion
    override:
    - binary_sensor.bedroom_door_contact
    pending_time: 60
    warning_time: 60
    trigger_time: 600
  armed_home:
    immediate:
    - binary_sensor.front_door
    - binary_sensor.openclose_35
    - binary_sensor.garage_patio_door
    delayed: []
    override:
    - binary_sensor.bedroom_door_contact
    - binary_sensor.laundry_room_sensor_motion
    - binary_sensor.laundry_motion
    pending_time: 0
    warning_time: 0
    trigger_time: 600
  armed_night:
    immediate:
    - binary_sensor.front_door
    - binary_sensor.openclose_35
    - binary_sensor.basement_door
    - binary_sensor.garage_dining_door
    - binary_sensor.garage_patio_door
    - binary_sensor.laundry_room_sensor_motion
    - binary_sensor.laundry_motion
    delayed: []
    override:
    - binary_sensor.bedroom_door_contact
    pending_time: 0
    warning_time: 0
    trigger_time: 600
users:
- id: cb74cc09c7e94cef98d1d2323a1f48eb
  name: Hass.io
  enabled: false
  code: cb74cc09c7e94cef98d1d2323a1f48eb
  picture: ha.png
- id: 6f69963d5e674d2d9c718421147fe1aa
  name: Jacob 
  enabled: false
  code: 6f69963d5e674d2d9c718421147fe1aa
  picture: ha.png
- id: 082d4ade49814250b1d8efa38fe97ac2
  name: Home Assistant Cast
  enabled: false
  code: 082d4ade49814250b1d8efa38fe97ac2
  picture: ha.png
- id: 8749bcfe18a84e4f8f5c406c879b0e82
  name: Home Assistant Cloud
  enabled: false
  code: 8749bcfe18a84e4f8f5c406c879b0e82
  picture: ha.png
- id: c0f3d254047843f99ce367871a3597f9
  name: mqttuser
  enabled: false
  code: c0f3d254047843f99ce367871a3597f9
  picture: ha.png
- id: c19565228ce14812a11acae499009191
  name: Ashley 
  enabled: false
  code: c19565228ce14812a11acae499009191
  picture: ha.png
- id: 85cb28cedef746f6b0c5bb697c5334ba
  name: Ashley
  enabled: false
  code: 85cb28cedef746f6b0c5bb697c5334ba
  picture: ha.png
enable_persistence: true