Giter Club home page Giter Club logo

ha-hkc's Introduction

HKC Alarm Integration for Home Assistant

Caution

This integration is only recommended for HKC users who have an alarm system with HKC's WiFi card, rather than users who are purely using GSM. GSM-only users may encounter rate limiting from HKC, so it isn't advisable to use.

This repository contains an unofficial Home Assistant integration for HKC Alarm systems, allowing you to control and monitor your HKC Alarm directly from Home Assistant.

Installation

You will need HACS installed in your Home Assistant server. Install the integration by installing this repository as a Custom Repository. Then, navigate to Integrations, Add an Integration and select HKC Alarm. You will then be asked to enter:

  • Panel ID: Your HKC Alarm Panel ID.
  • Panel Password: Your HKC Alarm Panel Password.
  • Alarm Code: Your HKC Alarm Code.
  • Update Interval (seconds): (Optional) Custom update interval for fetching data from HKC Alarm. Default is 60 seconds. Recommend keeping this at 60s, as this is similar to the Mobile App's polling interval, and we want to respect HKC's API.

Open your Home Assistant instance and add this integration

Entities

The integration updates data every minute by default. It exposes the following entities:

  • An alarm control panel entity representing the HKC Alarm system.
  • Sensor entities for each input on the HKC Alarm system.

The State of the alarm control panel is either armed_home, armed_away, or disarmed. The sensor entities will have states Open or Closed based on the state of the corresponding input on the HKC Alarm system.

Sample Automation to notify about alarm state changes

alias: HKC Alarm State Notifications
description: ""
trigger:
  - platform: state
    entity_id: alarm_control_panel.hkc_alarm_system
condition: []
action:
  - service: notify.notify
    data:
      title: 🚨 HKC Alarm Notification 🚨
      message: >
        Alarm System is now {{ states('alarm_control_panel.hkc_alarm_system') }}
mode: single

Troubleshooting

If you encounter issues with this integration, you can enable debug logging for this component by adding the following lines to your configuration.yaml file:

logger:
  logs:
    custom_components.hkc_alarm: debug

This will produce detailed debug logs which can help in diagnosing the problem.

Links

ha-hkc's People

Contributors

dependabot[bot] avatar jasonmadigan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

ha-hkc's Issues

Unknown error on Configuration

Hello,
I am getting an 'Unknown error' on configuration setup. I suspect that it may be mix-up in my understanding and wanted to clarify names initially to what info I've got and what I'm inputting. For 'Alarm Code' I'm inputting the User Code. For 'Panel Password' I'm inputting the Engineer's Code and for 'Panel ID' I'm inputting the Installation ID. Am I correct or am I missing some info?
Thanks,
CiarΓ‘n

Alarm unavailable / not creating entities for sensors

After adding the system the alarm is showing as unavailable in HA. Also doesn't generate inputs as sensors, just the alarm system itself.

image image

Debug Logs:

2024-03-01 19:43:44.238 WARNING (SyncWorker_4) [homeassistant.loader] We found a custom integration webrtc which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2024-03-01 19:43:44.240 WARNING (SyncWorker_4) [homeassistant.loader] We found a custom integration hkc_alarm which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2024-03-01 19:43:44.242 WARNING (SyncWorker_4) [homeassistant.loader] We found a custom integration hacs which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2024-03-01 19:43:58.331 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/aiohttp/web_protocol.py", line 350, in data_received
    messages, upgraded, tail = self._request_parser.feed_data(data)
                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "aiohttp/_http_parser.pyx", line 557, in aiohttp._http_parser.HttpParser.feed_data
aiohttp.http_exceptions.BadStatusLine: 400, message:
  Invalid method encountered:

    b'\x16\x03\x01\x02'
      ^
2024-03-01 19:43:59.273 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/aiohttp/web_protocol.py", line 350, in data_received
    messages, upgraded, tail = self._request_parser.feed_data(data)
                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "aiohttp/_http_parser.pyx", line 557, in aiohttp._http_parser.HttpParser.feed_data
aiohttp.http_exceptions.BadStatusLine: 400, message:
  Invalid method encountered:

    b'\x16\x03\x01\x02'
      ^
2024-03-01 19:44:01.081 DEBUG (MainThread) [custom_components.hkc_alarm.sensor] Finished fetching hkc_sensor_data data in 0.798 seconds (success: True)
2024-03-01 19:44:01.261 DEBUG (MainThread) [custom_components.hkc_alarm.alarm_control_panel] Finished fetching hkc_alarm_data data in 0.954 seconds (success: True)
2024-03-01 19:44:01.701 DEBUG (MainThread) [custom_components.hkc_alarm.alarm_control_panel] Finished fetching hkc_alarm_data data in 0.438 seconds (success: True)
2024-03-01 19:44:06.376 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/aiohttp/web_protocol.py", line 350, in data_received
    messages, upgraded, tail = self._request_parser.feed_data(data)
                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "aiohttp/_http_parser.pyx", line 557, in aiohttp._http_parser.HttpParser.feed_data
aiohttp.http_exceptions.BadStatusLine: 400, message:
  Invalid method encountered:

    b'\x16\x03\x01\x02'
      ^
2024-03-01 19:44:11.388 WARNING (SyncWorker_0) [homeassistant.helpers.service] Unable to find services.yaml for the hkc_alarm integration
2024-03-01 19:44:13.450 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/aiohttp/web_protocol.py", line 350, in data_received
    messages, upgraded, tail = self._request_parser.feed_data(data)
                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "aiohttp/_http_parser.pyx", line 557, in aiohttp._http_parser.HttpParser.feed_data
aiohttp.http_exceptions.BadStatusLine: 400, message:
  Invalid method encountered:

    b'\x16\x03\x01\x02'
      ^

System Status

Would it be possible to add System Status as an entity? Ideally if possible I'd like to know if the system is in alarm, then I could run automations.

Thanks again in advance for your work on this!

Sensors become unknown during partseta/b/armed

Sensors states become unknown during part-set a|b, or fully armed.

Panel data shows a display of 'Partset A' (or the arming mode) when armed, rather than the panel's time. We use this panel time to figure out time offset for sensor activity.

Alarm state Home/Away/Disarmed

Is it possible to add an additional armed state?

My alarm is configured for Full Arm, Part Arm A (Night Arm), Part Arm B (Garage only)

Currently Part Arm A Is Armed Home and Part Arm B displays as Disarmed. Ideally I'd like to read/set each state.

Thank you for your hard word on this integration.

Options for GSM-only users

  • Reduced default polling interval
  • Configurable polling intervals for both input polling and panel status

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.