SIA protocol

Use this forum to discuss possible implementation of a new feature before opening a ticket.
A developer shall edit the topic title with "[xxx]" where xxx is the id of the accompanying tracker id.
Duplicate posts about the same id. +1 posts are not allowed.

Moderators: leecollings, remb0

Post Reply
Ivanhoe1
Posts: 20
Joined: Monday 19 December 2016 20:42
Target OS: Windows
Domoticz version:
Contact:

SIA protocol

Post by Ivanhoe1 »

Missing some way to integrate home alarm systems to Domoticz. Many of them use SIA as protocol to talk with security centrals. Support for SIA would be nice. That would make for instance Ajax possible to integrate with domoticz.
Lundberg
Posts: 2
Joined: Saturday 09 March 2019 9:09
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: SIA protocol

Post by Lundberg »

Have you got any further with this?
Looking at integrating AJAX into my Domoticz setup as well.
User avatar
oeildefeu
Posts: 9
Joined: Saturday 28 December 2013 15:21
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.2
Location: France
Contact:

Re: SIA protocol

Post by oeildefeu »

Hello,
I did a small script that runs as a service on my Pi that recover the state of the alarm (armed, normal or night mode) but it could recover many other states
It requires pysiaalarm and python3-systemd (this latter being installed by apt) as packages and some I forgot (requests?)..

Here is the code:

Code: Select all

#! /usr/bin/env python3.9
import json
import requests
#import logging
import time

from pysiaalarm import SIAAccount, SIAClient, SIAEvent
import systemd.daemon

#logging.basicConfig(level=logging.DEBUG)

local_ip = "192.168.0.1"
sia_port = 8125
sia_account = "AAAA"
url_domoticz = "http://192.168.0.1:80/"
id_armed_night = "11" #night mode alarm switch id
id_armed_normal = "21" #alarm switch id
id_text = "35" #text device to recover non recognized code

reactions = {
	"BA" : [{"state":"ALARM","value":True}],
	"BS" : [{"state":"ALARM","value":True}],#device shorted
	"BV" : [{"state":"ALARM","value":True}],#intrusion
	"HA" : [{"state":"ALARM","value":True}],#hold-up
	"JA" : [{"state":"ALARM","value":True}],#Unauthorized access keypad
	"PA" : [{"state":"ALARM","value":True}],
	"SM" : [{"state":"ALARM","value":True}], #Alarm because of movement
	"YC" : [{"state":"ALARM","value":True}],#hub offline mobile and ethernet
	"NL" : [{"state":"ARM NIGHT" ,"value":True}],
	"NC" : [{"state":"ARM NIGHT" ,"value":True}],
	"OP" : [{"state":"ARM","value":False}],
	"CF" : [{"state":"ARM","value":True}], #armed with malfunction
	"CL" : [{"state":"ARM","value":True}],
	"OA" : [{"state":"ARM","value":False}],
	"FA":  [{"state":"FIRE" ,"value":True}],
	"KA":  [{"state":"FIRE" ,"value":True}],#temperature of fire sensor
	"WA":  [{"state":"LEAK","value":True}],
	"WH":  [{"state":"LEAK" ,"value":False}],
	"GA":  [{"state":"GAS","value":True}],
	"GH":  [{"state":"GAS" ,"value":False}],
	"BR" : [{"state":"ALARM","value":False}],
	"TA" : [{"state":"LID OPEN","value":True}],
	"TR" : [{"state":"LID OPEN","value":False}],
	"ZZ" : [{"state":"Device OFF","value":True}],
	"ZY" : [{"state":"Device OFF","value":False}],
	"YP" : [{"state":"Power failure","value":True}],
	"YQ" : [{"state":"Power failure","value":False}],
	"RB" : [{"state":"Updating firmware","value":True}],
	"RS" : [{"state":"Updating firmware","value":False}],
	"RP" : [],
	"YG" : [] #New settings
	}

def func(event: SIAEvent):
	#print(event.code)
	tipo = event.code
	if tipo in reactions:
		reaction = reactions[tipo]
		for reactio in reaction:
			state = reactio["state"]
			value = reactio["value"]
			print("Event: " + state + " : " + str(value))
			if state == "ARM" and value == False:
				r = requests.get(url_domoticz + 'json.htm?type=command&param=switchlight&idx=' + id_armed_normal + '&switchcmd=Off')
				r = requests.get(url_domoticz + 'json.htm?type=command&param=switchlight&idx=' + id_armed_night + '&switchcmd=Off')
			elif state == "ARM" and value == True:
				r = requests.get(url_domoticz + 'json.htm?type=command&param=switchlight&idx=' + id_armed_normal + '&switchcmd=On')
			elif state == "ARM NIGHT" and value == True:
				r = requests.get(url_domoticz + 'json.htm?type=command&param=switchlight&idx=' + id_armed_night + '&switchcmd=On')
	else:
		print("Unknown event: " + tipo )
		r = requests.get(url_domoticz + 'json.htm?type=command&param=udevice&idx=' + id_text + '&nvalue=0&svalue='+tipo)


account = [SIAAccount(sia_account, "")]
sleep_time = 1200
count = 0
#systemd.daemon.notify('READY=1')
with SIAClient(local_ip, sia_port, account, function=func) as client:
	#time.sleep(sleep_time)
	client.start()
	systemd.daemon.notify('WATCHDOG=1')
	while (True) :
		time.sleep(1)
		count = count + 1
		if count == 30:
			count = 0
			systemd.daemon.notify('WATCHDOG=1')
Raspberry Pi 3 - Raspbian + Razberry (OpenZwave) + RFXtrx433
BartSr
Posts: 395
Joined: Sunday 03 July 2016 16:16
Target OS: Raspberry Pi / ODroid
Domoticz version: V2024.7
Location: Netherlands
Contact:

Re: SIA protocol

Post by BartSr »

can you advice how to run this script?
-Bart
Raspberry pi 3b
Arduino
KAKU
RfxCom
Zwave2MQTT
OTGW
Chinese sensors temp (Dallas),movement
Tasmota
Esp8266 / 32 espeasy
Zigbee2MQTT
User avatar
oeildefeu
Posts: 9
Joined: Saturday 28 December 2013 15:21
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.2
Location: France
Contact:

Re: SIA protocol

Post by oeildefeu »

Hello,
Sorry I'm on my phone, so I'll give a short but normally good reply: go to this french thread forum and translate it in your language if necessary:

https://easydomoticz.com/forum/viewtopi ... 1c2e4ff491

You'll see the steps and how to run the script!
Raspberry Pi 3 - Raspbian + Razberry (OpenZwave) + RFXtrx433
User avatar
waltervl
Posts: 5852
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: SIA protocol

Post by waltervl »

BartSr wrote: Friday 21 February 2025 15:49 can you advice how to run this script?
-Bart
Check how I did it for another python script (TelegramBot) running as a service:
https://github.com/waltervl/dynamicTele ... emd-script
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
User avatar
FireWizard
Posts: 1892
Joined: Tuesday 25 December 2018 12:11
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Voorthuizen (NL)
Contact:

Re: SIA protocol

Post by FireWizard »

Hi,

See also this thread: viewtopic.php?p=320043&hilit=SIA+protocol#p320043

I did create something in this thread, but it ended in a dead end street.

Regards
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest