Bwalarm (akasma74 edition)

Hi buddy, how are you progressing on the fix? can’t wait!

@AhmadK Just thought I’d let you know that I’m back to using this component (from trying out my own manual alarm) as this provides better notification ability as to which sensor triggered the alarm. Not having the side panel is of no concern to me as I use wireless remotes to Arm/Disarm anyway and once the config code is set in YAML, its not needed again.

Your work on this component is much appreciated.

Cheers,

Dave

To be honest, I’m still at the state of gathering information, mainly because of my everyday offline commitments (yes, I know it’s been a long time ago - still tidying up things).
Christmas is looming with its duties but I hope to dedicate more time and start doing soon.

Thank you and everyone who is still waiting patiently.

2 Likes

Obviously, real life first! No doubt! Thank you for the update!

I’ve just released a new vereion for those using panel view and HA < 0.115
It isn’t a long waited fix (yet!) but a security improvement.

Thanks for your waiting.

p.s it is recommended to install the latest version if you run v1.12.8

Hi All,

I hope you can help me with getting this alarm panel to work as I love the look of it.
I have installed it manually and via HACS with the same outcome.
I have double and triple checked the installation documentation but I cant get it to work.
So what I have done:
alarm_control_panel: !include resources/bwalarm/bwalarm.yaml in configuration.yaml
platform: bwalarm
name: house in bwalarm.yaml
Coppy all the files and folders to:
\config\resources\bwalarm
\config\custom_components\bwalarm
click add card on the dashboard and then alarm card.
The alarm card shows but when I click arm/disarm I see the following error.
Failed to call service alarm_control_panel/alarm_arm_home. ‘states’

Have you tried to control your alarm from its own panel (on the left in HA) (as soon as you are using HA older than 0.105)?
The thing is this custom component is not 100% compatible with the standard alarm card and therefore nothing can be guaranteed.

The control panel is not working and if i open myhaurl/alarm i get 404 unavailable :frowning:

Well, it’s expectable if your HA is newer than 0.105.
Feel free to open a new issue here.

Hi Im setting up from scratch a new HA, hacs HA Switchplate and BwAlarm.

I have most things working except I cannot arm or disarm from my HA switch plate.

Below is my bwalarm.yaml file. Not sure if mqtt commands are correct. When using the lovelace control it updates the HA Switchplate display.

platform: bwalarm
panel:
  cameras: []
  panel_title: Alarm
  enable_sensors_panel: 'True'
  hide_sidebar: 'false'
  camera_update_interval: ''
  enable_custom_panel: false
  hide_passcode: 'True'
  round_buttons: false
  shadow_effect: false
  enable_serif_font: false
enable_night_mode: false
states:
  armed_away:
    immediate:
    - binary_sensor.spare_office
    delayed:
    - binary_sensor.entry
    override: []
    pending_time: '5'
    warning_time: 30
    trigger_time: 180
  armed_home:
    immediate:
    - binary_sensor.spare_office
    delayed:
    - binary_sensor.entry
    override: []
    pending_time: 60
    warning_time: 25
    trigger_time: 180
users:
- id: 39642758223b4835abc3063cb47877b1
  name: Test
  enabled: true
  code: '1111'
  picture: ha.png

admin_password: a
mqtt:
  enable_mqtt: true
  command_topic: home/alarm/set
  payload_arm_night: ARM_NIGHT
  qos: '0'
  payload_arm_home: ARM_HOME
  override_code: false
  payload_disarm: DISARM
  state_topic: home/alarm
  payload_arm_away: ARM_AWAY
  pending_on_warning: false
passcode_attempts: '20'
passcode_attempts_timeout: '60'
enable_persistence: true
code: '1234'
ignore_open_sensors: true
themes:
- name: Theme
  warning_color: '#FFFFFF'
  pending_color: '#FFFFFF'
  active: true
code_to_arm: true
log_size: '30'

John:

Can your alarm panel be used with BWAlarm? I don’t want to rewrite all automations etc. I am looking for alternative while awaiting update to BWAlarm.

I installed your js file, but when I add "entity: alarm_control_panel.house ", it tells me “Cannot add property states, object is not extensible”.

BWAlarm does work with the Lovelace alarm card, but I liked what you did here, especially in terms of visibility.

Thanks
Chuck

Sorry, I haven’t tried with bwalarm since switching over to manual.
Does bwalarm work on latest HA? (I’m running HA 2021.4.x).
-John

I just updated to latest everything. 2021.3.4 is what loaded. BWAlarm is working with Lovelace panel (BW panel still not working since 115). But I have issues with the text and button visibility on stock Lovelace panel, so I tried yours, got the error. error

My Lovelace card has the following code:

entity: alarm_control_panel.house
states:
  - arm_home
  - arm_away
type: alarm-panel

When I tried your card I got the error as soon as I entered the type and entity lines
Chuck

Hmm.

I added “states” that were on the lovelace card (arm-home and arm_away), and it said it could not add property “scale”. So I added Scale, and it appears to be functional. Or at least no longer throws an error. I’ll need to test it tonight when I close up the windows.

entity: alarm_control_panel.house
type: 'custom:alarm_control_panel-card'
states:
  - arm_home
  - arm_away
scale: 25

Chuck

Thanks for the updates. Coincidentally, someone else just reported this issue to me as well- https://github.com/jcooper-korg/AlarmPanel/issues/4

Turns out I have a bug if the scale isn’t specified. I’ll look into a fix.
Sorry about that, and thanks for your patience!
-John

When you locate the bug on scale, you will likely find the same on states.

Also, probably not a bug, but the countdown timer does not work with BWAlarm. Probably works just fine for its intended purpose of Manual Alarm.

Thanks
Chuck

You’re right that there was the same issue for states and scale. I just pushed a fix in my alarm_control_panel-card.js which tests ok here. Let me know how it goes for you.

The countdown timer depends on a change I made in the manual alarm component to publish a state_duration attribute. I assume the same change could be made in the bwalarm component, but I haven’t looked.

-John

I experimented today with a modification to bwalarm/alarm_control_panel.py to get my countdown timer working, and it was pretty easy. Just need to add these two lines of code in the device_state_attributes function, like at line 772:

        if (self._state == STATE_ALARM_PENDING):
           results['state_duration'] = self._states[self._armstate][CONF_PENDING_TIME]
        elif (self._state == STATE_ALARM_WARNING):
           results['state_duration'] = self._states[self._armstate][CONF_WARNING_TIME]

like so:

With these changes, my card seems to work ok with bwalarm.

@AhmadK - do you want to add that to the main branch? or want me to send you a formal pull request?

-John

John:

Thanks so much for doing that! I’ll try it out tonight or tomorrow. Is it already incorporated in the downloadable version, or do I need to edit mine.

It is still not everything that BWAlarm had on the panel (all the setup, sensor readings, etc.), but your work is WAY better than the stock manual panel. I run a stacked card setup with your panel on top, and then an entity-filter card below that lists all sensors that are “open” at the time. Gets me most of what I need!

Thanks
Chuck