tdeckers / utcar

Integration for ATS2000IP alarm system
10 stars 8 forks source link

Problem setting up alarm #2

Open sanderpleijers opened 4 years ago

sanderpleijers commented 4 years ago

Hello,

Thanks for this great piece of software, it seems to be running fine on my Synology NAS!

Only thing I cant figure out is how to properly setup the Alarm. I have a ATS1000A-IP-SM, and the ATS8500 software so the setup should be similar. I do get the alarm 'heartbeats', but no OH+XSIA messages in the logs. I think something is still wrong in my setup.

These are screenshots from my setup: image Logs on the NAS. Only heartbeats?

image

image

image

image

image

Can you please give me a hint on how to correctly setup the alarm? I am searching for hours but cannot get it to work it seems. I would like to use a few functions:

  1. Know if the alarm is set to active or inactive.
  2. Know if there is a sensor triggered.

In the end I would like to use the docker container together with Home Assisant. For that I will have to make some modifications to your code (to submit messages via MQTT for example). But first, it needs to work as-is ;)

tdeckers commented 4 years ago

Hi,

Happy you like this tool. I'm not an expert in configuring the alarm panels... I got assistance from the installation company for that part. My understanding (and this might be the confusing bit is that 2 zones are involved).

  1. you create the area for HA (home automation) - you have that
  2. you create a filter that monitors an already configured zone for the motion sensor (repeat this step for every sensor) - not sure I saw this step in your screenshots.
  3. you configure an output that follows this newly created filter (repeat for every filter) - not sure I saw this correctly in your screenshots. Did you configure this output to follow a filter you created for this purpose?
  4. you create a new zone (i.e. virtual sensor) and link it to the output (as virtual zone).

So check if you follow the configuration exactly in this order. Hope this helps.

sanderpleijers commented 4 years ago

Hi,

Thanks for the quick reply. I was missing just a small annoying bit of the configuration. I did have an output that was following a filter: image

But that does not seem to work at all somehow. After some fiddling around with the Central Station settings I did get some XSIA (from id 0144) messages in the logging:

image

That was after i added the account codes for the 'normal' area. image

So it seems the new output/filter i created is not working yet. After hours of more searching i found a difference: image

So if you create a new Zone/Output, you have to add it as an Expander? After that it magically started working ;)

Now I modified you GO application to send out messages via MQTT. This works with most modern Home Automation systems, such as 'Home Assistant' what i am using. Im not a GO language expert, but are you interested in merging it with your code?

ROUGHSOUL commented 2 years ago

Bonjour,

Je suis extrêmement intéressé par votre logiciel. Etant installateur de système d'alarme, je n'ai aucune difficulté sur celle-ci, mais aussi la bête que cela puisse paraitre, je n'ai aucune idée de comment installer utcar sur un Nas Synology DS216j? Pourriez vous me donner de l'aide à ce sujet ? Merci d'avance et excellent travail a vous !

sanderpleijers commented 2 years ago

Please write in English, my French is a little rusty ;)

As far as i know, the Synology DS216j does not have the Docker package available. I think you will need docker to start Utcar on a Synology! Maybe there is another way, but docker seems the best way to go for this. It is maybe possible to get a golang package for synology but that was way to fiddly for me.

Ive made my own adaptation of Utcar that uses MQTT to transport messages to Home Assistant. See https://github.com/sanderpleijers/utcar

My docker startup code (docker_compose.yaml) looks like this;

    build:
      context: .
      dockerfile: DockerfileUTCAR
    #image: tdeckers/utcar
    container_name: utcar
    environment:
      - UTCAR_MQTTADDR=192.168.1.3:1883
      - UTCAR_MQTTUSER=hass
      - UTCAR_MQTTPWD=yourpassword
    expose:
      - 12300
    ports:
      - 12300:12300
    networks:
      - backend
    restart: unless-stopped

Copy the utcar go files to a folder called 'utcar'. Then, the container is build with the DockerfileUTCAR file;


# Start from the latest golang base image
FROM golang:latest

# Set the Current Working Directory inside the container
WORKDIR /app

# Copy the source from the current directory to the Working Directory inside the container
COPY ./utcar/ .

#test
RUN go mod init utcar
RUN go get -d -v

# Build the Go app
RUN go build -o main .

EXPOSE 12300

# Command to run the executable
CMD ["./main"]

You will need to understand the basics of working with docker containers for this. Hope this helps you!

Sifroy commented 2 years ago

Hi,

I've tried both the @tdeckers and @sanderpleijers method to get a little more out of UTCAR than the heart beat, but it seems I keep missing something.

@sanderpleijers could you maybe walk me through the setup (preferably with some additional screenshot) so I can copy the settings from the point where you only got a heartbeat to when you got every message.

Thanks

sanderpleijers commented 2 years ago

I made some screenshots from my setup, hopefully that helps; image

image image

image image

Most important (this makes the connection to UTcar); image image

In Home Assistant i use binary sensors to read the info from Mqtt (for that you need my fork of Utcar);

  - platform: mqtt
    #off_delay: 5
    state_topic: "alarm/zone_015/state"
    name: "Alarm Status"
    device_class: safety
    payload_on: 'ON'
    payload_off: 'OFF'
    value_template: "{{ value }}"

I cannot guarantee you that this setup is done safe/correctly, but for me it works ;)

bjornmorsman commented 1 year ago

Hello Sander,

i tryed to create a docker container with the docker-compose method. I get the next error:

Building utcar [+] Building 0.1s (5/5) FINISHED
=> [internal] load .dockerignore 0.0s => => transferring context: 2B 0.0s => [internal] load build definition from Dockerfile 0.0s => => transferring dockerfile: 141B 0.0s => [internal] load build context 0.0s => => transferring context: 2.86kB 0.0s => [1/1] ADD utcar / 0.0s => exporting to image 0.1s => => exporting layers 0.1s => => writing image sha256:d6d4fad215a30b7082cafd31dd440d632c28572bb359347 0.0s => => naming to docker.io/library/utcar_utcar 0.0s WARNING: Image for service utcar was built because it did not already exist. To rebuild this image you must use docker-compose build or docker-compose up --build. Creating utcar ... error

ERROR: for utcar Cannot start service utcar: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: exec: "/utcar": stat /utcar: no such file or directory: unknown

ERROR: for utcar Cannot start service utcar: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: exec: "/utcar": stat /utcar: no such file or directory: unknown ERROR: Encountered errors while bringing up the project

Can you help me with this?

sanderpleijers commented 1 year ago

It seems something is wrong with a path, it cannot find /utcar. Is the utcar folder available in the same place you start the docker_compose.yaml (using docker-compose up -d)?

I use this short bit of an sh script to start my build: cd /volume1/docker/docker_compose/ <-- this folder has the docker_compose.yaml and utcar folder! docker-compose up -d

bjornmorsman commented 1 year ago

Hi Sander,

thanks for your reaction, i did solve the problem myself. The container is running en connected to my alarm system and mqtt server, the only problem is that there is nothing populating at the mqtt side.

container is succesfull connected to the broker en the message is parsed and send to the broker, only the broker doesnt create an topic.

can you help me with this?

bjornmorsman commented 1 year ago

Problem fixed, when is set the refained flag to true everything gets populated at te mqtt topic🥳

bjornmorsman commented 1 year ago

Hello Sander,

your utcar version works perfect! I also have a question. I want to addopt other sia codes in the mqtt.go when i add them as “case” the work fine, but i want to populate other sia event to other topics. Can you help me with that?

thanx in advance

ROUGHSOUL commented 1 year ago

Hello Sander,

Could you help me because there is something I don't understand. Utcar is well mounted in the Docker, I receive the alarm and heartbeat messages, but I do not understand how to retrieve these messages to perform an action in home assistant. how to create the link between HA and UTCAR? Thank you in advance for your answer :)

sanderpleijers commented 1 year ago

Hi,

@ROUGHSOUL; You need to make a few sensors in YAML for that. Like;

input_boolean:
  alarm_triggered:
    name: Alarm getriggerd
    initial: false
    icon: mdi:alarm

  alarm_actief:
    name: Alarm!
    initial: false  

alarm_control_panel:
  - platform: template
    panels:
      ats_advanced:
        name: "ATS Advanced"
        unique_id: ats_advanced_ats1000aip
        value_template: >-
          {% if is_state('binary_sensor.alarm_status', 'on') %}
              armed_away
          {% else %}
              disarmed
          {% endif %}
        code_arm_required: false
        code_format: no_code
        disarm:
          - condition: state
            entity_id: binary_sensor.alarm_status
            state: "off"
          - service: input_boolean.turn_off
            target:
              entity_id: input_boolean.alarm_triggered

mqtt:
  binary_sensor:
    #Alarm aan/uit
    - name: "Alarm Status"
      state_topic: "alarm/zone_015/state"
      payload_on: "ON"
      payload_off: 'OFF'
      #qos: 0
      device_class: safety
      value_template: "{{ value }}"

    #Woonkamer bewegingsdetectie
    - name: "Alarm Woonkamer Beweging"
      state_topic: "alarm/zone_010/state"
      device_class: motion
      payload_on: 'ON'
      payload_off: 'OFF'
      value_template: "{{ value }}"

    #Hal bewegingsdetectie
    - name: "Alarm Hal Beweging"
      state_topic: "alarm/zone_011/state"
      device_class: motion
      payload_on: 'ON'
      payload_off: 'OFF'
      value_template: "{{ value }}"

    #Bijkeuken bewegingsdetectie
    - name: "Alarm Bijkeuken Beweging"
      state_topic: "alarm/zone_012/state"
      device_class: motion
      payload_on: 'ON'
      payload_off: 'OFF'
      value_template: "{{ value }}"

    #Garage bewegingsdetectie
    - name: "Alarm Garage Beweging"
      state_topic: "alarm/zone_013/state"
      device_class: motion
      payload_on: 'ON'
      payload_off: 'OFF'
      value_template: "{{ value }}"

    #Meterkast deur open/dicht
    - name: "Alarm Meterkast"
      state_topic: "alarm/zone_014/state"
      device_class: door
      payload_on: 'ON'
      payload_off: 'OFF'
      value_template: "{{ value }}" 

This is my own made up code, so no warranties... ;) I also have some automations to alert me when the alarm is activated or triggered.

@bjornmorsman; can you show me what you made or wat you want? Maybe i can help...

bjornmorsman commented 1 year ago

Hi,

@sanderpleijers what is want is the i can edit the mqtt parser, you only use general alarms and i want to use more of the sia codes my ats1500aip spits out.

i made a sensor for armed_away armed_home and not_armed. I ad the sia code to the mqtt.go and it works. The only problem is that the mqtt.go sends it to the wrong mqtt topic because it doenst get filtered at “gebied” its get filtered by zone. So when i arm “gebied 1” the mqtt topic becomes “zone 1”

maby we can create an seperet filter for al the other sia codes that come from the alarm so that we can define different filters to different “case” codes as BA and BR etc.

i hope it is a little bit clear my english is not so very well🤣

thanx in advance

bjornmorsman commented 1 year ago

Hi @sanderpleijers

this is what i made so far, i altered the parser to be compatible with SIA area modifier, now i can populate “sia.area” to the right area.

my next question is that i want to have a different itemurl for the body’s CG,CL,CF,OP so i can create a different string to publish through mqtt.

Hope you can help me with that, i cant find something usefull on google.

func PublishMqtt(client MQTT.Client, sia SIA) error { var body string switch sia.command { case "UA": body = "ON" case "UR": body = "OFF" case "RB": body = "ON" case "RS": body = "OFF" case "FA": body = "ON" case "FR": body = "OFF" case "CG": body = "Gedeeltelijk" case "CL": body = "Volledig" case "CF": body = "Geforceerd" case "OP": body = "Uitgeschakeld" default: return fmt.Errorf("Unsupported SIA command for pusher (%s)\n", > }

itemUrl := strings.Join([]string{"homeassistant/ats/gebied_", sia.area,> client.Publish(itemUrl, 0, true, body)

bjornmorsman commented 1 year ago
func PublishMqtt(client MQTT.Client, sia SIA) error {
var body string
switch sia.command {
case "UA":
body = "ON"
case "UR":
body = "OFF"
case "RB":
body = "ON"
case "RS":
body = "OFF"
case "FA":
body = "ON"
case "FR":
body = "OFF"
case "CG":
body = "Gedeeltelijk"
case "CL":
body = "Volledig"
case "CF":
body = "Geforceerd"
case "OP":
body = "Uitgeschakeld"
default:
return fmt.Errorf("Unsupported SIA command for pusher (%s)\n", >
}

itemUrl := strings.Join([]string{"homeassistant/ats/gebied_", sia.area,>
client.Publish(itemUrl, 0, true, body)
sanderpleijers commented 1 year ago

Hi @bjornmorsman; so i think you want both the zone and the area and maybe raw SIA code? Something like this?:

itemUrl1 := strings.Join([]string{"homeassistant/ats/raw"}, "")
    client.Publish(itemUrl1, 0, false, sia.command)

itemUrl2 := strings.Join([]string{"homeassistant/ats/gebied_", sia.area, "/", sia.zone, "/state"}, "")
    client.Publish(itemUrl2, 0, false, body)

Or maybe you can alter the switch:

switch sia.command {
    case "UA":
        body= "ON"
        topic= strings.Join([]string{"homeassistant/ats/gebied_", sia.area, "/", sia.zone, "/state"}, "")
    case "UR":
        body= "ON"
        topic= strings.Join([]string{"homeassistant/ats/gebied_", sia.area, "/", sia.zone, "/state"}, "")
    case "CG":
        body= "Gedeeltelijk"
                topic= strings.Join([]string{"homeassistant/ats/gebied_", sia.area, "/"}, "")
.......etc.............
    default:
        return fmt.Errorf("Unsupported SIA command for pusher (%s)\n", sia.command)
}
client.Publish(topic, 0, false, body)

Really roughly drawn here. I did not do anything with Golang or this code for a while so I am a little rusty ;) So; Did not test any so please check if this is what you want and try it out. Please share your code on Github so we can check/ maybe pull it in the main code if usable.

bjornmorsman commented 1 year ago

Hi @bjornmorsman; so i think you want both the zone and the area and maybe raw SIA code? Something like this?:

itemUrl1 := strings.Join([]string{"homeassistant/ats/raw"}, "")
  client.Publish(itemUrl1, 0, false, sia.command)

itemUrl2 := strings.Join([]string{"homeassistant/ats/gebied_", sia.area, "/", sia.zone, "/state"}, "")
  client.Publish(itemUrl2, 0, false, body)

Or maybe you can alter the switch:

switch sia.command {
  case "UA":
      body= "ON"
      topic= strings.Join([]string{"homeassistant/ats/gebied_", sia.area, "/", sia.zone, "/state"}, "")
  case "UR":
      body= "ON"
      topic= strings.Join([]string{"homeassistant/ats/gebied_", sia.area, "/", sia.zone, "/state"}, "")
  case "CG":
      body= "Gedeeltelijk"
                topic= strings.Join([]string{"homeassistant/ats/gebied_", sia.area, "/"}, "")
.......etc.............
  default:
      return fmt.Errorf("Unsupported SIA command for pusher (%s)\n", sia.command)
}
client.Publish(topic, 0, false, body)

When compiling i get an error “topic not defined” Really roughly drawn here. I did not do anything with Golang or this code for a while so I am a little rusty ;) So; Did not test any so please check if this is what you want and try it out. Please share your code on Github so we can check/ maybe pull it in the main code if usable.

Hi @sanderpleijers,

Do i need to define “topic” somewhere else?

sanderpleijers commented 1 year ago

Maybe: topic := strings.Join([]string{"homeassistant/ats/gebied_", sia.area, "/", sia.zone, "/state"}, "")

instead of only the = sign?

Or define it earlier with:

var body string
var topic string

Just a quick guess...

bjornmorsman commented 1 year ago

This is how it looks like, with = or := i get “topic declared and not used” when building 🤪

but i dont get where to declare something and use it somwhere else

func PublishMqtt(client MQTT.Client, sia SIA) error {
        var topic string
        var body string
        switch sia.command {
        case "UA":
                body = "ON"
        case "UR":
                body = "OFF"
        case "RB":
                body = "ON"
        case "RS":
                body = "OFF"
        case "FA":
                body = "ON"
        case "FR":
                body = "OFF"
        case "CG":
                body = "Gedeeltelijk"
        case "CL":
                body = "Volledig"
                topic := strings.Join([]string{"homeassistant/ats/gebied_", sia.area, "/state"}, "")
        case "CF":
                body = "Geforceerd"
        case "OP":
                body = "Uitgeschakeld"
        default:
                return fmt.Errorf("Unsupported SIA command for pusher (%s)\n", sia.command)
        }

        itemUrl := strings.Join([]string{"homeassistant/ats/gebied_", sia.area, "/zone_", sia.zone, "/state"}, "")
        client.Publish(itemUrl, 0, true, body)
sanderpleijers commented 1 year ago

After the switch (where you set the body and topics) you should use:

client.Publish(topic, 0, false, body)

instead of

client.Publish(itemUrl, 0, true, body)

so like:


func PublishMqtt(client MQTT.Client, sia SIA) error {
        var topic string
        var body string
        switch sia.command {
        case "UA":
                body = "ON"
                topic := strings.Join([]string{"homeassistant/ats/gebied_", sia.area, "/state"}, "")
        case "UR":
                body = "OFF"
                topic := strings.Join([]string{"homeassistant/ats/gebied_", sia.area, "/state"}, "")
        case "RB":
                body = "ON"
                topic := strings.Join([]string{"homeassistant/ats/gebied_", sia.area, "/state"}, "")
        case "RS":
                body = "OFF"
                topic := strings.Join([]string{"homeassistant/ats/gebied_", sia.area, "/state"}, "")
        case "FA":
                body = "ON"
                topic := strings.Join([]string{"homeassistant/ats/gebied_", sia.area, "/state"}, "")
        case "FR":
                body = "OFF"
                topic := strings.Join([]string{"homeassistant/ats/gebied_", sia.area, "/state"}, "")
        case "CG":
                body = "Gedeeltelijk"
# or another topic when you need to;
                topic := strings.Join([]string{"homeassistant/ats/gebied_", sia.area, "/zone_", sia.zone, "/state"}, "")
        case "CL":
                body = "Volledig"
                topic := strings.Join([]string{"homeassistant/ats/gebied_", sia.area, "/state"}, "")
        case "CF":
                body = "Geforceerd"
                topic := strings.Join([]string{"homeassistant/ats/gebied_", sia.area, "/state"}, "")
        case "OP":
                body = "Uitgeschakeld"
                topic := strings.Join([]string{"homeassistant/ats/gebied_", sia.area, "/state"}, "")
        default:
                return fmt.Errorf("Unsupported SIA command for pusher (%s)\n", sia.command)
        }
        client.Publish(topic, 0, true, body)
Jeffreyvanesch commented 11 months ago

@sanderpleijers You mentioned that you are using the ATS8500 software together with HA for programming the HA zone. I can't configure this specific zone as I don't have the software and seem to be unable to find the (Correct) utility without registering on reseller websites, purchasing a license and proving that I am an installer.

Would you mind sharing the program by PM? Then I can see if it's working as expected,

sanderpleijers commented 11 months ago

@Jeffreyvanesch; i can share a bunch of files to download. Any way to send it to you privately?

jnathalia commented 5 months ago

I have a question. Have all of the above (utcar) nowadays, for Home Assistant users, been replaced by the SIA integration https://www.home-assistant.io/integrations/sia/?

My goal is to get the (X)SIA messages into HA.

I'm just wondering, as I have an Aritech ATS4000 with ATS-IP-KIT ATS1809 and I have been trying to do many things, but after a full day of trying I cannot get it working. I know how to program the Aritech (via Titan) and I know HA... I have applied an heartbeat at the ATS-IP-KIT, but nothing comes thru.

Probably, if you confirm, I have to setup a docker on my NAS as well... But please direct me a bit into the appropriate direction. Thanks

sanderpleijers commented 5 months ago

@jnathalia; i still use my own UTCAR version in a docker container. The Home Asssitant SIA integration does not work (yet?). A github user wichers however made an interesting pull request: https://github.com/eavanvalkenburg/pysiaalarm/pull/44 but no clue on how to install or setup that inside of Home Asssitant instead of the current SIA integration...

jnathalia commented 5 months ago

Hi @sanderpleijers , I have installed a utcar docker on my Synology NAS as well. But also this doesn't work unfortunately. Do you have any clue why the messages do not come through?

Screenshot 2024-01-18 at 15 40 30

I’m using Aritech ATS and I don’t receive a Heartbeat. I’m listening to port 12300 and I have set my PAC to communicate to 192.168.1.100 (utcar IP address which is taken over from my host/NAS).

Screenshot 2024-01-18 at 15 33 42

Am I doing fundamentally wrong? It has something to do with my alarm system I guess…

sanderpleijers commented 5 months ago

Hi @jnathalia; did you try to actually change something on the alarm (set it active for example)? I believe it only sends out data as soon something changes....

Is there a way to test communications (Restart communications maybe in your screenshot)? Im not sure the whole Heartbeat thing works the same way as in my ATS1000A-IP-MM board.

jnathalia commented 5 months ago

I have tried all unfortunately, I know more or less how to program the alarm panel (with PAC, Area's, Zones etc). I also put the IP address as the first entry at Reporting Central Station as the 2nd is for backup and 3rd is for emergency. But no heartbeat...

I should see it in the log (3rd tab) of the utcar docker?

sanderpleijers commented 5 months ago

I should see it in the log (3rd tab) of the utcar docker?

Yes, it should be visible. It looks like:

2024/01/19 15:06:44 {{13934913369595179361 1914411863753410 0xc9bbc0} 4431 0001 0001 006969 UA 010}                                                                                                  
2024/01/19 15:06:44 Publish ON to alarm/zone_010/state                                                                                                                                               
2024/01/19 15:06:47 Message:  01010058"SIA-DCS"4431R0001L0001[#006969|NUR010*'HA Woonkamer'NM]15BEC360203C5501|#006969                                                                               
2024/01/19 15:06:47 {{13934913373014483511 1914415061832093 0xc9bbc0} 4431 0001 0001 006969 UR 010}                                                                                                  
2024/01/19 15:06:47 Publish OFF to alarm/zone_010/state                                                                                                                                              
2024/01/19 15:07:35 Message:  SR0001L0001    006969XX    [ID00000000]                                                                                                                                
2024/01/19 15:07:35 Heartbeat. 

No clue on how to set it up properly for your model....

jnathalia commented 5 months ago

I did "Restart communication" and "Reboot CPU" ... nothing happens.

Do you have encryption to "None" as well? I thought, the easier it comes through...

Is there another way to listen at this port 12300 at the IP address? I want to make sure the alarm panel is certainly not sending anything... if that's true, I think I need to get an alarm expert of this Aritech...

jnathalia commented 3 months ago

Hi @sanderpleijers, I have upgraded my ATS4000 (Classic) to the ATS3500 (Advanced). An installer said, the Classic won't be able to communicate to a 2nd or 3rd Central Station simultaneously 🫣

So, starting a new life with the Advanced...

I followed your instructions about how to configure the ATS. All fine, as I receive the XSIA messages in UTCAR for all my PIR detectors.

I'm using Synology Docker, so downloaded tdeckers/utcar which is available via the registry (container name: deckers-utcar-1). Is this the correct one or do you have published your own docker available for Synology? I couldn't find in Synology register (only hexamus/utcar which refers to a full preparation for ATSxxxxIP).

Screenshot 2024-03-25 at 20 40 24

So, I have reached the status to POST the XSIA to my Home Assistant, but this step isn't clear to me... For instance, to which port do I need to communicate, 8123 or my own defined port? Do I need a user/password for MQTT or can I work without? At the HA side, do I need to use for the broker my Synology Docker address? I haven't got experience with MQTT yet...

I have already added in configuration.yaml

`mqtt: binary_sensor:

PIR Office

- name: "PIR Office"
  state_topic: "alarm/zone_121/state"
  device_class: motion
  payload_on: 'ON'
  payload_off: 'OFF'
  value_template: "{{ value }}"

`

Some additional instruction is very much appreciated... thanks in advance!

By the way, what a difficult thing to hook Aritech ATS to HA... I'm using Satel Integra at a few other sites and this integration is 2 seconds work without any filtering and creating artificial zones in the original alarm system. Just 1-to-1 status communication directly available in HA... I'm not complaining, because I have to work with ATS (replacing ATS Classic to Advanced is pretty simple, replacing to Satel Integra much more complicated...), but now I'm experiencing the real difference how integration can be realised...

sanderpleijers commented 3 months ago

Hi @jnathalia. The files for docker that i used are in my own git repository. There is a difference in those scripts, that enables to send data to a mqtt server (an addin for Home Assistant). I used to build my own docker container from scratch witch docker compose. You can see some details of that earlier in this issue thread.

I however do not maintain these files anymore, and i have moved on now to this because it is easier: https://github.com/eavanvalkenburg/pysiaalarm/issues/49 git; https://github.com/voskuh/pysiaalarm (custom component to install; https://github.com/voskuh/custom-sia) This is a custom component used inside Home Assistant that enables direct communication (still read only) without using docker. Works for me!

jnathalia commented 1 week ago

Hi @sanderpleijers, There are so many threads so fiddling around what to follow up. Sorry for being on the wrong track. I have followed now this post https://github.com/eavanvalkenburg/pysiaalarm/issues/49 and I will leave the utcar episode. I have installed the voskuh integration which added OH as an option at the standard integration of SIA Alarm Systems. I changed my accountid to 6 digits at my ATS and integration but after a minute or so I get all zones are disabled: Screenshot 2024-06-25 at 10 10 47

See also the thread on https://github.com/eavanvalkenburg/pysiaalarm/issues/49

Jeffreyvanesch commented 1 week ago

@sanderpleijers Sorry for my really late reply 😆 seems Git doesn't have a PM option. You can send it by mail to jeffreyvanesch@gmail.com

@Jeffreyvanesch; i can share a bunch of files to download. Any way to send it to you privately

sanderpleijers commented 5 days ago

Hi @sanderpleijers, There are so many threads so fiddling around what to follow up. Sorry for being on the wrong track. I have followed now this post https://github.com/eavanvalkenburg/pysiaalarm/issues/49 and I will leave the utcar episode. I have installed the voskuh integration which added OH as an option at the standard integration of SIA Alarm Systems. I changed my accountid to 6 digits at my ATS and integration but after a minute or so I get all zones are disabled:

Hi @jnathalia; you should check the integration logging to see if there is any traffic logged. For me; the zone visibility in home assistant has never worked. I don't use that at all. I use it in another way (setup as custom sensors in yaml):

template:
  - trigger:
      - id: 'on'
        platform: event
        event_type: sia_event_12300_696900
        event_data:
            code: 'UA'
            message: "010*'HA Woonkamer'NM"
      - id: 'off'
        platform: event
        event_type: sia_event_12300_696900
        event_data:
            code: 'UR'
            message: "010*'HA Woonkamer'NM"
    binary_sensor:
      - name: "Alarm Woonkamer Beweging"
        device_class: motion
        state: "{{ trigger.id == 'on' }}"
        auto_off: 5 #off after 5s when triggered

This catches the traffic to Home Assistant and of there is a specific code recieved I know that the zone is triggered. For further questions i think it is best to continue at [(https://github.com/eavanvalkenburg/pysiaalarm/issues/49)]

@Jeffreyvanesch; ill try to compile a zip file containing the setup next week!

jnathalia commented 4 days ago

Ah ok...

So, you have installed via HACS the repository https://github.com/voskuh/custom-sia

Then, do or don't (?) install the integration "SIA Alarm Systems"? If yes, how many zones do you define? Just 1 ("number of zones for the account")? Ping interval 1 min? Encryption key just empty if you haven't defined in the ATS?

Or just install via HACS the repository https://github.com/voskuh/custom-sia and skip the rest and just continue to define in your configuration.yaml a similar code as you have mentioned above?

As you can see I need a bit more guidance. I will check the integration logging.

Many thanks in advance. I hope I can get this working after such a long time...

jnathalia commented 4 days ago

I have the feeling I have to add this custom repo as in your log @sanderpleijers I can see you are using pysiaalarm, but I cannot add this (anymore):

Screenshot 2024-06-28 at 11 58 11

Repository structure for master is not compliant 🤔

jnathalia commented 4 days ago

ok, got this working... I will document later for other users, it was quite a search which is the right path... I only don't know if this how it should look like:

Screenshot 2024-06-28 at 12 53 53

Please confirm.

And for the alarmstatus I also need to make a separate filter, output and zone in the ATS8500 software to be reported? I think this could be easier...

bjornmorsman commented 4 days ago

@jnathalia there should be an easy way to configure your alarm status, do you have multiple clientnumbers for diferent area’s programmed in the ats8500 software?

jnathalia commented 4 days ago

yes, I have multiple clientnumbers for different area's programmed in ATS8500

bjornmorsman commented 4 days ago

There is your problem, if you have more then 1 area with the same clientnumber you have to turn on “sia area modifier” before it can report arm and disarm messages.

But the sia parser is not adopted for sia area modifier so it wont work. That’s the reason why i stil use the mqtt version of utcar, i adjusted the parser so it understands the sia area modifier.

so the only easy way to make it work would be that voskuh adopts his sia parser to support area modifier. So we can use the alarmstatus.

you can make a sensor for every area as you suggested, the downside of that is you get only “area 1” on/off. No armed/disarmed/disarmed_home

jnathalia commented 3 days ago

Hi @bjornmorsman, yes I do have more than 1 area but NOT with the same client number. I have defined in ATS8500 the following:

Screenshot 2024-06-29 at 08 50 39

I have tried to make a "New entry" at the integration "SIA Alarm Systems" by specifying the port and account code:

Screenshot 2024-06-29 at 08 54 10

But it says: "Device is already configured". Weird, I have never done that... I think it is because I have to use the same port.

My configuration.yaml has been defined as: ` - trigger:

  - id: 'on'

    platform: event

    event_type: sia_event_12300_100100

    event_data:

        code: 'CG'

  - id: 'off'

    platform: event

    event_type: sia_event_12300_100100

    event_data:

        code: 'OP'

binary_sensor:

  - name: "Area Schuur"

    device_class: presence

    icon: mdi:shield-home

    state: "{{ trigger.id == 'on' }}"

`

I removed the "message: " definition as when another user set the alarm for the area it has another description/message. I'm not sure this is acceptable.

Then checking the log and I can find the following: 2024-06-29 08:22:38.314 WARNING (MainThread) [pysiaalarm.base_server] Unknown or non-existing account (100100) was used by the event: Content: #100100|NCG002*'Name'NM], Zone (ri): None, Code: CG, Message: 002*'Name'NM, Account: 100100, Receiver: R0001, Line: L0001, Timestamp: None, Length: 0043, Sequence: 1394, CRC: 0101, Calc CRC: 948F, Encrypted Content: None, Full Message: "SIA-DCS"1394R0001L0001[#100100|NCG002*'Name'NM].

jnathalia commented 1 day ago

@bjornmorsman, I think the integration can listen to one account only. In my case 200000, so the combination of port and account is sia_even_12300_200000. It's not listening to any other account, so in my case account 100100. That's really a pity and indeed I think this is because of the integration of @voskuh... it should just listen to any account. So, when the Central Station is sending SIA coding it should only by interpreted if there is any definition in HA and the integration is all we need...

Do you agree?

For now I could make artificial (virtual) zones for each area to filter the status of the alarm panel. It's going to work...(I realised already), but I also want to read all my smoke detectors (15x) and magnetic contacts (approx 35) without making artificial zones (via filters and outputs)... I don't like as I have to duplicate basically my entire alarm system as it doesn't bring me the required messages...

If anyone has a better suggestion?

bjornmorsman commented 8 hours ago

@jnathalia there is a checkbox “additional account” if you check that you can add multiple clientnumber in the integration, the problem with that is that is doesnt work properly. I tryed that last weekend but the area status is stil not working. The sia codes get acknowleged bij the integration but is not reflected tot the sensors.

about the accounts, i dont know if listening to every account number is the right approatch. The is a solution and that would be adopting the sia parser to also support “sia area modifier” that is what we also use if we connect a system to a PAC with multiple the same clientnumbers. By design all pruducts of UTC use this approach, i think it is accourding the sia rules.

Yes, you have to duplicate every zone to see its status in ha. That is very simple, an alarm system is made for alarm messages so if you open a door or a windows when the system is disarmd there is no alarm so nothing gets reported to the pac. That is why you have to kopie every zone so it can report open/close to the sia integration.

There is an other way to read out an ats advanced, it uses the same way as the ats8500 does. Thats is direct connection to the alarm panel and then you wil recieve every message the panel sends. That is the ultimate way off connecting an advanced to home assistant. There is a guy in the netherlands who create that integration but…. It costs money the last time i spoke the guy he told me that the price is more than €1000 and you can only buy it through your listed alarm installer.

I love his integration and i really want to have it but €1000 euro for this integration is to much for me, thats the reason why a still use the utcar container for me its working good. I dont get all the messages i want but it is working for most parts i need. I had to create a bunch of virtual zones with outputs but thats all.

so maybe if someone can reverse engineer a direct connection with an ats advanced that would be the best approuche.

jnathalia commented 6 hours ago

Thanks for the answer @bjornmorsman!

The "additional account" at the integration doesn't work indeed as I explained above. If you look at the HA log you can see the SIA messages with another account code comes through but it fails when it comes to interpretation and therefore it's not reflected to your sensors. So, current integration of @voskuh works primarily on the port number and let anything come through, regardless the account.

Why would listening to every account code not be the right approach? I believe, forget the "Sia area modifier". That's for other purposes. Keep the programming at your panel clean and transparant. Currently, all the SIA codes are coming through even if you use multiple (so different and unmodified) account codes. It's only a matter of parsing/interpretation. This keeps the setup clean without fiddling around with all kinds of translation, filters, outputs and zones at the alarm panel. For instance, a smoke detector gives an alarm even when the area is not armed. As the ATS8500 doesn't allow me to assign multiple areas to 1 zone (i.c. the smoke detector), it is only reported in my main area which it is assigned to (area "1 - Woonhuis"). Not my artificial area which I called area "4 - Home Assistant". In addition, my 2 Central Stations (PAC) are both "primary CS", so anything that needs to be reported with SIA codes is currently being reported. This you can also see at utcar or the HA log. The integration of @voskuh gets all the information but it's not being parsed and therefore I need to create a filter, output and (virtual) zone to have it reported in an additional area 4. This is the wrong approach in my opinion...

About connecting the ATS Advanced ATSx500. Yes, I know there is a solution. There are actually 2, one of Verhees and of Domox. They are both using the SDK. This is exactly what we should do as well for HA. If you are an installer you can sign a NDA and you get access to this SDK and you can program and read directly from the panel. My background is programming in the past, but I'm not into the modern stuff anymore and I'm not sure if you can integrate the SDK into HA. Most likely not, as I presume it's .NET so the only way is to make a standalone program (maybe running in a docker?).

For the latest ATSx700 (Axon) they have replaced the SDK by an API. In general the SDK or API is the best way to go forward, although keep in mind that the ATSx500 will be phased out so better to "invest" into the new Axon system when starting programming.

By the way, I have tried to run the utcar with MQTT container but I failed. I'm using Synology and the standard utcar was available from the registry and runs fine. But I didn't know how to create a new docker with the modification for MQTT. I know MQTT works fine and is very stable. The downside in my situation is that my Synology goes down in the night, so SIA codes and MQTT would not work. Also, I don't like to have running additional dockers for such a simple thing...

This ATS alarm integration has cost me so much effort, that I'm longing for my prior alarm system Satel Integra which I have installed on multiple sites connected to HA. Just 1 minute of work and you can read any zone you like... just out of the box in HA.

I think I will ask @voskuh in another thread on GitHub to make some amendement. https://github.com/eavanvalkenburg/pysiaalarm/issues/49

bjornmorsman commented 5 hours ago

@jnathalia

Why would listening to every account code not be the right approach? I believe, forget the "Sia area modifier". That's for other purposes. Keep the programming at your panel clean and transparant. Currently, all the SIA codes are coming through even if you use multiple (so different and unmodified) account codes. It's only a matter of parsing/interpretation. This keeps the setup clean without fiddling around with all kinds of translation, filters, outputs and zones at the alarm panel. For instance, a smoke detector gives an alarm even when the area is not armed. As the ATS8500 doesn't allow me to assign multiple areas to 1 zone (i.c. the smoke detector), it is only reported in my main area which it is assigned to (area "1 - Woonhuis"). Not my artificial area which I called area "4 - Home Assistant". In addition, my 2 Central Stations (PAC) are both "primary CS", so anything that needs to be reported with SIA codes is currently being reported. This you can also see at utcar or the HA log. The integration of @voskuh gets all the information but it's not being parsed and therefore I need to create a filter, output and (virtual) zone to have it reported in an additional area 4. This is the wrong approach in my opinion...

what would be you approach then? you always have to fiddle with filter output and virtual zone because "normal" open/close message's doesnt go to a PAC. the only way to report it to a PAC is to create an virtual zone that wil report as "UA" so if you when to reflect your windows/doors/motionsensors to HA you have to create a virtual zone, there is no other way with an ats advanced. yes than you have to buy the software/hardware of Patrick or domox.

Satel Integra uses the same way of communication with home assistant, as Patrick en domox does you dont configure a PAC to send sia messages to home assistant

i dont know why the multiple account are not working when you try it, i just added 4 account to the sia integration. image

jnathalia commented 1 hour ago

@bjornmorsman, I agree for PIR's and magnetic contacts... the SIA approach forces you to create filters, output and (virtual) zones to forward them into HA. Such a pity to do all kind of things in an alarm panel where it's not meant to be for... (or is this a dangerous statement?) However, for smoke detectors and also the status of the panel, the status of areas, an alarm etc you have to make new zones. It's fine, but I almost duplicated my original alarm system... (ok, it does what it should do)

The screenshot is interesting... somehow I cannot do this 🤔. Should I remove the entire integration and define it once again? Does it work for you, are your sensors updated for the additional account codes? Do you see in Developer Tools, Events, the sia_event_12300_12345x four times?

bjornmorsman commented 1 hour ago

@jnathalia i think you need to re-add the integration and check the checkbox for additional account number.

i get armed/disarmed for the 4 area's but it is not working correctly because i get always an FTC after some time. i am curious if you can get it to work, maybe my panel settings are not correct.