Open sanderpleijers opened 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).
So check if you follow the configuration exactly in this order. Hope this helps.
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:
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:
That was after i added the account codes for the 'normal' area.
So it seems the new output/filter i created is not working yet. After hours of more searching i found a difference:
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?
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 !
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!
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
I made some screenshots from my setup, hopefully that helps;
Most important (this makes the connection to UTcar);
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 ;)
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?
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
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?
Problem fixed, when is set the refained flag to true everything gets populated at te mqtt topic🥳
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
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 :)
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...
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
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", > }
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:
Logs on the NAS. Only heartbeats?
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:
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 ;)