YET another take on an alarm system


#1467

Is anyone else unable to arm/disarm in lovelace? Service gets called, but nothing happens.

Automations work as intended, and I am able to arm/disarm from the states ui. Noticed the change after upgrading to 0.85.


#1468

Just upgraded Hass.io to 0.86.1, and the log is full of this:

2019-01-24 16:25:19 ERROR (MainThread) [frontend.js.es5.201811211] http://xxx.xxx.xxx.xxx:8123/api/panel_custom/alarm:2059:42 Uncaught TypeError: Cannot read property ‘state’ of undefined

The culprit is this code:

// Close the sidebar if alarm is set and the option is enabled
closeSidebar(instance){
if (instance) if (instance.alarm.state != ‘disarmed’)
instance.fire(‘hass-close-menu’);
}

Ended up commenting the body of the function (as it will only affect hiding that sidebar).
Could anyone check if they see the same?

p.s I hoped that the developers will fix __ issue and let us have something like input_text.pir__code… but apparently they forbid it, and now print a suggestion like
“Consider changing it to input_text.pir_code”. You can still have __ in automation names unless you want to turn them on/off, but you can’t name your python_script init__whatever…
Oh, well…


#1469

I did a pull request with the following on github. My keypad is back on lovelace after restart/cache clear running 0.86.

Line 688

    @property
    def code_format(self):
        """One or more characters."""
        if self._code is None:
            return None
        if isinstance(self._code, str) and re.search('^\\d+$', self._code):
            return alarm.FORMAT_NUMBER
        return alarm.FORMAT_TEXT

instead of:

    @property
    def code_format(self):
        """One or more characters."""
        return None if self._code is None else '.+'

#1470

I tried your suggestion, but it looks like it doesnt work:

Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/lib/python3.5/asyncio/tasks.py", line 239, in _step
    result = coro.send(None)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity_platform.py", line 352, in _async_add_entity
    await entity.async_update_ha_state()
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity.py", line 239, in async_update_ha_state
    attr = self.state_attributes or {}
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/alarm_control_panel/__init__.py", line 163, in state_attributes
    ATTR_CODE_FORMAT: self.code_format,
  File "/home/homeassistant/.homeassistant/custom_components/alarm_control_panel/bwalarm.py", line 694, in code_format
    return alarm.FORMAT_NUMBER
AttributeError: module 'homeassistant.components.alarm_control_panel' has no attribute 'FORMAT_NUMBER'

#1471

I should have clarified that it is a fix for 0.86. I had also changed the ruamel.yaml requirement suggested by @aidbish in post #1441 as well.


#1472

Anyone else missing the keypad after the 0.86.2 update + an error when opening the Alarm menu: Could not connect to the service: alarm_control_panel\ALARM_YAML_USER ?


#1473

Changes done to get things working:

bwalarm.py:

And @aidbish line 22:

REQUIREMENTS = ['ruamel.yaml==0.15.42']

To:

REQUIREMENTS = ['ruamel.yaml>=0.15.42']

Thanks guys!

Though my password box is still filled with random ********* chars, any idea?


#1474

Absolutely brilliant!

Nice with some skilled people in here! Thank you!


#1476

I ordered a Kerui outdoor solar panel, it should be controllable by a 433mhz signal, for which you can use Broadlink RM or Sonoff RF bridge


#1477

I use a z-wave siren, but if you can find an RF one that you can send MQTT commands to there is no reason I can think of why it won’t work.


#1478

Hey, you should check out my post on how I got a Kerui siren working with HA.


#1480

I think that’s my problem, knowing whether the siren accepts RF codes to turn on and off. Seeing as it’s wireless, I suppose it must do.


#1481

Just another note on my z-wave siren, it does have a battery backup built in. I plan to run my HA server on a UPS so getting the siren to trigger during a power outage is no issue. I just haven’t purchased the UPS yet.


#1483

I did not receive the 433MHz siren, but I understood that you turn it ON with a 433Mhz signal. I plan to use my existing sonoff RF bridge to do that


#1484

Sorry, but it has nothing to do with this alarm system, it is?
Could you discuss the details in the appropriate topic? This one is way too long anyway


#1486

Good day,
I am new to home assistant. Can someone assist me in configuring manual alarm panel?
I am trying to use a door sensor to trigger alarm when it is armed away or armed home but it is not working. This is what I have:

the alarm panel is:

```
alarm_control_panel:
  - platform: manual
name: Home Alarm
code: ------
pending_time: 30
delay_time: 20
trigger_time: 4
disarmed:
  trigger_time: 0
armed_home:
  pending_time: 0
  delay_time: 0
armed_away:
  pending_time: 30
  delay_time: 60
triggered:
  pending_time: 0
```

# binary_sensor for Main Front Door
binary_sensor:
    - platform: mqtt
      state_topic: "/tele/sonoff-rf/RESULT"
      name: 'Main_Entrance'
      value_template: '{{value_json.RfReceived.Data}}'
      payload_on: '2E9F0A'
      payload_off: '2E9F0E'
      device_class: door
      optimistic: false
      qos: 1
      retain: false 

Automation.YAML

 - alias: Trigger alarm while armed home or away
            trigger:
              - platform: state
                entity_id: binary_sensor.main_entrance
                to: 'on'    
                
            condition:
              condition: or
              conditions: 
              - condition: state
                entity_id: alarm_control_panel.alarm
                state: armed_away
              - condition: state
                entity_id: alarm_control_panel.alarm
                state: armed_home
            action:
              service: alarm_control_panel.alarm_trigger
              entity_id: alarm_control_panel.alarm

          - alias: Alarm Triggered
            trigger:
              - platform: state
                entity_id: alarm_control_panel.alarm
                to: 'triggered'
            action:
              - service: notify.notify
                data:
                  message: "!Alarm Triggered!"

Any help will be greatly appreciated. Thanks.


#1487

You could install the custom alarm panel that this topic is about.


#1488

I tried but I do not know how to do it. Instructions not clear to me. Im a newbie


#1489

What exactly is not clear?


#1490

Okay let me tell you what I tired. I copied thefollowing into configuration.yaml:

alarm_control_panel: !include alarm.yaml
panel_custom: !include panel_custom.yaml

Then created alarm.yaml and paste the raw code of alarm.yaml into the newly created alarm.yaml. I also copied the raw code of automation.yaml into my newly created automation.yaml. Then created panel_custom.yaml and copied the raw code into my newly created panel_custom.yaml. Then I saved bwalarm.py into config/ directory. Nothing works. I got an invalid config messgae saying:

Configuration invalidCHECK CONFIG

Platform not found: alarm_control_panel.bwalarm