Bwalarm (akasma74 edition)

Ahh :slight_smile:
So the next HACS release, not HA :wink:

Misunderstood it, youā€™re right. Will correct my post

Hi Ahmad,
Tried your 1.6.0b version today with the new directory structure for HACS. It seemed to work OK, so I removed the old files and directories (after a backup!) and restarted Hassio. The Lovelace alarm panel is still looking for alarm.html in /config/panels. I moved that back and the original contents of the www directory, but the Lovelace alarm panel still gets an error trying to alarm the system:

> 2019-06-22 21:02:10 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection.1825802288] async_alarm_arm_away() missing 1 required positional argument: 'ignore_open_sensors'
> Traceback (most recent call last):
>   File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 121, in handle_call_service
>     connection.context(msg))
>   File "/usr/src/homeassistant/homeassistant/core.py", line 1150, in async_call
>     self._execute_service(handler, service_call))
>   File "/usr/src/homeassistant/homeassistant/core.py", line 1172, in _execute_service
>     await handler.func(service_call)
>   File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 194, in handle_service
>     required_features
>   File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 316, in entity_service_call
>     future.result()  # pop exception if have
>   File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 337, in _handle_service_platform_call
>     await getattr(entity, func)(**data)
> TypeError: async_alarm_arm_away() missing 1 required positional argument: 'ignore_open_sensors'

Your panel is working fine so itā€™s not a big problem.

first of all, have you changed your configuration.yalm?
it should not contain

panel_custom: !include panel_custom.yaml

and itā€™s in the Readme.

Also, every time you update it is mandatory to clear cache of ALL your browsers that access alarm page.

Hope it helps

Yep, have the panel_custom line in my config. Didnā€™t change anything in there. Exited out and cleared cache on my tablets and browsers. Removed the panels directory in /config and the old alarm directories in /config/www. Rebooted and the same errror:

2019-06-23 09:24:55 WARNING (MainThread) [homeassistant.loader] You are using a custom integration for bwalarm which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you do experience issues with Home Assistant.
2019-06-23 09:25:36 ERROR (MainThread) [homeassistant.components.panel_custom] Unable to find webcomponent for alarm: /config/panels/alarm.html
2019-06-23 09:25:36 ERROR (MainThread) [homeassistant.setup] Setup failed for panel_custom: Component failed to initialize.
2019-06-23 09:25:36 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of hassio. Setup failed for dependencies: panel_custom
2019-06-23 09:25:36 ERROR (MainThread) [homeassistant.setup] Setup failed for hassio: Could not set up all dependencies.

If I try and arm the alarm via the Lovelace panel I get this:

2019-06-23 09:27:24 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection.1961278576] async_alarm_arm_home() missing 1 required positional argument: 'ignore_open_sensors'
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 121, in handle_call_service
    connection.context(msg))
  File "/usr/src/homeassistant/homeassistant/core.py", line 1150, in async_call
    self._execute_service(handler, service_call))
  File "/usr/src/homeassistant/homeassistant/core.py", line 1172, in _execute_service                      
    await handler.func(service_call)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 194, in handle_service     
    required_features       
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 316, in entity_service_call         
    future.result()  # pop exception if have
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 337, in _handle_service_platform_call
    await getattr(entity, func)(**data)
TypeError: async_alarm_arm_home() missing 1 required positional argument: 'ignore_open_sensors'            

Remove that

1 Like

No change if I remove it.

Not sure why it would matter, but I didnā€™t see any errors in the logs after I installed the latest version until I finally rebooted Hassio. Iā€™m running the latest version of Hassio.

hello
i am getting this log

  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 126, in _async_setup_platform
    SLOW_SETUP_MAX_WAIT)
  File "/usr/local/lib/python3.7/asyncio/tasks.py", line 416, in wait_for
    return fut.result()
  File "/config/custom_components/bwalarm/alarm_control_panel.py", line 410, in async_setup_platform
    alarm = BWAlarm(hass, config, mqtt)
  File "/config/custom_components/bwalarm/alarm_control_panel.py", line 431, in __init__
    self.init_variables()
  File "/config/custom_components/bwalarm/alarm_control_panel.py", line 570, in init_variables
    arm_states_dict = self._config[CONF_STATES]
KeyError: 'states'

and cannot run alarm -(

remove it and restart Home Assistant. Post the error log here.

Please read this, I wrote it exactly because of your initial post :wink:

Home Assistant: v0.94.4

This Panel: v1.3.8_ak74

Iā€™ve cleared all cache and even installed Chrome on a tablet so there was no possible way anything was cached. With the ā€œpanel_customā€ include commented out of my configuration.yaml I donā€™t get the error:

Unable to find webcomponent for alarm: /config/panels/alarm.html

I do still have the Lovelace panel for the alarm. If I press Arm Away or Arm Home from that panel I get the error message from a browser that has never connected to Hassio so it definitely isnā€™t cached:

2019-06-23 12:18:02 WARNING (MainThread) [homeassistant.loader] You are using a custom integration for bwalarm which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you do experience issues with Home Assistant.
2019-06-23 12:23:02 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection.1830652688] async_alarm_arm_away() missing 1 required positional argument: 'ignore_open_sensors'
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 121, in handle_call_service
    connection.context(msg))
  File "/usr/src/homeassistant/homeassistant/core.py", line 1150, in async_call
    self._execute_service(handler, service_call))
  File "/usr/src/homeassistant/homeassistant/core.py", line 1172, in _execute_service                      
    await handler.func(service_call)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 194, in handle_service     
    required_features       
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 316, in entity_service_call         
    future.result()  # pop exception if have
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 337, in _handle_service_platform_call
    await getattr(entity, func)(**data)
TypeError: async_alarm_arm_away() missing 1 required positional argument: 'ignore_open_sensors'

Again, the Bwalarm panel (your code) is working fine. This just affects the Lovelace alarm panel that I almost never use.

is it good or bad? if you use the latest release, there is no need to have /config/panels/alarm.html as itā€™s inside /bwalarm custom component folder.

that it not the recommended way as the component was around long before Lovelace and thereā€™s no confirmation in the docs that it WORKS with Lovelaceā€™s alarm card (I even know why, surprise).
Have a look at this discussion

I donā€™t use the Lovelace card, but itā€™s there by default and gives a big fat error message now. So, in the documentation maybe we should note that itā€™s now broken, donā€™t use it, and in fact disable the card so it doesnā€™t appear. Also, we should note in the documentation that having:

panel_custom: !include panel_custom.yaml

in your configuration.yaml will also result in an error if you are upgrading from a previous version.

Not trying to be rude but the documentation clearly states to remove that line from the configuration.yaml

I, too, am getting the same errors as mclaudiopt.

File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 126, in _async_setup_platform
    SLOW_SETUP_MAX_WAIT)
  File "/usr/local/lib/python3.7/asyncio/tasks.py", line 416, in wait_for
    return fut.result()
  File "/config/custom_components/bwalarm/alarm_control_panel.py", line 410, in async_setup_platform
    alarm = BWAlarm(hass, config, mqtt)
  File "/config/custom_components/bwalarm/alarm_control_panel.py", line 431, in __init__
    self.init_variables()
  File "/config/custom_components/bwalarm/alarm_control_panel.py", line 570, in init_variables
    arm_states_dict = self._config[CONF_STATES]
KeyError: 'states'

I followed all of the recommendations, reboot HA, clear cache. I even went as far as rebooting the machine running HA. I also tried adding the line:

frontend:
  javascript_version: latest

Any thoughts?

where? I added one myself just for its badge and I can see no errors.

broken what? again, there was never anything about this component being compatible with Lovelace.

Did you read the release notes and followed them?

It has nothing to do with javascript.
Is your alarm.yaml the default one?
If not, can you post it here?

UPDATE: the potential fix is here, please test and report back.

Yes, I am using the default alarm.yaml

I will try the fix you posted and report back soon. Thank you for all your work on this! It is really great.

This appears to be the fix for my issue. I have the panel working now. Thank you very much!!!

1 Like

Hey @AhmadK,
I was previously using Yet Another Take on an Alarm, but only just recently got back into using HA for my alarm.
Iā€™m extremely impressed with the work youā€™ve done and canā€™t thank you enough!

1 Like