New at Home Assistant - Question about the SIA DC-09 Coupling of a Bosch AMAX alarm system

Good morning together,

I switched from openHAB to Home Assistant this week and now try to rebuild the old functionality.
In a direct comparison I like home assistant much better - also because of the many components and the easier programming. Here I am still practicing … :slight_smile:
However, a major problem for me is the connection of my Bosch alarm system (AMAX), which communicates exclusively by means of the SIA DC-09 protocol. For this there is a Perl script in openHAB, which handles the communication. Unfortunately this script can not be used in the Home Assistant.
I’ve seen that ioBroker has a dedicated server (https://github.com/schmupu/ioBroker.sia) that does just that. Now I do not want to install an additional ioBroker. Is there a way to take over the functionality in the Home Assistant or to create such a component? Unfortunately, I’m not proficient at programming (that’s why switching to Home Assistant).

I would be happy if I got an answer.

many Greetings
Michael

Hello everybody,

does not anyone have an idea on the subject?

many Greetings
Michael

Hello,

you can try this: https://github.com/Cheaterdev/sia-ha

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

Hi @MichaelR . Thanks for sharing. I have one question about your perl script. I see that you are defining $portno but I dont see anywhere to define the IP of B426 IP module of BOSS panel. Also, how do you get that port number? In my case I can access the B426 IP module by calling https://local_ip without any port number

Thanks,
Savvas

Hi there,
The target IP (the MQTT server on which the Perl script is running) is defined in the AMAX alarm system. See the first line in the parameter settings (IP no. + Port).

B426

The B426 sends to the target IP via UDP

Best wishes
Michael

Ok, so I need to connect to my AMAX panel and change the IPno+Port so as to point to the IP the perl script is running?

That way, the communication will be in both ways? I will see the current status of my Alarm using H.A., but I will be able also to change it through H.A.?

More reading for me I suppose :slight_smile:

Thanks for your help :wink:

Hi there,
please excuse the late feedback.
Communication is currently only possible in one direction (AMAX -> HA). As far as I know, the communication board can only send information. At least that’s how it works with me.
Best wishes
Michael

Missed this thread, but I have a component in the HA Community Store for SIA-based alarms, and am currently working on getting it in HA as an official integration! Link to the current custom component: https://github.com/eavanvalkenburg/sia

Sidenote, I’ve tested it with my own alarm, which is by Ajax systems, but would love to also support Bosch alarms with this, so let me know if I can help during setup!

Hi @eavanvalkenburg

I have a Bosch system with the Bosch B426 Ethernet IP Module which is 2 way comms, using their cloud app

Would love to see if your integration can work with it

So, the 2 way comms def not, because that is done outside the SIA protocol, I am currently working on a proper release as a official integration so then it becomes super easy to test!

Hello @MichaelR. Could you explain in more detail how to install this server component on an Ubuntu?

Hi ,

anyone that work with AMAX 3000 and HA via SIA DC 09 ?

I manage to connect panel and HA but I only see the below, nothing more
image

all the other Connected devices are Unknown or Unavailable

Is there any custom configuration on entities to ‘learn’ my panels objects?
thanks

I’ve just added AMAX support using the bosch mode 2 protocol to GitHub - mag1024/bosch-alarm-homeassistant: Home Assistant integration using the bosch-alarm-mode2 library

Which is the same protocol that the RSC+ (the cloud smartphone app) uses, and that A-Link uses.

It is able to query everything directly from the panel, and i was testing it with an AMAX 2100, but it should work just fine with the 3000 as well. It also supports the Solution series and the B series as well.

1 Like