-
-
Save pocki80/941fa090a8d6269a9b3b68c195f8750f to your computer and use it in GitHub Desktop.
#!/usr/bin/python3 | |
# use this to decode HDLC packets from a powergrid smartmeter. | |
# supported data sources so far: | |
# 'WN' WienerNetze ISKRAEMECO AM550 from D0 interface (infrared) | |
# 'KN' KärntenNetz ISKRAEMECO AM550 from P1 interface (RJ12) | |
# 'WN350' WienerNetze SIEMENS IM350 from D0 interface (infrared) | |
# | |
# you might need to install pycryptodome: | |
# pip install pycryptodome | |
#paste your AES-key here | |
#in case of WienerNetze: can be found from WienerNetze Webportal https://www.wienernetze.at/wnapp/smapp/ -> Anlagedaten | |
key='aabbccddeeff00112233445566778899' | |
#select ONE of the supported device codes: WN, KN! | |
#paste a full HDLC frame here: starting 7ea067 ending 7e | |
#in case of WienerNetze: should be 210 hex digits = 105 bytes = 0x69 -> length byte 3 shows 0x67 | |
device='WN' | |
data='7ea067cf022313fbf1e6e700db0844556677889900aa4f20888877775540d5496ab897685e9b7e469942209b881fe280526f77c9d1dee763afb463a9bbe88449cb3fe79725875de945a405cb0f3119d3e06e3c4790130a29bc090cdf4b323cd7019d628ca255fce57e' | |
#in case of KärntenNetz: should be 242 hex digits = 121 bytes = 0x79 -> length byte 3 shows 0x77 | |
device='KN' | |
data='7ea077cf022313bb45e6e700db0844556677889900aa5f208888777755408e03e4b8976857817a5a975d209bc49fe2855265702ac9cce48cad9452674dd9b07ebe8d6ba115b768de47a801f9443e1cc825973b4796138611960f0cdf4d323ad789455f8aa25c5ce7aa15fca3eaa5171f74dff8b5592c62c57e' | |
#in case of WienerNetze using a Siemens IM350: should be 250 hex digits = 125 bytes = 0x7d -> length byte 3 shows 0x7b | |
device='WN350' | |
data='7ea07bcf000200231362b1e6e700db0844556677889900aa6120888877775540045536b8976a5e957b58866c209b881fe2835273236183f4d44394a953664fd8b279bf8b529d226059c245aa10c844c8ddcfc69f4f72ed147c2fbc090adf4d330ed101ea861ea4a1186ffc13fcafa7a3111f74dff1b3502ce3baaeb07e' | |
# data string of WienerNetze AM550 explained: | |
# 7e start-byte, hdlc opening flag | |
# a0 address field? | |
# 67 length field? | |
# cf control field? | |
# 02 length field? | |
# 23 ? | |
# 13 frame type | |
# fbf1 crc16 from byte 2-7 | |
# e6e700 some header? | |
# db some header? | |
# 08 length of next field | |
# 44556677889900aa systemTitle | |
# 4f length of next field | |
# 20 security byte: encryption-only | |
# 88887777 invocation counter | |
# 5540d5496ab897685e9b7e469942209b881fe280526f77c9d1dee763afb463a9bbe88449cb3fe79725875de945a405cb0f3119d3e06e3c4790130a29bc090cdf4b323cd7019d628ca255 ciphertext | |
# fce5 crc16 from byte 2 until end of ciphertext | |
# 7e end-byte | |
## lets go | |
import binascii | |
##CRC-STUFF BEGIN | |
CRC_INIT=0xffff | |
POLYNOMIAL=0x1021 | |
def byte_mirror(c): | |
c=(c&0xF0)>>4|(c&0x0F)<<4 | |
c=(c&0xCC)>>2|(c&0x33)<<2 | |
c=(c&0xAA)>>1|(c&0x55)<<1 | |
return c | |
def calc_crc16(data): | |
crc=CRC_INIT | |
for i in range(len(data)): | |
c=byte_mirror(data[i])<<8 | |
for j in range(8): | |
if (crc^c)&0x8000: crc=(crc<<1)^POLYNOMIAL | |
else: crc=crc<<1 | |
crc=crc%65536 | |
c=(c<<1)%65536 | |
crc=0xFFFF-crc | |
return 256*byte_mirror(crc//256)+byte_mirror(crc%256) | |
def verify_crc16(input, skip=0, last=2, cut=0): | |
lenn=len(input) | |
data=input[skip:lenn-last-cut] | |
goal=input[lenn-last-cut:lenn-cut] | |
if last == 0: return hex(calc_crc16(data)) | |
elif last == 2: return calc_crc16(data)==goal[0]*256 + goal[1] | |
return False | |
##CRC-STUFF DONE | |
##DECODE-STUFF BEGIN | |
from Crypto.Cipher import AES | |
def decode_packet(input): ##expects input to be bytearray.fromhex(hexstring), full packet "7ea067..7e" | |
if verify_crc16(input, 1, 2, 1): | |
global device | |
if device=='WN350': add=2 | |
else: add=0 | |
nonce=bytes(input[14+add:22+add]+input[24+add:28+add]) #systemTitle+invocation counter | |
cipher=AES.new(binascii.unhexlify(key), AES.MODE_CTR, nonce=nonce, initial_value=2) | |
return cipher.decrypt(input[28+add:-3]) | |
else: | |
return '' | |
##DECODE-STUFF DONE | |
def bytes_to_int(bytes): | |
result = 0 | |
for b in bytes: | |
result = result * 256 + b | |
return result | |
def show_data(s): | |
global device | |
if device=='WN' or device=='WN350': | |
if device=='WN350': add=18 | |
else: add=0 | |
a=bytes_to_int(s[35+add:39+add])/1000.000 #+A Wh | |
b=bytes_to_int(s[40+add:44+add])/1000.000 #-A Wh | |
c=bytes_to_int(s[45+add:49+add])/1000.000 #+R varh | |
d=bytes_to_int(s[50+add:54+add])/1000.000 #-R varh | |
e=bytes_to_int(s[55+add:59+add]) #+P W | |
f=bytes_to_int(s[60+add:64+add]) #-P W | |
g=bytes_to_int(s[65+add:69+add]) #+Q var | |
h=bytes_to_int(s[70+add:74+add]) #-Q var | |
yyyy=bytes_to_int(s[22+add:24+add]) | |
mm=bytes_to_int(s[24+add:25+add]) | |
dd=bytes_to_int(s[25+add:26+add]) | |
hh=bytes_to_int(s[27+add:28+add]) | |
mi=bytes_to_int(s[28+add:29+add]) | |
ss=bytes_to_int(s[29+add:30+add]) | |
print ("Output: %10.3fkWh, %10.3fkWh, %10.3fkvarh, %10.3fkvarh, %5dW, %5dW, %5dvar, %5dvar at %02d.%02d.%04d-%02d:%02d:%02d" %(a,b,c,d,e,f,g,h, dd,mm,yyyy,hh,mi,ss)) | |
elif device=='KN': | |
a=bytes_to_int(s[57:61])/1000.000 #+A Wh | |
b=bytes_to_int(s[62:66])/1000.000 #-A Wh | |
c=bytes_to_int(s[67:71])/1000.000 #+R varh | |
d=bytes_to_int(s[72:76])/1000.000 #-R varh | |
e=bytes_to_int(s[77:81]) #+P W | |
f=bytes_to_int(s[82:86]) #-P W | |
yyyy=bytes_to_int(s[51:53]) | |
mm=bytes_to_int(s[53:54]) | |
dd=bytes_to_int(s[54:55]) | |
hh=bytes_to_int(s[45:46]) | |
mi=bytes_to_int(s[46:47]) | |
ss=bytes_to_int(s[47:48]) | |
print ("Output: %10.3fkWh, %10.3fkWh, %10.3fkvarh, %10.3fkvarh, %5dW, %5dW at %02d.%02d.%04d-%02d:%02d:%02d" %(a,b,c,d,e,f, dd,mm,yyyy,hh,mi,ss)) | |
else: | |
print ("Device type not recognized") | |
dec=decode_packet(bytearray.fromhex(data)) | |
show_data(dec) if (dec) else 'CRC error' | |
binascii.hexlify(dec) | |
# plaintext hex string of WienerNetze explained | |
# 0f start-byte? | |
# 0059a374 packet number, appears to be IC+1 (faked in this example) | |
# 0c intro 12byte-timestamp | |
# 07e5 01 1b 03 10 0b 2d 00ffc400 timestamp: year,month,day,dow,hours,minutes,seconds | |
# 020909 some header for the following 9-value-structure? | |
# 0c intro 12byte-timestamp | |
# 07e5 01 1b 03 10 0b 2d 00ffc400 timestamp: year,month,day,dow,hours,minutes,seconds | |
# 06 intro 32bit-value | |
# 004484bc +A Wh | |
# 06 intro 32bit-value | |
# 0000053e -A Wh | |
# 06 intro 32bit-value | |
# 0001004b +R varh | |
# 06 intro 32bit-value | |
# 001c20f1 -R varh | |
# 06 intro 32bit-value | |
# 00000176 +P W | |
# 06 intro 32bit-value | |
# 00000000 -P W | |
# 06 intro 32bit-value | |
# 00000000 +Q var | |
# 06 intro 32bit-value | |
# 000000f4 -Q var | |
# plaintext hex string of KärntenNetz explained | |
# 0f | |
# 0002e9fa | |
# 0c | |
# 07e5 08 01 07 0c 05 32 00ff8880 # 01.08.2021 12:05:50 | |
# 02 0c | |
# 0906 0006190900ff # 0.6.25.9.0.255 Firmwareversion? | |
# 090d 31313231323731363030303030 # 1121271600000 S/N? | |
# 0904 0c053200 # 12:05:50.000 Time | |
# 0905 07e5080100 # 01.Aug.2021 Date | |
# 06 01fa3e2a # 33177130 +A Wh | |
# 06 00000000 # 0000 -A Wh | |
# 06 0088de3d # 8969789 +R varh | |
# 06 00fd4489 # 16598153 -R varh | |
# 06 00000c4d # 3149 +P W | |
# 06 00000000 # 0000 -P W | |
# 0900 # Customer info text | |
# 0900 # Customer info code | |
# plaintext hex string of WienerNetze using SIEMENS IM350 explained | |
# 0f start-byte? | |
# 00 88bf28 nonce is 0188bf29, seams to be related? | |
# 0c 07e70115060e140300ffc400 timestamp | |
# 02 0a 10 fields follow | |
# 0910 534d5331303330373030303030303030 #16 byte seriennummer | |
# 090c 07e70115060e140300ffc400 timestamp | |
# 06 0075357d ## +A Wh 7.681.405Wh | |
# 06 00000000 ## -A Wh 0Wh | |
# 06 00000132 ## +R varh 306varh | |
# 06 0071e492 ## -R varh 7.464.082varh | |
# 06 00000150 ## +P W 336W | |
# 06 00000000 ## -P W 0W | |
# 06 00000000 ## +Q var 0var | |
# 06 0000013e ## -Q var 318var |
Strange. Ich habe es nun auf python3 angepasst. Eventuell musst du pycryptodome dazuinstallieren. Bei mir gehts dann (aber nur ohne "sudo").
Anmerkung am Rande: Die Beispiel-Daten mit dem Beispiel-Key lassen sich im Beispiel entschlüsseln und liefern dann ein reales Plaintext-Paket.
ja super! mit pycrptodome gehts ;) danke! ist es okay wenn ich deinen code verwende, sollte ich dazu kommen eine Home assistant integration zu basteln ;)?
bei homeassistant ist alles in python ;) aber mit python ist es auch einfacher schnell mal einen serial reader zu bauen
Hallo ich bin auch gerade dabei die Daten meines Smartmeters auszulesen leider bin ich in Niederösterreich und bin bei der EVN. Ich habe leider noch keinen Schlüssel bekommen aber ich habe ein Beispiel erhalten und will es damit probieren. Leider schauen meine Daten etwas anders aus und wollte fragen ob ihr einen Idee habt wie ich dieses Scrip nutzen kann. Im Anhang ist die PDF Datei von der EVN.
Daten vor der Verschlüsselung
DB085341475905E6A31381F8200001D23432B01242AC1A9952
07422F7CC452CA85CA0612F1BF9922A7ACC7E51DA8C897C97
AF5EFF013D3E47E602BE65E860C1F253DF010B435B5EDBBFDE0
C295B1027E8EB65D1CF6575FA07C80B33F274D3FAA21C89E2D
F3F36023CA30775597F5BA3BB4A5F844C6DCC5C32AD68FED3C
D3DD08A9C125B1D565B78F583B6BACA03C4CD91CE1154180E
8F9F099F0C23A66A67A9A86F7B9C5A59613FE23F9FA55967E06
A4CD0EF02D3A791D553C2517D2E29B6CB707A8B17D9762353
D0FE56854277419B5F2C1FDAD40FA9686997E60AE1FCD6C5DC5
DC756B141D8B160EF05455C7B9C07A435E43B75DAD57099069
7702691901D7249EE1DF
Key
00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
Entschlüsselter Datensatz
0F800000040C07E001040117222300FFC4000223090C07E00104
0117222300FFC40009060100010800FF06000020B002020F0016
1E09060100020800FF0600000C6902020F00161E090601000107
00FF060000000002020F00161B09060100020700FF0600000000
02020F00161B09060100200700FF1208F902020FFF1623090601
00340700FF1208FD02020FFF162309060100480700FF1208FA02
020FFF1623090601001F0700FF12000002020FFE1621090601003
30700FF12000002020FFE162109060100470700FF12000002020
FFE1621090601000D0700FF1003E802020FFD16FF090C3137383
da die daten über mbus übertragen werden und nicht über dir IR schnittstelle hilft dir dieses script nicht weiter.
im gurux forum wurde von jemand anderem aus NOE gerade etwas in die richtung geposted:
http://www.gurux.fi/comment/19798#comment-19798
Kleiner fehler: Am anfang des scripts steht: "pip install pycryptedome"
Sollte wohl eher "pip install pycryptodome" heißen ;-)
Danke für die super Arbeit! Muss das gleich ausprobieren :-)
Hi any hint, why the data I receive on the IR Port of my WN smartmeter don't match the 7e...7e pattern?
They come like this:
16:52:16.457 : 77 33 32 c2 03 4e 53 bb b4 08 a4 87 06 a8 f2 6a a5 41 3d c1 b5 3d 0e 6c 44 67 62 4e fb 78 aa 9c ab cc da 4c 53 9b 68 67
16:52:20.443 : 77 16 13 30 10 34 2f 04 4f d6 40 4f 13 86 8a 82 f8 63 ad c5 7f d0 1a 9e 85 e1 c1 6f fd 73 7c 0c 80 92 7d c7 31 02 1c cd
16:52:26.441 : 77 fe 16 98 8f bd 85 8b 11 04 57 96 06 de 8c d3 9f ec e8 7e e1 79 a0 39 ad 0b f2 c7 92 45 7a 95 6f 8c 32 78 90 ed 2d 07
16:52:39.437 : 77 d7 24 a6 bc 3f 12 62 f5 83 33 ca 5e 2e 63 86 50 45 38 52 43 09 d3 48 6a b5 56 be d6 ba 80 0b 66 e8 d7 cc 8f cf ee c2
16:52:55.442 : 77 49 cc ab 8e 70 54 30 18 26 aa e6 fc a4 6b a4 bb 14 4a cc e8 f3 76 4d 49 d5 1d c9 9e 3a ee a8 01 b0 57 00 73 36 19 a1
16:52:57.457 : 77 88 72 34 d4 4f e3 df 19 b0 45 65 4c b8 c6 a0 32 5d 6e 27 2e 01 36 f2 db 12 8b be c4 52 7d c3 45 81 4f bf 18 ba 22 44
16:53:00.483 : 77 c2 e9 88 d9 4b aa 0e be 1d 1c f5 99 6e e1 e6 55 6f 2b b3 1d 51 80 08 0e 85 02 ac 07 f3 9c 3e 44 6a e9 83 a3 ee 44 68
16:53:04.489 : 77 bf bb 45 5c 03 ba ee f2 06 76 f2 f4 61 f6 02 c3 e6 a7 a1 8c b9 58 49 2d 98 9c b2 f5 12 aa f5 fa 7e 7e a0 67 cf 02 23
16:53:05.472 : 77 5e e9 57 ef a6 65 9b 2a 09 ed 3e c2 fe 9a 71 b4 b9 0e 85 a5 75 1b cf 93 53 c8 7e 7e a0 67 cf 02 23 13 fb f1 e6 e7 00
16:53:09.443 : 77 3b 1e a9 2c 4f 84 4e a6 06 16 30 86 6d ca 22 1e 24 aa ff 47 7a 86 44 3f cf a9 5f fd a1 23 56 7b 99 ff 3b 0f 1e 4e 81
16:53:20.509 : 77 8d 4b 18 d8 87 37 02 0f 1c 39 0d 55 3c f0 5b e7 9c e8 3d e7 2f 34 4a bf d9 9a 11 af 6b b6 3d 71 3d 1c 43 98 7b 41 ae
16:53:24.466 : 77 f5 12 40 e1 31 24 7e 7e a0 67 cf 02 23 13 fb f1 e6 e7 00 db 08 49 53 4b 68 74 99 f5 08 4f 20 00 1d 46 a1 58 2d 27 07
I am listening through Tasmota and my very basic script is :
>D
>B
->sensor53 r
>M 1
+1,3,s,16,9600,STROM
1,77070100010800ff@1000,Total consumption,KWh,Total_in,4
#
So first meter, on Pin 3 is the RX LED, I want to get SML, at 9600 baud, and i called it STROM. Is there any activation sequence needed? I couldn't find any manuals on this device so I'm pretty much in the dark.
I think it does follow the 7ea067...7e pattern, but your device seems listening to a pattern starting 77.
Look at your last line, there you can see an ending 7e followed by a new paket's beginning 7e a0 67 header.
---end
16:53:24.466 : 77 f5 12 40 e1 31 24 7e 7e a0 67 cf 02 23 13 fb f1 e6 e7 00 db 08 49 53 4b 68 74 99 f5 08 4f 20 00
start---
Thanks! I even looked for the 7e pattern somewhere else, but missed it. I think this solved my problem on the IR receiving side.
Note to anybody reading this: Use RAW instead of SML and you won't get the 77 at the beginning.
Any chances this script will work with the optical output of Landis Gyr E450 from Wiener Netze?
Do you have an IR-Reader and can provide the output of a data packet sent by the meter?
@tofuSCHNITZEL I'm still working on getting reasonable output from the reader. But I'm optimistic the decoding will work once the source data is read correctly. Do you know where the start sequence of the data packet 7ea0
is coming from? For some reason, my reader outputs 7effa0
.
I don't think it is 7ea0 it is just 7e at the beginning and end
Well the problem was that I did orient the probe upwards down (because I did not like the cable hanging down), reorienting it the correct ways, cable hanging down, it works! For reference, I'm using a German Metering OP-400 RS485 optical probe, cable length ~30m or so, from 2nd floor to basement.
Yes, send and receive diode orientation is fixed.
Hallo,
ich betreibe eine Website bezüglich Samrt Meter in Österreich. Ich möchte alle Projekte verlinken um alle Samrt Meter in Österreich abzudecken. Mittlerweile habe ich Niederösterreich, Salzburg und Vorarlberg.
Ich wollte nachfragen ob dieses Skript für die Wiener Netze funktuniert.
Am besten melden Sie sich bei mir support@michaelreitbauer.at
Freundliche Grüße Michael
Ich wollte nachfragen ob dieses Skript für die Wiener Netze funktuniert.
Ja, das tut es.
Mehr Details verraten der Dateiname und die Kommentare im Code.
This is everything I get from my ttyUSB0.
Where do I get the HDLC data?
You need to propperly read byte data from that port. One possible method is by python like this:
#!/usr/bin/python
import time
import serial
port = serial.Serial("/dev/serial0", baudrate=9600, timeout=0.3)
while True:
rcv = port.read(300)
row="".join("{:02x}".format(ord(c)) for c in rcv)
print(row)
time.sleep(0.2)
This is everything I get from my ttyUSB0.
Where do I get the HDLC data?You need to propperly read byte data from that port. One possible method is by python like this:
#!/usr/bin/python import time import serial port = serial.Serial("/dev/serial0", baudrate=9600, timeout=0.3) while True: rcv = port.read(300) row="".join("{:02x}".format(ord(c)) for c in rcv) print(row) time.sleep(0.2)
Thx a lot - my brother (he did 99% of that job 😅) and I mentioned it - very important seems to be the configuration of the IR Probe. Mine is a Weidemann Electronics
stty -F /dev/ttyUSB0 9600 -parenb cs8 -cstopb -ixoff -crtscts -hupcl -ixon -opost -onlcr -isig -icanon -iexten -echo -echoe -echoctl -echoke
for a raspberry pi
I built a small reader application that publishes the data via MQTT for the RPi based on this Gist: https://github.com/machinekoder/wn_smart_reader
Thanks! I even looked for the 7e pattern somewhere else, but missed it. I think this solved my problem on the IR receiving side. Note to anybody reading this: Use RAW instead of SML and you won't get the 77 at the beginning.
Hi,
can you paste your working script for the AM550 @ Wiener Netze via Tasmota+IR? Maybe you could also contribute to https://tasmota.github.io/docs/Smart-Meter-Interface/#iskra-mt-175-sml
Thx in advance!
br
Thanks! I even looked for the 7e pattern somewhere else, but missed it. I think this solved my problem on the IR receiving side. Note to anybody reading this: Use RAW instead of SML and you won't get the 77 at the beginning.
Hi,
can you paste your working script for the AM550 @ Wiener Netze via Tasmota+IR? Maybe you could also contribute to https://tasmota.github.io/docs/Smart-Meter-Interface/#iskra-mt-175-sml
Thx in advance! br
Hi, I want to read my IR-Data from a ISKRA AM550 - Wiener Netze.
I have this script for Tasmota
D
B
=>sensor53 r
M 1
+1,3,r,16,9600,AM550
1,=so4,KEYSSSSS
1,77070100100700ff@1,Leistung,W,Power_curr,1
1,77070100010800ff@1000,Verbrauch,KWh,Total_in,1
I get this from the Console in Tasmota. Any hint why it doesnt show me real numbers?
br
17:10:49.972 : 7e a0 67 cf 02 23 13 fb f1 e6 e7 00 db 08 49 53 4b 69 74 9a 20 7c 4f 20 00 79 7a
17:10:50.009 : f1 a6 93 e8 1f d0 4a 8d 6b 30 ee a6 a3 18 ae 11 9a ec 5d d2 99 bb 35 3c 02 58 db a8 ca cc b9 2d 96 3a 73 e4 a2 24 75 b3
17:10:50.077 : ba 56 2a 73 8b 2b 3a 86 e9 e6 94 70 56 70 42 da 6e 25 37 3a 66 10 88 dc f6 20 fb 9e b3 1f 7d 90 02 54 7e
17:10:50.973 : 7e a0 67 cf 02 23 13 fb f1 e6 e7 00 db 08 49 53 4b 69 74 9a 20 7c 4f 20 00 79 7a f2 e9 81 65 2f df af a6
17:10:51.020 : 44 9c 39 8a ae 3f d6 25 87 8d 15 91 53 45 59 79 4c f7 7a 2f b9 6a 95 6e e0 6c 08 02 7b 18 77 9c 9e b4 f4 19 63 0b fe 88
17:10:51.063 : ad 7c 17 b3 3b 2a e6 d0 69 98 b7 dd b8 94 5a a0 b4 6a 10 84 a0 ad 43 9b d2 fe 37 7e
17:10:51.969 : 7e a0 67 cf 02 23 13 fb f1 e6 e7 00 db 08 49 53 4b 69 74 9a 20 7c 4f 20 00
17:10:52.006 : 79 7a f3 24 93 27 d8 e7 32 37 49 9e 32 65 6e ab 72 22 18 c8 e3 80 5d 5f 48 4e 8d e7 f4 f9 49 f5 12 c5 dd c4 30 09 95 af
17:10:52.052 : 2a 54 74 8c ed fe 83 77 25 7c c4 a2 0a fd c7 ca da 86 16 25 7d cd bf 0a 5a 7b c3 a4 6f 73 8c 66 7d f7 34 60 80 62 7e
17:10:52.970 : 7e a0 67 cf 02 23 13 fb f1 e6 e7 00 db 08 49 53 4b 69 74 9a 20 7c 4f 20 00 79 7a f4 15 ac cd a0 a3 b2
17:10:53.020 : 74 0e 43 88 fe 7d 47 12 0f 8b ab 97 0d 37 b2 b8 bb f7 90 b2 23 6b ed 78 38 91 c9 ff c5 07 eb 17 8c 3e 11 0d d3 09 c5 57
17:10:53.067 : 35 b4 36 73 60 b5 8b ce 6e df e7 d7 67 58 e3 80 ad b0 e7 77 39 17 3e 62 23 01 a6 1f 7e
17:10:53.980 : 7e a0 67 cf 02 23 13 fb f1 e6 e7 00 db 08 49 53 4b 69 74 9a 20 7c 4f 20 00 79 7a f5 59 28 3b 2c 66 8c f4 8e 8d
17:10:54.021 : ac 1d 45 30 f4 31 4f 45 84 94 74 d7 b8 06 94 e5 7d 0b ce 45 af f2 23 7d f4 ad 51 bd 1a 35 79 56 ea 9d 26 82 d2 98 70 8d
17:10:54.064 : 6e 1c de 46 18 5a a3 aa 50 9f 30 e3 1e 59 ca 9c 00 d2 48 67 0a 94 e2 a5 54 7e
Thanks! I even looked for the 7e pattern somewhere else, but missed it. I think this solved my problem on the IR receiving side. Note to anybody reading this: Use RAW instead of SML and you won't get the 77 at the beginning.
Hi,
can you paste your working script for the AM550 @ Wiener Netze via Tasmota+IR? Maybe you could also contribute to https://tasmota.github.io/docs/Smart-Meter-Interface/#iskra-mt-175-sml
Thx in advance! brHi, I want to read my IR-Data from a ISKRA AM550 - Wiener Netze.
I have this script for Tasmota
D
B
=>sensor53 r
M 1
+1,3,r,16,9600,AM550
1,=so4,KEYSSSSS
1,77070100100700ff@1,Leistung,W,Power_curr,1
1,77070100010800ff@1000,Verbrauch,KWh,Total_in,1I get this from the Console in Tasmota. Any hint why it doesnt show me real numbers? br
17:10:49.972 : 7e a0 67 cf 02 23 13 fb f1 e6 e7 00 db 08 49 53 4b 69 74 9a 20 7c 4f 20 00 79 7a 17:10:50.009 : f1 a6 93 e8 1f d0 4a 8d 6b 30 ee a6 a3 18 ae 11 9a ec 5d d2 99 bb 35 3c 02 58 db a8 ca cc b9 2d 96 3a 73 e4 a2 24 75 b3 17:10:50.077 : ba 56 2a 73 8b 2b 3a 86 e9 e6 94 70 56 70 42 da 6e 25 37 3a 66 10 88 dc f6 20 fb 9e b3 1f 7d 90 02 54 7e 17:10:50.973 : 7e a0 67 cf 02 23 13 fb f1 e6 e7 00 db 08 49 53 4b 69 74 9a 20 7c 4f 20 00 79 7a f2 e9 81 65 2f df af a6 17:10:51.020 : 44 9c 39 8a ae 3f d6 25 87 8d 15 91 53 45 59 79 4c f7 7a 2f b9 6a 95 6e e0 6c 08 02 7b 18 77 9c 9e b4 f4 19 63 0b fe 88 17:10:51.063 : ad 7c 17 b3 3b 2a e6 d0 69 98 b7 dd b8 94 5a a0 b4 6a 10 84 a0 ad 43 9b d2 fe 37 7e 17:10:51.969 : 7e a0 67 cf 02 23 13 fb f1 e6 e7 00 db 08 49 53 4b 69 74 9a 20 7c 4f 20 00 17:10:52.006 : 79 7a f3 24 93 27 d8 e7 32 37 49 9e 32 65 6e ab 72 22 18 c8 e3 80 5d 5f 48 4e 8d e7 f4 f9 49 f5 12 c5 dd c4 30 09 95 af 17:10:52.052 : 2a 54 74 8c ed fe 83 77 25 7c c4 a2 0a fd c7 ca da 86 16 25 7d cd bf 0a 5a 7b c3 a4 6f 73 8c 66 7d f7 34 60 80 62 7e 17:10:52.970 : 7e a0 67 cf 02 23 13 fb f1 e6 e7 00 db 08 49 53 4b 69 74 9a 20 7c 4f 20 00 79 7a f4 15 ac cd a0 a3 b2 17:10:53.020 : 74 0e 43 88 fe 7d 47 12 0f 8b ab 97 0d 37 b2 b8 bb f7 90 b2 23 6b ed 78 38 91 c9 ff c5 07 eb 17 8c 3e 11 0d d3 09 c5 57 17:10:53.067 : 35 b4 36 73 60 b5 8b ce 6e df e7 d7 67 58 e3 80 ad b0 e7 77 39 17 3e 62 23 01 a6 1f 7e 17:10:53.980 : 7e a0 67 cf 02 23 13 fb f1 e6 e7 00 db 08 49 53 4b 69 74 9a 20 7c 4f 20 00 79 7a f5 59 28 3b 2c 66 8c f4 8e 8d 17:10:54.021 : ac 1d 45 30 f4 31 4f 45 84 94 74 d7 b8 06 94 e5 7d 0b ce 45 af f2 23 7d f4 ad 51 bd 1a 35 79 56 ea 9d 26 82 d2 98 70 8d 17:10:54.064 : 6e 1c de 46 18 5a a3 aa 50 9f 30 e3 1e 59 ca 9c 00 d2 48 67 0a 94 e2 a5 54 7e
I don't think it works that way. this script (in this git) is not intended for tasmota. this variant is intended for you to use a python script to read the serial interface of your ir reader and decrypt the data received with this script... i can't help you there either, try tasmota git.
Habe zuerst versucht mit @machinekoder seinem Projekt meinen Siemens IM350 der Wiener Netze einzubinden, bin aber gescheitert. Mit Pocki80 Code kann ich wenigstens mal glaubwürdige Daten generieren. Aber wie ich mittels mqtt das ganze in Home Assistant bekomme, übersteigt mein 0815 Linux wissen. Könnte mir jemand helfen einen “Frankenstein-Code” zu Basteln. Danke
Habe zuerst versucht mit @machinekoder seinem Projekt meinen Siemens IM350 der Wiener Netze einzubinden, bin aber gescheitert. Mit Pocki80 Code kann ich wenigstens mal glaubwürdige Daten generieren. Aber wie ich mittels mqtt das ganze in Home Assistant bekomme, übersteigt mein 0815 Linux wissen. Könnte mir jemand helfen einen “Frankenstein-Code” zu Basteln. Danke
du hast eine pm im anderen forum von mir... ist zwar auch ein frankenstein code aber er funktioniert. ;) und ja auch in homeassistant, aber du musst die mqtt-entitäten selbst anlegen...
Just as an interesting sidenote, if found that this also works:
AES.new(binascii.unhexlify(key), AES.MODE_GCM, nonce=nonce)
Tried the script and in my case (Wien, AM550, Infrared-Probe), the CRC verification fails, but the output is parsed correctly. Any similar experiences?
hey, ich kann es nicht mit python2.7 laufen lassen da es EOL ist und auch pip nichtmehr funktioniert (fürs crypto modul) mit py3 bekomme ich den fehler:
TypeError: 'nonce' is an invalid keyword argument for this function
der keinen sinn ergibt weil es sehr wohl ein gefordertes argument ist laut doc:https://pycryptodome.readthedocs.io/en/latest/src/cipher/classic.html#ctr-mode