Hello, I have built an interface myself that transfers the data to HA with MQTT:
# ************************************************************************** #
# UDP Message Server für AMAX SIA DC-09 Protokoll zur Kommunikation mit MQTT #
# Version 0.9.8.5 vom 21.01.2019 #
# ************************************************************************** #
#server
#!/usr/bin/perl -w
# udpqotd - UDP message server
use strict;
use IO::Socket;
use Net::MQTT::Simple::Auth;
use Net::MQTT::Simple;
use Digest::CRC qw(crc64 crc32 crc16 crcccitt crc crc8 crcopenpgparmor);
my $filename = "/root/siadc09.log";
my($sock, $newmsg, $hishost, $MAXLEN, $PORTNO);
my($msg_id, $msg_seq, $msg_recceive_prefix, $msg_account_prefix, $msg_account_number, $msg_content, $msg_payload, $msg_crc_calc, $crc_length, $msg_length);
$MAXLEN = 1024;
$PORTNO = 9101;
# MQTT Parameter
my $mqtt_hostname = '127.0.0.1';
my $mqtt_user = "XXXXXXX";
my $mqtt_pw = "XXXXXXXX";
my $mqtt_topic = "amax_sia/message";
# my $mqtt = Net::MQTT::Simple::Auth->new($mqtt_hostname, $mqtt_user, $mqtt_pw);
$sock = IO::Socket::INET->new(
LocalPort => $PORTNO,
Proto => 'udp') or die "socket: $@";
#print "Awaiting UDP messages on port $PORTNO\n";
while ($sock->recv($newmsg, $MAXLEN)) {
my($port, $ipaddr) = sockaddr_in($sock->peername);
$hishost = gethostbyaddr($ipaddr, AF_INET);
open(FH,'>>',$filename) or die $!;
print FH "Client $hishost said $newmsg\n";
close(FH);
my $msg_size = length $newmsg;
my $line_feed = substr($newmsg, 0, 1);
my $msg_crc_rec = hex (substr($newmsg, 1, 4));
$msg_length = hex (substr($newmsg, 5, 4));
$msg_id = substr($newmsg, 9, 9);
if ($msg_id =~ m/SIA-DCS/i) {
$msg_payload = substr($newmsg, 9, $msg_length);
$msg_seq = substr($newmsg, 18,4);
$msg_recceive_prefix = substr($newmsg, 22, 2);
$msg_account_prefix = substr($newmsg, 24, 2);
$msg_account_number = substr($newmsg, 26, 7);
$msg_content = substr($newmsg, 33, $msg_length - 24);
$msg_crc_calc = crc16($msg_payload);
$crc_length = "0016";
}
else {
$msg_payload = substr($newmsg, 9, 23);
$msg_id = substr($newmsg, 9, 6);
$msg_seq = substr($newmsg, 15,4);
$msg_recceive_prefix = substr($newmsg, 19, 2);
$msg_account_prefix = substr($newmsg, 21, 2);
$msg_account_number = substr($newmsg, 23, 7);
$msg_content = substr($newmsg, 30, 2);
$msg_crc_calc = crc16($msg_payload);
$crc_length = "0017";
}
# ACK Message generieren
my $MSG_ACK_E = "\"ACK\"" . $msg_seq . $msg_recceive_prefix . $msg_account_prefix . $msg_account_number . "[]";
#open(FH,'>>',$filename) or die $!;
#print FH "$MSG_ACK_E\n";
#close(FH);
my $ack_length = length $MSG_ACK_E;
my $ack_crc_d = crc16($MSG_ACK_E);
my $ack_crc = sprintf("%X", $ack_crc_d);
my $ack_end = chr(13);
my $MSG_ACK = $line_feed . $ack_crc . $crc_length . $MSG_ACK_E . $ack_end;
#open(FH,'>>',$filename) or die $!;
#print FH "ACK: $MSG_ACK\n";
#close(FH);
$sock->send($MSG_ACK);
# Ausgabeaufbereitung an Home Assistant
# if ($msg_id =~ m/SIA-DCS/i) {
my $payload_account_number;
my $payload_rest;
my $payload_area;
my $payload_text;
my $output_message;
($payload_account_number, $payload_rest) = split (/\|/,$msg_content);
($payload_area, $payload_text) = split (/\//,$payload_rest);
# my $sia_rx_code = substr($payload_text,0,2);
# my $sia_rx_text = $sia_codes{$sia_rx_code};
$payload_area =~ s/\^/ /g;
$payload_text =~ s/\^/ /g;
chop($payload_text);
my $timestamp = localtime;
# print "Payload-Area: $payload_area\n";
if ($payload_area eq "") {
$output_message = $timestamp . " " . "NULL";
}
else {
$output_message = $timestamp . " " . $payload_area . $payload_text;
}
open(FH,'>>',$filename) or die $!;
print FH "Output-Message: $output_message\n";
close(FH);
#my $mqtt = Net::MQTT::Simple::Auth->new($mqtt_hostname, $mqtt_user, $mqtt_pw);
#$mqtt->publish($mqtt_topic => $output_message);
my $mqtt = Net::MQTT::Simple->new($mqtt_hostname);
$mqtt->publish($mqtt_topic => $output_message);
sleep(1);
# }
}
die "recv: $!";
On the HA side you have to evaluate the corresponding telegrams, e.g.
################################################################################
## ##
## AUTOMATISIERUNG BOSCH ALARMANLAGE ALARMSTATUS ##
## ##
################################################################################
## -------------------------------------------------------------------------- ##
## Alarmbereich NRi1 scharf / unscharf - Meldungsauswertung über MQTT ##
## -------------------------------------------------------------------------- ##
- id: 'Alarmbereich NRi1 scharf'
alias: AMAX Bereich 1 scharf
initial_state: true
trigger:
- platform: mqtt
topic: amax_sia/message
condition:
- condition: template
value_template: '{{ "Nri1" in trigger.payload }}'
- condition: template
value_template: '{{ "CL" in trigger.payload }}'
action:
- alias: ''
data:
value: 1
variable: amax_nri1
service: variable.set_variable
- id: 'Alarmbereich NRi1 unscharf'
alias: AMAX Bereich 1 unscharf
initial_state: true
trigger:
- platform: mqtt
topic: amax_sia/message
condition:
- condition: template
value_template: '{{ "Nri1" in trigger.payload }}'
- condition: template
value_template: '{{ "OP" in trigger.payload }}'
action:
- alias: ''
data:
value: 0
variable: amax_nri1
service: variable.set_variable
Greetings
Michael