Permalink
Browse files

eltako.py zum erzeugen von enocean telegrammen

  • Loading branch information...
1 parent 7a0c39d commit 7ea9637cdb508632549c78e7e41288c40fdaef46 @uescher uescher committed Jan 14, 2012
Showing with 13 additions and 0 deletions.
  1. +13 −0 util/eltako.py
View
@@ -0,0 +1,13 @@
+import serial
+import sys
+
+ser= serial.Serial(sys.argv[1],sys.argv[2],timeout=1)
+toSend = [0xa5,0x5a,0x0b,0x05,int(sys.argv[4])*32+80,0x0,0x0,0x0,0x0,0x0,0x0,int(sys.argv[3]),0x10]
+checksum = 0
+for aInt in toSend[2:]:
+ checksum=checksum + aInt
+checksum=checksum%256
+for aByte in toSend:
+ ser.write(chr(aByte))
+ser.write(chr(checksum))
+ser.close()

0 comments on commit 7ea9637

Please sign in to comment.