My house alarm with HA

Hello,

I have an alarm ( HARMONIA 2650 ) that makes an http connection on port 21 to indicate when it goes armed or disarmed and on port 42 if it rings. I currently have a python script that listens to these ports and sends me an SMS. I would like to integrate this into Home Assistant so that I know the status of my alarm. Do I have to write an integration or is it possible to use something existing?

I currently use the HA webhook which allows me to send myself a notification but it does not allow me to know the status of my alarm for other automation.

I also saw “HTTP sensor” but in the documentation it says “The sensor will then exist as long as Home Assistant is running. After a restart of Home Assistant the sensor will be gone until it is triggered again.” which can cause me problems in case of restart of HA after a power failure for example.

Thank you in advance for your response.

Did you write the python script?

Could you edit it to publish mqtt messages?

A bit peculiar. Do you have a link to some documentation of this HARMONIA explaining this?

Hi tom_l,

yes I wrote this python script. I modified it to make a webhook but it’s not enough for me. So I can actually make a mqtt call if that is the solution.

Hi koying,

I have bypassed the operation of my alarm. It can communicate with a central via an http connection. I simply indicated as IP a local IP to get the information. I only have a user documentation but no technical documentation that explains this.

Ok. Yeah, as Tom is suggesting publishing a retained MQTT message is probably the way to go.

OK. I need to have 3 states: armed, disarmed, sound. What is the syntax of the mqtt push?

If by “syntax”, you mean the MQTT message payload, it can be anything you want as long as you can can create a

that can read it.

JSON would be best. e.g.

{ "alarm_state": "armed" }
{ "alarm_state": "disarmed" }
{ "alarm_state": "triggered" } or { "alarm_state": "sound" } if you prefer.

Mainly because it is an accepted standard and would be easy to add things to later without messing up your HA mqtt sensors if you discover there are more things you can send. But really you could just publish “armed” or “disarmed” to the topic of your choice and it could still easily be used by HA.

and I put some like this in the configuration.yaml file ?

sensor:
  - platform: mqtt
    name: "alarm"
    state_topic: "ha/alarm"
    value_template: "{{ value_json.alarm_state }}"

where “alarm_state” is the name of the json key

Yep. Exactly that.

Later if say you found you can report something else as well you can update the json payload to:

{ "alarm_state": "armed", "something_else": "some_other_state" }

And you don’t need to change your sensor definition.

Tom, Koying,
Thank you very much for your help and responsiveness.

1 Like