embyt / enocean-mqtt

Receives messages from an enOcean serial interface (USB) and provides selected messages to an MQTT broker.
GNU General Public License v3.0
42 stars 21 forks source link

A5-13-02 telegrams are interpreted as A5-13-01 telegrams #37

Closed t-ice closed 1 year ago

t-ice commented 1 year ago

Hello,

I'm using a FWS61 in combination with a multisensor MS. The EEP profiles a5-13-01 and a5-13-02 are supported on the same address. The identifier can be used to distinguish. I found these entries in the EEP.xml https://github.com/kipe/enocean/commit/33151e925f111adde19cea1e2c6b34234c621d5b. Currently, A5-13-02 telegrams are interpreted as A5-13-01 telegrams (see log). Is it possible to get the data published as SNW, SNS, SNE... for identifier 2?

2023-02-04 16:05:32,480 DEBUG: 05:9E:D7:9A->FF:FF:FF:FF (-70 dBm): 0x01 ['0xa5', '0xff', '0x68', '0x0', '0x18', '0x5', '0x9e', '0xd7', '0x9a', '0x0'] ['0x0', '0xff', '0xff', '0xff', '0xff', '0x46', '0x0'] OrderedDict()
2023-02-04 16:05:32,481 INFO: received: 05:9E:D7:9A->FF:FF:FF:FF (-70 dBm): 0x01 ['0xa5', '0xff', '0x68', '0x0', '0x18', '0x5', '0x9e', '0xd7', '0x9a', '0x0'] ['0x0', '0xff', '0xff', '0xff', '0xff', '0x46', '0x0'] OrderedDict()
2023-02-04 16:05:32,484 DEBUG: enocean2mqtt/Wetterstation_1: DWS (Dawn sensor)=999.0 lx
2023-02-04 16:05:32,484 DEBUG: enocean2mqtt/Wetterstation_1: TMP (Temperature)=8.941176470588232 °C
2023-02-04 16:05:32,484 DEBUG: enocean2mqtt/Wetterstation_1: WND (Wind speed)=0.0 m/s
2023-02-04 16:05:32,484 DEBUG: enocean2mqtt/Wetterstation_1: ID (Identifier)=Identifier 1 
2023-02-04 16:05:32,484 DEBUG: enocean2mqtt/Wetterstation_1: DN (Day / Night)=Day 
2023-02-04 16:05:32,484 DEBUG: enocean2mqtt/Wetterstation_1: RAN (Rain Indication)=No Rain 
2023-02-04 16:05:32,484 DEBUG: enocean2mqtt/Wetterstation_1: Sent MQTT: {"RSSI": -70, "DWS": 999.0, "TMP": 8.941176470588232, "WND": 0.0, "ID": 1, "DN": 0, "RAN": 0}
2023-02-04 16:05:32,485 DEBUG: Sending PUBLISH (d0, q0, r1, m287), 'b'enocean2mqtt/Wetterstation_1'', ... (93 bytes)
2023-02-04 16:06:23,544 DEBUG: Sending PINGREQ
2023-02-04 16:06:23,545 DEBUG: Received PINGRESP
2023-02-04 16:07:23,614 DEBUG: Sending PINGREQ
2023-02-04 16:07:23,615 DEBUG: Received PINGRESP
2023-02-04 16:07:48,044 DEBUG: 05:9E:D7:9A->FF:FF:FF:FF (-71 dBm): 0x01 ['0xa5', '0xb', '0x12', '0x8', '0x28', '0x5', '0x9e', '0xd7', '0x9a', '0x0'] ['0x0', '0xff', '0xff', '0xff', '0xff', '0x47', '0x0'] OrderedDict()
2023-02-04 16:07:48,045 INFO: received: 05:9E:D7:9A->FF:FF:FF:FF (-71 dBm): 0x01 ['0xa5', '0xb', '0x12', '0x8', '0x28', '0x5', '0x9e', '0xd7', '0x9a', '0x0'] ['0x0', '0xff', '0xff', '0xff', '0xff', '0x47', '0x0'] OrderedDict()
2023-02-04 16:07:48,049 DEBUG: enocean2mqtt/Wetterstation_1: DWS (Dawn sensor)=43.09411764705882 lx
2023-02-04 16:07:48,049 DEBUG: enocean2mqtt/Wetterstation_1: TMP (Temperature)=-31.529411764705884 °C
2023-02-04 16:07:48,050 DEBUG: enocean2mqtt/Wetterstation_1: WND (Wind speed)=2.196078431372549 m/s
2023-02-04 16:07:48,050 DEBUG: enocean2mqtt/Wetterstation_1: ID (Identifier)=Identifier 2 
2023-02-04 16:07:48,050 DEBUG: enocean2mqtt/Wetterstation_1: DN (Day / Night)=Day 
2023-02-04 16:07:48,050 DEBUG: enocean2mqtt/Wetterstation_1: RAN (Rain Indication)=No Rain 
2023-02-04 16:07:48,050 DEBUG: enocean2mqtt/Wetterstation_1: Sent MQTT: {"RSSI": -71, "DWS": 43.09411764705882, "TMP": -31.529411764705884, "WND": 2.196078431372549, "ID": 2, "DN": 0, "RAN": 0}

Thanks for your work Christian

romor commented 1 year ago

As I do not have such device myself I am not that familiar with profiles supporting various commands.

However, as I understand pull request #27 from @mak-gitdev, this got implemented there. Thus, you could specify command=ID (ID from your log or CMD as in EEP.xml?) in the config file to enable this.

See communicator.py:220ff as the correspondig part in the source code.

mak-gitdev commented 1 year ago

Hi @romor,

Yes it has been implemented. @t-ice can enable it using command = ID as A5-13-xx EEPs define ID as the command identifier.

t-ice commented 1 year ago

Unfortunately it didn't work for me, see log. I tried also just one definition for the address and different formats of the command value, e.g. 0x02.

...
DEBUG: Created sensor: {'name': 'enocean2mqtt/Wetterstation_1', 'address': 94295962, 'rorg': 165, 'func': 19, 'type': 1, 'command': '1'}
DEBUG: Created sensor: {'name': 'enocean2mqtt/Wetterstation_2', 'address': 94295962, 'rorg': 165, 'func': 19, 'type': 1, 'command': '2'}
...
DEBUG: Sending SUBSCRIBE (d0, m26) [(b'enocean2mqtt/Wetterstation_1/req/#', 0)]
DEBUG: Sending SUBSCRIBE (d0, m27) [(b'enocean2mqtt/Wetterstation_2/req/#', 0)]
...
DEBUG: 05:9E:D7:9A->FF:FF:FF:FF (-70 dBm): 0x01 ['0xa5', '0x0', '0x5f', '0xa', '0x18', '0x5', '0x9e', '0xd7', '0x9a', '0x0'] ['0x0', '0xff', '0xff', '0xff', '0xff', '0x46', '0x0'] OrderedDict()
INFO: received: 05:9E:D7:9A->FF:FF:FF:FF (-70 dBm): 0x01 ['0xa5', '0x0', '0x5f', '0xa', '0x18', '0x5', '0x9e', '0xd7', '0x9a', '0x0'] ['0x0', '0xff', '0xff', '0xff', '0xff', '0x46', '0x0'] OrderedDict()
DEBUG: enocean2mqtt/Wetterstation_1: DWS (Dawn sensor)=0.0 lx
DEBUG: enocean2mqtt/Wetterstation_1: TMP (Temperature)=4.705882352941174 °C
DEBUG: enocean2mqtt/Wetterstation_1: WND (Wind speed)=2.7450980392156863 m/s
DEBUG: enocean2mqtt/Wetterstation_1: ID (Identifier)=Identifier 1 
DEBUG: enocean2mqtt/Wetterstation_1: DN (Day / Night)=Day 
DEBUG: enocean2mqtt/Wetterstation_1: RAN (Rain Indication)=No Rain 
DEBUG: enocean2mqtt/Wetterstation_1: Sent MQTT: {"RSSI": -70, "DWS": 0.0, "TMP": 4.705882352941174, "WND": 2.7450980392156863, "ID": 1, "DN": 0, "RAN": 0}
DEBUG: Sending PUBLISH (d0, q0, r1, m314), 'b'enocean2mqtt/Wetterstation_1'', ... (106 bytes)
DEBUG: 05:9E:D7:9A->FF:FF:FF:FF (-70 dBm): 0x01 ['0xa5', '0x0', '0x0', '0x0', '0x28', '0x5', '0x9e', '0xd7', '0x9a', '0x0'] ['0x0', '0xff', '0xff', '0xff', '0xff', '0x46', '0x0'] OrderedDict()
INFO: received: 05:9E:D7:9A->FF:FF:FF:FF (-70 dBm): 0x01 ['0xa5', '0x0', '0x0', '0x0', '0x28', '0x5', '0x9e', '0xd7', '0x9a', '0x0'] ['0x0', '0xff', '0xff', '0xff', '0xff', '0x46', '0x0'] OrderedDict()
DEBUG: enocean2mqtt/Wetterstation_1: DWS (Dawn sensor)=0.0 lx
DEBUG: enocean2mqtt/Wetterstation_1: TMP (Temperature)=-40.0 °C
DEBUG: enocean2mqtt/Wetterstation_1: WND (Wind speed)=0.0 m/s
DEBUG: enocean2mqtt/Wetterstation_1: ID (Identifier)=Identifier 2 
DEBUG: enocean2mqtt/Wetterstation_1: DN (Day / Night)=Day 
DEBUG: enocean2mqtt/Wetterstation_1: RAN (Rain Indication)=No Rain 
DEBUG: enocean2mqtt/Wetterstation_1: Sent MQTT: {"RSSI": -70, "DWS": 0.0, "TMP": -40.0, "WND": 0.0, "ID": 2, "DN": 0, "RAN": 0}
DEBUG: Sending PUBLISH (d0, q0, r1, m315), 'b'enocean2mqtt/Wetterstation_1'', ... (79 bytes)
DEBUG: 05:9E:D7:9A->FF:FF:FF:FF (-70 dBm): 0x01 ['0xa5', '0x0', '0x5f', '0xa', '0x18', '0x5', '0x9e', '0xd7', '0x9a', '0x0'] ['0x0', '0xff', '0xff', '0xff', '0xff', '0x46', '0x0'] OrderedDict()
...

BTW @mak-gitdev I'm using the dev version of your HA addon.

mak-gitdev commented 1 year ago

Seems that you defined your device as:

[Wetterstation_1]
address = 0x59ED79A
rorg = 0xA5
func = 0x13
type = 0x01
command = 1

As explained by @romor and I, it should be:

[Wetterstation_1]
address = 0x59ED79A
rorg = 0xA5
func = 0x13
type = 0x01
command = ID

As the issue is related to the Home Assistant extension of enoceanmqtt, please open an issue there if that doesn't fix your issue.

t-ice commented 1 year ago

Sorry, I misunderstood that. Unfortunately, that didn't help either. I will close this issue and create a new issue as suggested. Thanks a lot