Satel Integra (Security System) with ethernet module Topic is solved

Others (MiLight, Hue, Toon etc...)

Moderator: leecollings

Post Reply
User avatar
proohu01
Posts: 95
Joined: Friday 17 October 2014 12:20
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: The Netherlands
Contact:

Satel Integra (Security System) with ethernet module

Post by proohu01 »

Has anyone tried to integrate the Satel Integra security system into Domoticz yet? There is a detailed protocoll description for the ETHM-1 module. http://www.satel.pl/en/download/instruk ... l_1.07.pdf

I am not a programmer so it is of no use to me :oops:

It should be possible: (link in Dutch) http://www.kopbeveiliging.nl/producten/ ... ng+leerdam
Pi 2 B | Pi Camera | PiFace 2 | RFXtrx433E (KaKu + Oregon Scientific) | Plugwise (9 Circles) | Aeon Z-Wave stick (Fibaro - dimmers, sockets, RGB, screens/blinds) | RFXMeter (Kwh/water/gaz) | WOL | Onkyo Receiver | RTC | Hikvision | Netatmo | Satel Integra
free_nsc
Posts: 36
Joined: Friday 19 December 2014 0:09
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Satel Integra (Security System) with ethernet module

Post by free_nsc »

Also interested in integrating Satel Integra with RaspberryPI so I am currently looking into the documentnantion
free_nsc
Posts: 36
Joined: Friday 19 December 2014 0:09
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Satel Integra (Security System) with ethernet module

Post by free_nsc »

@proohu01 I have found a script by xury which allowed me to get on to the right path - I have successfully send a frame to read my Satel integra 128wrl status.
I currently have 2x relay switches in my integra output lines which control the two zones in my gas Boiler. For this purpose, my goal is to be able to read my ABAX Thermometers and display/use them in scenes to then control Central Heating using domoticz instead of integra.

I have read out the temperature into Hex string using Bash script and can convert it into dec temperature value so this could be used in domoticz.
My problem here is that I am beginner when it comes to Domoticz and LUA so not sure how to return this value into Domoticz's virtual device.

I need someone's help as to how to add virtual thermometer device that will have its reading taken from the bash script which will polls temp. from Integra's ATD-100 inputs. Once we have this sorted we can read status of any other inputs/outputs etc.
User avatar
proohu01
Posts: 95
Joined: Friday 17 October 2014 12:20
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: The Netherlands
Contact:

Re: Satel Integra (Security System) with ethernet module

Post by proohu01 »

I'm eager to learn how you are able to get information from your Satel. Are you also able to determine if it ARMED or not? Please do tell :)
---------
Updating the virtual thermometer can be done by JSON or LUA.
For JSON, have a look at Wiki: http://www.domoticz.com/wiki/Domoticz_A ... emperature
It should be something like this

Code: Select all

DOMOTICZ_SERVER="192.168.0.104:8080"
IDX="67"
TEMP="25"
curl -s -i -H "Accept: application/json" "http://$DOMOTICZ_SERVER/json.htm?type=command&param=udevice&idx=IDX&nvalue=0&svalue=TEMP"
If you want to do it from LUA, have a look at this post: http://www.domoticz.com/forum/viewtopic.php?f=12&t=3692
Pi 2 B | Pi Camera | PiFace 2 | RFXtrx433E (KaKu + Oregon Scientific) | Plugwise (9 Circles) | Aeon Z-Wave stick (Fibaro - dimmers, sockets, RGB, screens/blinds) | RFXMeter (Kwh/water/gaz) | WOL | Onkyo Receiver | RTC | Hikvision | Netatmo | Satel Integra
free_nsc
Posts: 36
Joined: Friday 19 December 2014 0:09
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Satel Integra (Security System) with ethernet module

Post by free_nsc »

Important Note: Since I wrote the below post user Fanton has implemented full integration with Integra so we no longer require a script to parse the ATD100.
He has spent extra time and added support for ATD100 just based on my troubleshooting and experiments but without even having this hardware! All you need to do is rename one of the zone devices in Integra to contain "ATD100". Then Disable/Enable Satel hardware and voila! Fair play Fantom and thanks for hard work.


Here we go - this code is only a sample. Create a bash file change relevant variables below and then save the file and make it executable.
This is only designed to execute command 7D which is reading Zone temperatures.

In example below I am specifically reading zone x19 which is my SatelLivingTemp sensor. In integra this is zone number 25 = so converting into hex = 19. Next two bytes is crc x4F\xA8. I have calculated and hardcoded CRC. If you change the zone you want to query then you will need to calculate CRC using INT-RS CRC program (google it or else I will try attach it for you) or ideally incorporate CRC calculation into this script. I wasnt able to get correct CRC using bash script.

Code: Select all

#!/bin/bash
# Satelicz v.1.0 by free_nsc
# Reads temperature from Satel inputs
# SERVERPI is Domoticz IP and port
# IDX devid 
# NVALUE is the function in Domoticz device 0  holds temperature value 

SERVERPI="192.168.1.49:8080"
IDX="7"
NVALUE="0"
SATELIP="192.168.1.7"
SATELPORT="7094"

hex="$(echo -en "\xFE\xFE\x7D\x19\x4F\xA8\xFE\x0D" | nc $SATELIP $SATELPORT | hexdump -v -e ' 1/1 "%02X" " "')"
hexarray=($hex)
echo -n "Satel frame response : "
echo $hex
echo "----------------------------------------"
# echo "Display Byte 03 of the hex array"
# echo -n ${hexarray[3]}
echo  -n "Current sensor: "

# This is just to keep list of current sensors and to make sure we are updating the correct device as returned from Integra
case ${hexarray[3]} in

    "1C") echo "SatelOutsideTemp" ;;
    "19") echo "SatelLivingTemp" ;;
    "20") echo "SatelBed1FloorTemp" ;;
    "17") echo "SatelBed2FloorTemp" ;;
    
esac

# Satel returns temp values as follows 
# starting from -55.0'C = x00 , -54.5'C = x01, 00.0'c = x6E 
# Reading temperature from byte 05
# Convert from HEX to Decimal value
# then have to reduce absolute value by 110 and divide the result by 2


lcTempHex=${hexarray[5]}
lnTempRaw="$(echo $((16#$lcTempHex)))"
lnTempRaw="$(echo $[($lnTempRaw - 110)])"
lcTEMP=$(echo "scale=2; $lnTempRaw / 2.0" | bc)

echo -n "Current temperature reading : "
echo $lcTEMP
echo "----------------------------------------"
echo "Updating Domoticz Device ID : " $IDX
curl -s -H "Accept: application/json" "http://$SERVERPI/json.htm?type=command&param=udevice&idx=$IDX&nvalue=$NVALUE&svalue=$lcTEMP"
echo "Done."
In domoticz create virtual thermometer and activate it then write down the IDX and update this in the script above so the JSON query updates the correct virtual sensor.

Finally, you can add script into crontab so it runs periodically e.g. every 5 or 10 mins


Going back to CRC calculation. Below here with the code from stackoverflow to calc CRC. Unfortunately, this didn't work for me so I have hardcoded CRC for now:

Code: Select all

function awk_calc_crc16()
{
    output=$(echo $1 | awk 'function ord(c){return chmap[c];}
    BEGIN{c=65535; for (i=0; i < 256; i++){ chmap[sprintf("%c", i)] = i;}}
    {
        split($0, chars, "");
        for(i = 1; i <= length(chars); i++)
        {
            cval=ord(chars[i])
            e=and(xor(c, ord(chars[i])), 0x00FF);
            s=and(lshift(e, 4), 0x00FF);
            f=and(xor(e, s), 0x00FF);
            r=xor(xor(xor(rshift(c, 8), lshift(f, 8)), lshift(f, 3)), rshift(f, 4));
            c=r;
        }
    }
    END{c=xor(c, 0xFFFF); printf("%hu", c);}')
    echo $output;
}
Last edited by free_nsc on Sunday 17 January 2016 3:03, edited 2 times in total.
User avatar
proohu01
Posts: 95
Joined: Friday 17 October 2014 12:20
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: The Netherlands
Contact:

Re: Satel Integra (Security System) with ethernet module

Post by proohu01 »

Wonderful! That is something I can work with. Thank you for that.
I do not (yet) have any temperature sensors connected to my Satel, but I am able to determine whether or not a zone or partition is armed or not. For example:
Changing "\xFE\xFE\x7D\x19\x4F\xA8\xFE\x0D" in your script to "\xFE\xFE\x09\xD7\xEB\xFE\x0D" gives me an output like:

Code: Select all

pi@domoticzpi ~/domoticz/scripts $ ./satel.sh
Satel frame response : FE FE 09 01 00 00 00 7D AC FE 0D
----------------------------------------
Where "01" means partition 1 is ARMED

I'm not sure if I've got the CRC calculating bit under control. I may have to read that part a couple of times more. :oops:
Pi 2 B | Pi Camera | PiFace 2 | RFXtrx433E (KaKu + Oregon Scientific) | Plugwise (9 Circles) | Aeon Z-Wave stick (Fibaro - dimmers, sockets, RGB, screens/blinds) | RFXMeter (Kwh/water/gaz) | WOL | Onkyo Receiver | RTC | Hikvision | Netatmo | Satel Integra
free_nsc
Posts: 36
Joined: Friday 19 December 2014 0:09
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Satel Integra (Security System) with ethernet module

Post by free_nsc »

No worries glad to be of help. I'm only figuring it out myself now as I go.
You're getting right frame response so you got it!
Have you got the crc script working? if so share the code please.

How do you plan on using zone/partition statuses within Domoticz?
User avatar
proohu01
Posts: 95
Joined: Friday 17 October 2014 12:20
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: The Netherlands
Contact:

Re: Satel Integra (Security System) with ethernet module

Post by proohu01 »

I tried the CRC script but it doesn't work for me. I did find a Python (v3) script in the meantime that does also works for me and has a working CRC included. https://github.com/mkorz/IntegraPy

I want to be able to detect if the alarm has been (dis)armed or if a door or window is open for a long period of time. By running this script every minute, I suppose I would be able to change the state of some virtual switches in Domoticz. Than, create some LUA logic and/or notification around that. (future stuff)
Last edited by proohu01 on Thursday 08 January 2015 7:34, edited 1 time in total.
Pi 2 B | Pi Camera | PiFace 2 | RFXtrx433E (KaKu + Oregon Scientific) | Plugwise (9 Circles) | Aeon Z-Wave stick (Fibaro - dimmers, sockets, RGB, screens/blinds) | RFXMeter (Kwh/water/gaz) | WOL | Onkyo Receiver | RTC | Hikvision | Netatmo | Satel Integra
free_nsc
Posts: 36
Joined: Friday 19 December 2014 0:09
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Satel Integra (Security System) with ethernet module

Post by free_nsc »

I came across this script as well but wasn't able to run it cause I ran it as python as opposed to python3. Now it works :)
fantom
Posts: 269
Joined: Thursday 26 March 2015 10:40
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Poland
Contact:

Re: Satel Integra (Security System) with ethernet module

Post by fantom »

Hi

Few days ago i started implementig module for Satel Integra.
I have a basic version now.
I can send the compiled version to test.

Fantom
free_nsc
Posts: 36
Joined: Friday 19 December 2014 0:09
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Satel Integra (Security System) with ethernet module

Post by free_nsc »

Fantom please send it on and we will test.
User avatar
proohu01
Posts: 95
Joined: Friday 17 October 2014 12:20
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: The Netherlands
Contact:

Re: Satel Integra (Security System) with ethernet module

Post by proohu01 »

Yep, me two please. Can you also tell us what it can and cannot do?
Pi 2 B | Pi Camera | PiFace 2 | RFXtrx433E (KaKu + Oregon Scientific) | Plugwise (9 Circles) | Aeon Z-Wave stick (Fibaro - dimmers, sockets, RGB, screens/blinds) | RFXMeter (Kwh/water/gaz) | WOL | Onkyo Receiver | RTC | Hikvision | Netatmo | Satel Integra
fantom
Posts: 269
Joined: Thursday 26 March 2015 10:40
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Poland
Contact:

Re: Satel Integra (Security System) with ethernet module

Post by fantom »

Now its only reading state of zones and output.
In this week I will add outputs switching.
Now I enabled debug mode, than you may see many logs from this module.
The biggest problem is add new type of device to domoticz. Any existing do not match to Integra. Now I using 'percentage' and 'generalswitch'

But this code is good for developing.

Link : https://docs.google.com/uc?authuser=0&i ... t=download

Fantom
ps. Let me know how it works (or not works)
User avatar
proohu01
Posts: 95
Joined: Friday 17 October 2014 12:20
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: The Netherlands
Contact:

Re: Satel Integra (Security System) with ethernet module

Post by proohu01 »

I am not quite sure if I should just trust this! Is your code public? Why is the executable file called "domoticz"? That does not make sence to me.
Perhaps you should give us some more info on how to install and perhaps some screenshots.
Thank you.
Pi 2 B | Pi Camera | PiFace 2 | RFXtrx433E (KaKu + Oregon Scientific) | Plugwise (9 Circles) | Aeon Z-Wave stick (Fibaro - dimmers, sockets, RGB, screens/blinds) | RFXMeter (Kwh/water/gaz) | WOL | Onkyo Receiver | RTC | Hikvision | Netatmo | Satel Integra
fantom
Posts: 269
Joined: Thursday 26 March 2015 10:40
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Poland
Contact:

Re: Satel Integra (Security System) with ethernet module

Post by fantom »

More faith in people :)
I get branch 2659, added my source files and compiled under raspberry pi (linux). Are you use linux or windows ?
This is normal version of domoticz. If you use linux, You may temporary replace binary file 'domoticz', or only stopped original domoticz and run my file.

Basic sources i dropped some time ago : http://www.domoticz.com/forum/tracker.php?p=2&t=558
I think Gizmocuz has a vacation and does not speak from 2-3 weeks.

EDIT. I added output switching today.

Fantom
fantom
Posts: 269
Joined: Thursday 26 March 2015 10:40
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Poland
Contact:

Re: Satel Integra (Security System) with ethernet module

Post by fantom »

What would have also added?
I planning add switch "armed" and sensor "alarm"

Fantom
free_nsc
Posts: 36
Joined: Friday 19 December 2014 0:09
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Satel Integra (Security System) with ethernet module

Post by free_nsc »

fantom wrote:What would have also added?
I planning add switch "armed" and sensor "alarm"

Fantom
Im on holidays at the moment but will be testing it from tomorrow.
Add temperature sensors reading (7D) or have you already added that in?
User avatar
proohu01
Posts: 95
Joined: Friday 17 October 2014 12:20
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: The Netherlands
Contact:

Re: Satel Integra (Security System) with ethernet module

Post by proohu01 »

fantom wrote:More faith in people :)
I get branch 2659, added my source files and compiled under raspberry pi (linux). Are you use linux or windows ?
This is normal version of domoticz. If you use linux, You may temporary replace binary file 'domoticz', or only stopped original domoticz and run my file.

Basic sources i dropped some time ago : http://www.domoticz.com/forum/tracker.php?p=2&t=558
I think Gizmocuz has a vacation and does not speak from 2-3 weeks.

EDIT. I added output switching today.

Fantom
Hello fantom,
I am sorry I didn't trust it right away :oops: One can never be too careful! (right?) I applaud anyone willing to add new hardware support to Domoticz. Especially when it is hardware I use :D

However, it will take quite some time before I am able to test this on my system. I'll get back to you when I am able to test.
Pi 2 B | Pi Camera | PiFace 2 | RFXtrx433E (KaKu + Oregon Scientific) | Plugwise (9 Circles) | Aeon Z-Wave stick (Fibaro - dimmers, sockets, RGB, screens/blinds) | RFXMeter (Kwh/water/gaz) | WOL | Onkyo Receiver | RTC | Hikvision | Netatmo | Satel Integra
fantom
Posts: 269
Joined: Thursday 26 March 2015 10:40
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Poland
Contact:

Re: Satel Integra (Security System) with ethernet module

Post by fantom »

I upload the newest version : https://docs.google.com/uc?id=0B9UIjleS ... t=download

I added password (user code) field to configuration and handled broken connection.

Fantom
ps. Please, uncheck 'topic solved' ;)
free_nsc
Posts: 36
Joined: Friday 19 December 2014 0:09
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Satel Integra (Security System) with ethernet module

Post by free_nsc »

Fantom - I downloaded the file but it wont compile on RPi for me. it's quite large - 60Mb.
It does not run successfully. Any ideas?
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest