aequitas / python-rflink

MIT License
30 stars 27 forks source link

Another packet error #47

Closed FrColin closed 4 years ago

FrColin commented 4 years ago

failed to parse packet data: 20;2D;RFX10METER;ID=79;TYPE=10;METER=7ef36;

Traceback (most recent call last): File "/srv/homeassistant/lib/python3.7/site-packages/rflink/protocol.py", line 152, in handle_raw_packet packet = decode_packet(raw_packet) File "/srv/homeassistant/lib/python3.7/site-packages/rflink/parser.py", line 320, in decode_packet value = VALUE_TRANSLATIONkey ValueError: invalid literal for int() with base 10: '7ef36'

aequitas commented 4 years ago

Do you know what the value 7ef36 is supposed to be? Is it the hex representation of the value or a identifier string?

FrColin commented 4 years ago

Sorry, I don't know, the device is probably that of a neighbor I suppose this is the hex value , since those RFX10METER are for GAS, Water, Electricity consumption https://www.bwired.nl/How_rfxcom.asp

aequitas commented 4 years ago

I can turn the error into a warning when it fails to convert the value. I'm not comfortable with changing the value type of behaviour of this piece unless I know the desired outcome. Since you're not using it yourself that should be no issue. If someone comes along that does w'll deal with it then.

FrColin commented 4 years ago

I am pretty sure that RFLink doesn't put the 0X before the value see http://www.rflink.nl/blog2/protref for KWATT=9999 => KWatt (hexadecimal) and for METER=1234 => Meter values (water/electricity etc.)

aequitas commented 4 years ago

https://github.com/aequitas/python-rflink/commit/a7ac103a75545b626a92e4c12868b96e208b1225