Custom Component: Crow Runner / Arrowhead AAP 8/16 Alarm IP Module

v0.25 is running on 105.0B1 as well so expect no issue on 105 release.

1 Like

I am going to try this soon. I have an Elite S with the correct firmware. Hopefully this replaces my existing Node-Red integration.
Is there anything in particular I need to know; how do I install a custom component?

Honestly all 3 of us here tried it only on Crow Runner Panels. But since Elite S is compatible with runner panels, it should be of no problem. Still, you will be the first one to try


Installing custom component is easy. You have to create a ‘custom_components’ folder under ‘config’ directory, create a ‘crowipmodule’ folder under ‘custom_components’ and copy all files on https://github.com/febalci/ha_pycrowipmodule/tree/master/custom_components/crowipmodule under this folder. Restart Home Assistant; add crowipmodule config settings in configuration.yaml an restart Home Assistant once again. Sample configuration is under https://github.com/febalci/ha_pycrowipmodule/blob/f7faead9214ef2feea82880c191b3adf6a3c9b40/sample_configuration.yaml. Good Luck and feed us with the outcome please.

Thanks for your instruction. I had an initial test and this looks good:

  • installed component
  • added config
  • added new entities via lovelace
  • motion sensors work
  • output control works (is there a way to change name “Crow output [name]” to remove Crow Output?)

This behaviour seem strange:

  • arm away works ONLY if I put a code in the panel and then press arm away
  • arm stay works if I press “arm away” with no code required

Background:
There are no alarm codes recorded in my config yaml file.
In normal use on the physical alarm I can press “away” and it activates the away alarm mode. I do not have to enter a code.
I do not use the home / stay mode currently so have not paid attention to that setup on the alarm. Is there a way to remove that option?
Is the above intended behaviour or do I have to tweak my actual alarm panel?

This looks awesome though so many thanks for making.

Also how often does the “Crow Alarm System” ite get updated? I unplugged the network cable to the alarm but it still reads true. I would have expected to to change to false so there was a way of knowing if there was a communication issue between HA and alarm.

crow_alarm_system boolean state comes from the ‘mains’ attribute. So it only turns ‘false’ if there is an electric power cut. Since you unplug the network cable only; it reflects the last known status of the power condition of your home.

output control works (is there a way to change name “Crow output [name]” to remove Crow Output?)

You can change the following line in switch.py (Line 49) to change the name of the Crow output:

self._name = "Crow Output " + output_name

For setting the alarm with the code was a necessity to support the alarm panel settings with a code arm_away. But if your setting is without a code; and if you don’t use a code in the configuration.yaml; you can change that in alarm_control_panel.py lines 161 and 162:

    async def async_alarm_arm_away(self, code=None):
        """Send arm away command."""

        if code:
            self.hass.data[DATA_CRW].send_keypress(str(code))
        else:
            self.hass.data[DATA_CRW].send_keypress(str(self._code))
#            self.hass.data[DATA_CRW].arm_away()

In this part; change the last 2 lines to this:

#           self.hass.data[DATA_CRW].send_keypress(str(self._code))
            self.hass.data[DATA_CRW].arm_away()

After you make the changes in the py files; restart Home Assistant.

Thanks I will check the code changes soon.

crow_alarm_system boolean state comes from the ‘mains’ attribute. So it only turns ‘false’ if there is an electric power cut. Since you unplug the network cable only; it reflects the last known status of the power condition of your home.

I’m trying to understand this. Is there a way to get an alert / disable things if network connection is broken? Or is that not the point of this section; it could alert e.g. on tampering?

Also is there a suitable way to integrate this as a cover in home assistant i.e. garage door. In my case an output controls the door and a sensor knows if door is open or not. So the data is available - I will explore using Template cover - Home Assistant unless this has been done before or anyone has ideas.

Honestly i never had network connection loss so far. I am using a wifi bridge for the ip module; so it is connected via wifi not a cable. And i had no problems so far. There is a section in the code wihch checks the connection; if it is broken it keeps trying to connect. I don’t really know if this works stable since i didn’t had a disconnection issue. It should be more of a Home Assistant side check, because there is no mechanism in the IP Module to check if a disconnection occurs.

It could alert you on tampering, power loss, battery low etc via automations.

Guess the integration with cover can be made. I made everything with automations; you can see details in this forum up above.

Re the network connection, I unplug my alarm from network as part of my testing as alarm gives access to some parts of property.

But had an interesting issue, my hassos instance restarted but web interface would not come up. Looking in logs via SSH the last thing was related to this component - and issues finding alarm (because network was unplugged). It seems like not being able to find the alarm caused entire system to hang. Might it be possible to handle network issues more gracefully?

In use, I monitor doors etc using alarm. But if network connection was lost (e.g. switch died) then HA would still say e.g. closed door, but in reality it might be open. It would be amazing if HA could show no network connection, so I would know not to trust the status of the doors.

Honestly i do not feel confident to handle this network disconnect problem,since i am still not very familiar with the HA architecture on component connections. As unlikely as a network failure happens (An unstable network means the user might have bigger problems than home assistant alone), yet your findings seem completely true.

If one day i can find a resembling custom component connection which handles this problem graciously, i might copy the error handling mechanism. But for now, it seems it is beyond my capabilities, sorry


I think checking the network status of the alarm can be easily done using the NMAP tracker. I use this for tracking phones and other devices for occupancy detection. It basically scans the IP addresses of a given IP range. This could be used to check the IP address of the IP Module. If the IP module is disconnected from the network or powered down, the NMAP tracker will detect it.

Hey Guys,
Looks like you have done an immense amount of work on this already and I am pretty excited to get my Arrowhead alarm (EliteS) integrated into HA. I have read the whole thread and I am thinking my first move is to get the updated firmware from Arrowhead and flash the IP module?
Then follow the instructions from 10 posts back.
I am a learner in HA so it may not be plane sailing
 I have already done all the HA stuff but not flashed the module, so I am guessing thats essential as nothing seems to work!
Cheers

Simon

You are correct you will need the firmware flashed in order for this to work. Flashing the firmware will also disable the Arrowhead App if you use that at all. It requires a cable and a Windows machine.

I am hoping to contribute some documentation so this is easier work for those new to it in the future.

Thanks for the input and agree this could be a work-around.

But the reality is that as part of this plugin, it checks for network connection regularly, so if it doesn’t find it then it knows already. But respecting the great work @febalci has already done on this and the fact I can’t directly contribute code base then I will keep an eye out for some potentially suitable code.

@febalci do you have aspirations to merge this as an official component of HA? Happy to help with documentation as that is the only thing I think I could do as I cannot code.

My thinking was that this needn’t be connected in anyway to the custom component that @febalci has created. If the point is to get a notification that your alarm system is disconnected from the network, then all that would be required is a very simple automation with an component that already exists and which most people use anyway. Integrating this into the custom component wouldn’t really add anything at all - since you’d still need to create exactly the same notification automation to deal with the detection of the disconnected alarm.

Thanks for the reply. So Arrowhead got straight back to me as they usually do with the firmware and I have just flashed it. Then it came straight up, binary sensors and panel all work perfectly. I just need to figure out now how to do the notifications when triggered etc, then its already better than the stock App.
Any pointers on setting up notifications with Pushbullet would be handy

If anyone needs any documentation or info about Arrow Heads products then I have an account here with them in NZ and have installed a few of their alarm systems and controls etc.

This is what i use with pushover:
Alarm Trigger Message:

- alias: Alarm Trigger Message
  trigger:
  - platform: template
    value_template: "{{is_state_attr('alarm_control_panel.area_a','alarm', True) }}"
  action:
  - service: notify.pushover
    data_template:
      message: >
        {% set zone_names = ['GiriƟ PIR','Çatı MK','Zemin MK','Sinema MK','Mutfak PIR','Sinema PIR','Üst Kat MK','Mutfak Pencere Kablosuz','Salon PIR','ÇalÄ±ĆŸma Oda PIR','Çocuk Oda PIR','Misafir Oda PIR','Ebeveyn PIR','Ebeveyn MK','Çocuk Oda MK','Sinema Oda Kablosuz'] %}
        ALARM: {{ zone_names[state_attr('alarm_control_panel.area_a','alarm_zone') | int -1 ] }}

Power Cut/Back On:

sensor:
  - platform: template
    sensors:
      home_power:
        friendly_name: "Home Power"
        device_class: power
        value_template: "{{ is_state_attr('sensor.crow_alarm_system', 'mains', True) }}"
- alias: Home Power
  trigger:
  - platform: state
    entity_id: sensor.home_power
  condition:
    condition: template
    value_template: >
      {{ trigger.from_state.state != 'unknown' }}
  action:
  - service: notify.pushover
    data_template:
      message: >
        {% if is_state('sensor.home_power','True') %}
        Power Back On...
        {% else %}
        Power Cut!!!
        {% endif %}

Btw, this is my TODO list; hopefully one day


  • When component goes off (network etc.); change all entities to ‘unavailable’.
  • When HA restarts; update all entities just after the connection is established; don’t wait for refresh time.
  • Check network disconnects real-time.
  • Add the repository to HACS
1 Like

Hi, Wow thanks for all this.
I am just trying to get my head round how your code works. Sorry I am not a code expert and am learning as I go.
In the trigger message code, I assume the states come from the alarm IP module? and the zones are what we set in the config.yaml?
The power cut/back on sensors(Home Power), are they separate sensors you have or are they sensors created from the messages from the IP module?
Is there a list anywhere of data/sensors that the IP module sends back to HA??

Sorry for all the questions.

Regards

Simon

@febalci

Hello, OK I am pretty lost.

I have put this in my config.yaml

#Arrowhead Alarm

crowipmodule:
  host: 192.168.1.90
  port: 5002
  keepalive_interval: 60
  timeout: 20
  areas:
    1:
      name: 'Home'
      #code: '1234'
    2:
      name: 'None'
      #code: '1234'
  outputs:
    3:
      name: 'spare1'
    4:
      name: 'spare2'
  zones:
    1:
      name: 'Firearms'
      type: 'motion'
    2:
      name: 'Hallway'
      type: 'motion'
    3:
      name: 'Office'
      type: 'motion'
    4:
      name: 'Smokes'
      type: 'smoke'
    5:
      name: 'Master bed'
      type: 'motion'
    6:
      name: 'Family room'
      type: 'motion'
# Alarm sensor setup
sensor:
  - platform: template
    sensors:
    home_power:
    friendly_name: "Home Power"
    device_class: power
    value_template: "{{ is_state_attr('sensor.crow_alarm_system', 'mains', True) }}"

and this in my automations-:

- alias: Alarm Trigger Message
  trigger:
  - platform: template
    value_template: "{{is_state_attr('alarm_control_panel.area_a','alarm', True) }}"
  action:
  - service: notify.pushover
    data_template:
      message: >
        {% set zone_names = ['Firearms','Hallway','Office','Smokes','Master Bed','Family'] %}
        ALARM: {{ zone_names[state_attr('alarm_control_panel.area_a','alarm_zone') | int -1 ] }}

- alias: Home Power
  trigger:
  - platform: state
    entity_id: sensor.home_power
  condition:
    condition: template
    value_template: >
      {{ trigger.from_state.state != 'unknown' }}
  action:
  - service: notify.pushbullet
    data_template:
      message: >
        {% if is_state('sensor.home_power','True') %}
        Power Back On...
        {% else %}
        Power Cut!!!
        {% endif %}

and I get this config error-:

Configuration invalid
Invalid config for [sensor.template]: expected dictionary for dictionary value @ data['sensors']. Got None
extra keys not allowed @ data['device_class']. Got 'power'
extra keys not allowed @ data['friendly_name']. Got 'Home Power'
extra keys not allowed @ data['home_power']. Got None
extra keys not allowed @ data['value_template']. Got "{{ is_state_attr('sensor.crow_alarm_system', 'mains', True) }}". (See ?, line ?). 

Could you please tell me what I am doing wrong?
Thanks.
Simon