Ok so currently my DSC Alarm binding is mostly working using the IT-100 in Openhab2.
I can see when zones change state from open to close and close to open ect. Can even ARM the alarm in either stay or away mode.
The only thing I can’t do, is to disarm the alarm. This used to work in Openhab 1.8.2 when testing and learning before moving back to Openhab 2, when I had issues getting it to work in Openhab 2 (learned quite a bit since then).
When I try to disarm the alarm (doesnt matter if it is in stay or away mode). I get these in the logs:
2016-05-09 16:24:48.880 [INFO ] [smarthome.event.ItemCommandEvent ] - Item 'PARTITION1_ARM_MODE' received command 0
2016-05-09 16:24:48.883 [INFO ] [marthome.event.ItemStateChangedEvent] - PARTITION1_ARM_MODE changed from 1 to 0
2016-05-09 16:24:49.336 [INFO ] [marthome.event.ItemStateChangedEvent] - PANEL_MESSAGE changed from 500: A command has been received successfully. to 903: LED Status has changed.
2016-05-09 16:24:51.486 [INFO ] [marthome.event.ItemStateChangedEvent] - PARTITION1_ARM_MODE changed from 0 to 1
So in Openhab 1.8.2 the disarm only worked when supplying my user code in the config file, in openhab.cfg like:
dscalarm:usercode=1234
In Openhab2 I specified it as:
Bridge dscalarm:it100:ttyUSB0 [ serialPort="/dev/ttyUSB0", baud=115200, userCode=1234]
I also tried:
Bridge dscalarm:it100:ttyUSB0 [ serialPort="/dev/ttyUSB0", baud=115200, userCode=123400]
What do work is, if I manually send the disarm code to the IT-100:
echo -en "\n\
python dsc.py 0401123400`\r\n" > /dev/ttyUSB0`
Above, 040 is disarm, 1 for partition 1, then 1234 and 00 for the pin code, then the alarm disarm via the IT-100.
Now I am not 100% sure how I debug this via Openhab2, since I don’t see the communication directly myself, but whatever is happening, its as if nothing is happening, and openhab2 just sets the alarm mode back to stay or away depending on what it was. Presumably getting update poll data back.
ps. ping 123 is for illustration purposes only.
The dsc.py file is just so that it works out the checksum, so that I dont have to manually do that when sending testing commands directly to the IT-100.
import sys
var = []
var.append(sys.argv[1])
def calcChecksum(s):
calcSum=0
for c in s:
calcSum += ord(c)
calcSum %= 256
return calcSum
data = var[0]
pkt = "%s%02X" % (data, calcChecksum(data))
print pkt