YET another take on an alarm system

Thanks - updating the bwalarm.py file worked for me.

@gazaoscalvertos - are there any screenshots of the new UI and instructions on how to change?

1 Like

I would also like this info

Just tried the latest version and getting same error but laos in the log i get this

2018-10-26 00:11:56 EROR (MainThread) [frontend.js.latest.201810240",

description="The Home Assistant frontend",
url="https://github.com/home-assistant/home-assistant-polymer",
author="The Home Assistant Authors",
author_email="[email protected]",
license="Apache License 2.0",
packages=find_packages(
    include=[
        "hass_frontend",
        "hass_frontend_es5",
        "hass_frontend.*",
        "hass_frontend_es5.*",


),
install_requires=[ā€œuser-agents==1.1.0ā€],
include_package_data=True,
zip_safe=False,
)
] http://hass.faronyx.com:8123/api/panel_custom/alarm:377:72 Uncaught TypeError: Cannot read property ā€˜disarmedā€™ of undefined

hello all, maybe this script work with xiaomi aqara ? because i have tested not work for me :frowning:

Any luck with the new ui and instructions etc

Hi all,

Wellā€¦ after debuggin the code I get this.

On line 575 from last version of bwalarm.py whe have this:

 elif new_state == STATE_ALARM_PENDING:
                _LOGGER.debug("[ALARM] Pending user leaving house")
                self._hass.services.call("switch", "turn_on", {self._warning})
                self._timeoutat = now() + datetime.timedelta(seconds=self._pending_time_by_state[self._armstate])
                #self._returnto = STATE_ALARM_ARMED_AWAY
                self.setsignals(self._armstate)

this is the code that blocks my HA to start. If I replace
self._hass.services.call("switch", "turn_on", {self._warning})

by old code

switch.turn_on(self._hass, self._warning)

My HA starts but alarm still not working, any idea?

Has anybody installed this on the Hass.io version?

I have had it running on HassIO since the first version. Seems to be working fine

@sparkydave
So, admittedly Iā€™m a bit of a Newbā€¦ how did you install it? I thought the point of the Hass docker container was I couldnā€™t access the base HA environment, and if I did, it would get overwritten when I update the Hass.io version?

To install you copy a few files to specific places in your config folder. It does not alter the base image. Then configure a couple of YAML files. Read the installation instructions here:

as Tom said above, it is just a matter of having the right files in the right locations. There is no ā€˜installationā€™ as such, in the way you would consider installing applications.

One very easy way to do it is to first install (this one is actually an install) the ā€˜Cloud 9 IDEā€™ HassIO add-on from the add-on store. This lets you open a second browser window where you can see, edit and add the yaml files very nicely. I use it as my main yaml editor. Once you have this installed it will make setting up the alarm system (and all of your other yaml editing) a lot easier.

Yea, thanks guys, I was being dumb, I do see now thatā€™s itā€™s just /config files. Iā€™ve got the basic install done, now I just need to setup my automations and things.

Hi All,

Not sure if someone found a fix but my alarm has stopped working after version 0.81 upgrade. I got the latest files from the github but still same issue. I read through some posts and it seems people are having similar issues with bwalarm.py.

Please let me know if you have found a solution to the issue.

Update: Seems like issue between MQTT and Alarm. Below is the log message:

Error doing job: Exception in callback <bound method MQTT._mqtt_handle_message of <homeassistant.components.mqtt.MQTT object at 0x7f8e16fe5908>>

Traceback (most recent call last):
  File "uvloop/cbhandles.pyx", line 66, in uvloop.loop.Handle._run
  File "/usr/local/lib/python3.6/site-packages/homeassistant/components/mqtt/__init__.py", line 749, in _mqtt_handle_message
    subscription.callback, msg.topic, payload, msg.qos)
  File "/usr/local/lib/python3.6/site-packages/homeassistant/core.py", line 327, in async_run_job
    target(*args)
  File "/config/custom_components/alarm_control_panel/bwalarm.py", line 668, in message_received
    self.alarm_arm_away('')
  File "/config/custom_components/alarm_control_panel/bwalarm.py", line 485, in alarm_arm_away
    self.process_event(Events.ArmAway)
  File "/config/custom_components/alarm_control_panel/bwalarm.py", line 577, in process_event
    self._hass.services.call("switch", "turn_on", {self._warning})
  File "/usr/local/lib/python3.6/site-packages/homeassistant/core.py", line 1070, in call
    self._hass.loop
  File "/usr/local/lib/python3.6/site-packages/homeassistant/util/async_.py", line 138, in run_coroutine_threadsafe
    raise RuntimeError('Cannot be called from within the event loop')
RuntimeError: Cannot be called from within the event loop

Thanks,
RT

If the alarm was triggered, it would be nice to disarm it by actionable push notification sent to mobile, instead of remembering the PIN.

You can do that by including the PIN in the disarm service call that you assign to the push notification reply button

1 Like

Still getting this error when arming and disarming, works fine just error not sure why
2018-11-02 14:55:38 ERROR (MainThread) [homeassistant.core] Invalid service data for switch.turn_off: expected a dictionary. Got {ā€˜automation.alarm_warningā€™}

Copy and paste your arm and disarm automations here. Sounds like something is amiss with them.

Noting has changed except the latest home assistant update (when I went .81) and the new bwalarm.py (which fixed system not working after update
But here they are
- id: alarm_armed_away
alias: ā€˜[Alarm] Away Mode Armedā€™
trigger:

  • entity_id: alarm_control_panel.house
    platform: state
    to: armed_away
    action:
  • data:
    message: Alarm Away Mode Armed
    service: notify.pushbullet
  • data:
    entity_id: media_player.kelvins_echo
    message: Alarm Away Mode Armed
    service: media_player.alexa_tts
  • alias: ā€˜ā€™
    data:
    entity_id: script.arm_house
    service: script.turn_on
  • data:
    entity_id: lock.touchscreen_deadbolt_23
    service: lock.lock
  • id: alarm_armed_home
    alias: ā€˜[Alarm] Home Mode Armedā€™
    trigger:
    • entity_id: alarm_control_panel.house
      platform: state
      to: armed_home
      action:
    • data:
      message: Alarm Home Mode Armed
      service: notify.pushbullet
    • data:
      message: The house alarm has been switched on in home mode. Goodnight
      service: notify.example_phone_tts
  • id: alarm_arming_away
    alias: ā€˜[Alarm] Away Mode Armingā€™
    trigger:
    • entity_id: alarm_control_panel.house
      platform: state
      to: pending
      action:
    • data:
      entity_id: media_player.kelvins_echo
      message: Away Mode Arming
      service: media_player.alexa_tts
  • id: alarm_disarmed
    alias: ā€˜[Alarm] Disarmedā€™
    trigger:
    • entity_id: alarm_control_panel.house
      platform: state
      to: disarmed
      action:
    • data:
      message: Alarm Disabled
      service: notify.pushbullet
    • data:
      entity_id: switch.foscam_lounge_arm
      service: switch.turn_off
    • data:
      entity_id: switch.dlink_garage_arm
      service: switch.turn_off
    • data:
      entity_id: switch.siren_46
      service: switch.turn_off
    • data:
      entity_id: media_player.kelvins_echo
      message: Welcome Home Alarm Disarmed
      service: media_player.alexa_tts
  • id: alarm_triggered
    alias: ā€˜[Alarm] Triggeredā€™
    trigger:
    • entity_id: alarm_control_panel.house
      platform: state
      to: triggered
      action:
    • data:
      entity_id: script.1532570113808
      service: script.turn_on
    • data:
      message: ALARM TRIGGERED!!! {{ states[states.alarm_control_panel.house.attributes.changed_by.split(".")[0]][
      states.alarm_control_panel.house.attributes.changed_by.split(".")[1]].name
      }}
      service: notify.pushbullet

Can you give as the example code, please?