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

Problems with Eltako Switch #26

Closed josh-79 closed 2 years ago

josh-79 commented 2 years ago

Hello,

I am using enocean-mqtt successfully with some window contacts. However, I have been trying to use an Eltako switch with current sensing (FSR61VA-10A) for a few days without success. I used to use the switch with the home automation software FHEM. There it worked perfectly. Unfortunately I can't get the switch to work with enocean-mqtt.

According to the manufacturer, the switch uses EEP A5-38-08.

The telegram has to look like this:

ORG = 0x07 Data_byte3 = 0x01 Data_byte2 = no used Data_byte1 = no used Data_byte0 = DB0_Bit3 = LRN Button (0 = Teach In, 1 = Data) DBO_Bit2 = 1: Switching state blocked, 0: Switching state not blocked DBO_Bit0 = 1: Switching output on, 0: Switching output off Teach in telegram DB3..DB0 has to look like this: 0xE0, 0x40, 0x0D, 0x80 Data telegrams have to look like this: 0x01, 0x00, 0x00, 0x09 (Switch on, not blocked) 0x01, 0x00, 0x00, 0x08 (Switch off, not blocked) 0x01, 0x00, 0x00, 0x0D (Switch on, blocked) 0x01, 0x00, 0x00, 0x0C (Switch off, blocked)

My /etc/enoceanmqtt.conf

[EnOcean_Central_Fan_Switch] address = 0xFFC1AA84 rorg = 0xA5 func = 0x38 type = 0x08 publish_rssi = 1 default_data = 0x01000009 log_learn = 1

I now put the switch into teach-in mode. According to the manual I have to send a power on command to teach the switch. Therefore I send the following commands via MQTT:

MQTT Message #1

enocean2mqtt_dg/EnOcean_Central_Fan_Switch/req/SW Value = 1

MQTT Message #2

enocean2mqtt_dg/EnOcean_Central_Fan_Switch/req/send Value = 1

This is the Debug response:

2021-12-07 00:07:11,737 DEBUG: Got MQTT message: enocean2mqtt_dg/EnOcean_Central_Fan_Switch/req/SW 2021-12-07 00:07:14,737 DEBUG: Got MQTT message: enocean2mqtt_dg/EnOcean_Central_Fan_Switch/req/send 2021-12-07 00:07:14,738 DEBUG: Trigger message to: enocean2mqtt_dg/EnOcean_Central_Fan_Switch 2021-12-07 00:07:14,747 INFO: sending: FF:BC:82:80->FF:C1:AA:80 (-255 dBm): 0x01 ['0xa5', '0x1', '0x0', '0x0', '0x9', '0xff', '0xbc', '0x82', '0x80', '0x0'] ['0x3', '0xff', '0xc1', '0xaa', '0x80', '0xff', '0x0'] OrderedDict([('COM', {'description': 'Command ID', 'unit': '', 'value': 'Command ID 0', 'raw_value': 0}), ('TIM', {'description': 'Time in 1/10 seconds. 0 = no time specifed', 'unit': 's', 'value': 1.3877787807814457e-17, 'raw_value': 0}), ('LCK', {'description': 'Lock for duration time if time >0, unlimited time of no time specified. Locking may be cleared with "unlock". During lock phase no other commands will be accepted or executed', 'unit': '', 'value': 'Unlock', 'raw_value': 0}), ('DEL', {'description': 'Delay or duration (if Time > 0); 0 = Duration (Execute switching command immediately and switch back after duration) 1 = Delay (Execute switching command after delay)', 'unit': '', 'value': 'Duration', 'raw_value': 0}), ('SW', {'description': 'Switching command ON/OFF', 'unit': '', 'value': 'Off', 'raw_value': 0})]) 2021-12-07 00:07:14,810 INFO: Sending packet 2021-12-07 00:07:14,811 DEBUG: FF:BC:82:80->FF:C1:AA:80 (-255 dBm): 0x01 ['0xa5', '0x1', '0x0', '0x0', '0x9', '0xff', '0xbc', '0x82', '0x80', '0x0'] ['0x3', '0xff', '0xc1', '0xaa', '0x80', '0xff', '0x0'] OrderedDict([('COM', {'description': 'Command ID', 'unit': '', 'value': 'Command ID 0', 'raw_value': 0}), ('TIM', {'description': 'Time in 1/10 seconds. 0 = no time specifed', 'unit': 's', 'value': 1.3877787807814457e-17, 'raw_value': 0}), ('LCK', {'description': 'Lock for duration time if time >0, unlimited time of no time specified. Locking may be cleared with "unlock". During lock phase no other commands will be accepted or executed', 'unit': '', 'value': 'Unlock', 'raw_value': 0}), ('DEL', {'description': 'Delay or duration (if Time > 0); 0 = Duration (Execute switching command immediately and switch back after duration) 1 = Delay (Execute switching command after delay)', 'unit': '', 'value': 'Duration', 'raw_value': 0}), ('SW', {'description': 'Switching command ON/OFF', 'unit': '', 'value': 'Off', 'raw_value': 0})]) 2021-12-07 00:07:14,914 DEBUG: 0x02 ['0x0'] [] OrderedDict() 2021-12-07 00:07:14,915 INFO: got response packet: OK

Unfortunately, the teach-in process is not completed successfully. With FHEM, a B0 (on) signal was sufficient to complete the teach-in.

Can anyone help me what I am doing wrong?

romor commented 2 years ago

Sorry, I do not know what is wrong as it seems to be specific to your device. Why don't you teach in with FHEM and use MQTT only for sending requests after teach-in? Does this work?

josh-79 commented 2 years ago

Thank you very much for your answer. I have tried your suggestion. I have teached in the switch with FHEM and then tried to control it with enocean-mqtt.

Unfortunately it did not work. I have therefore researched a little deeper.

FHEM sends the following (working) telegrams when the switch is switched on:

1) (B0) 55 00 07 00 01 11 F6 70 FF BC 82 81 30 05 2) (Release) 55 00 07 00 01 11 F6 00 FF BC 82 81 20 A6

The following is sent when the switch is switched off:

1) (BI) 55 00 07 00 01 11 F6 50 FF BC 82 81 30 3E 2) (Release) 55 00 07 00 01 11 F6 00 FF BC 82 81 20 A6

This is obviously not the EEP A5-38-08 as specified by the manufacturer, but rather EEP F6-02-01. I have adapted the EEP accordingly in my configuration.

I now send via MQTT:

enocean2mqtt_dg/EnOcean_Central_Fan_Switch/req/R1 = 3 enocean2mqtt_dg/EnOcean_Central_Fan_Switch/req/EB = 1 enocean2mqtt_dg/EnOcean_Central_Fan_Switch/req/SA = 0 enocean2mqtt_dg/EnOcean_Central_Fan_Switch/req/send = 1

The commands arrive at enocean-mqtt:

DEBUG: Got MQTT message: enocean2mqtt_dg/EnOcean_Central_Fan_Switch/req/R1 DEBUG: Got MQTT message: enocean2mqtt_dg/EnOcean_Central_Fan_Switch/req/EB DEBUG: Got MQTT message: enocean2mqtt_dg/EnOcean_Central_Fan_Switch/req/SA

Unfortunately, it still does not work.

In the debug window I get the following output:

2021-12-07 15:35:36,741 INFO: sending: FF:BC:82:80->FF:BC:82:81 (-255 dBm): 0x01 ['0xf6', '0x50', '0x0', '0x0', '0x9', '0x80', '0x0'] ['0x3', '0xff', '0xbc', '0x82', '0x81', '0xff', '0x0'] OrderedDict([('R1', {'description': 'Rocker 1st action', 'unit': '', 'value': 'Button AI', 'raw_value': 0}), ('EB', {'description': 'Energy bow', 'unit': '', 'value': 'released', 'raw_value': 0}), ('R2', {'description': 'Rocker 2nd action', 'unit': '', 'value': 'Button AI', 'raw_value': 0}), ('SA', {'description': '2nd action', 'unit': '', 'value': 'No 2nd action', 'raw_value': 0}), ('T21', {'description': 'T21', 'unit': '', 'value': False, 'raw_value': 0}), ('NU', {'description': 'NU', 'unit': '', 'value': False, 'raw_value': 0})])

2021-12-07 15:35:36,816 INFO: Sending packet

2021-12-07 15:35:36,818 DEBUG: FF:BC:82:80->FF:BC:82:81 (-255 dBm): 0x01 ['0xf6', '0x50', '0x0', '0x0', '0x9', '0x80', '0x0'] ['0x3', '0xff', '0xbc', '0x82', '0x81', '0xff', '0x0'] OrderedDict([('R1', {'description': 'Rocker 1st action', 'unit': '', 'value': 'Button AI', 'raw_value': 0}), ('EB', {'description': 'Energy bow', 'unit': '', 'value': 'released', 'raw_value': 0}), ('R2', {'description': 'Rocker 2nd action', 'unit': '', 'value': 'Button AI', 'raw_value': 0}), ('SA', {'description': '2nd action', 'unit': '', 'value': 'No 2nd action', 'raw_value': 0}), ('T21', {'description': 'T21', 'unit': '', 'value': False, 'raw_value': 0}), ('NU', {'description': 'NU', 'unit': '', 'value': False, 'raw_value': 0})])

Obviously the sent values are R1 = 0, EB = 0, SA = 0. But actually I had set the values via MQTT to R1 = 3, EB = 1, SA = 0.

Am I doing something wrong when setting or sending the values?

romor commented 2 years ago

I just did a commit where I improved the logging of packet data. Could you please try it again with this version and check the logging output.

josh-79 commented 2 years ago

Hi, I have tried it with the newest commit. Strangely now the values are displayed correctly in debug mode. I have noticed that last time 2 instances of enocean-mqtt were running. Maybe this caused the error.

2021-12-07 23:37:10,368 DEBUG: sensor data: {'R1': 2, 'EB': 1, 'SA': 0} 2021-12-07 23:37:10,376 INFO: sending: FF:BC:82:80->FF:BC:82:81 (-255 dBm): 0x01 ['0xf6', '0x50', '0x0', '0x0', '0x9', '0x80', '0x0'] ['0x3', '0xff', '0xbc', '0x82', '0x81', '0xff', '0x0'] OrderedDict([('R1', {'description': 'Rocker 1st action', 'unit': '', 'value': 'Button BI', 'raw_value': 2}), ('EB', {'description': 'Energy bow', 'unit': '', 'value': 'pressed', 'raw_value': 1}), ('R2', {'description': 'Rocker 2nd action', 'unit': '', 'value': 'Button AI', 'raw_value': 0}), ('SA', {'description': '2nd action', 'unit': '', 'value': 'No 2nd action', 'raw_value': 0}), ('T21', {'description': 'T21', 'unit': '', 'value': False, 'raw_value': 0}), ('NU', {'description': 'NU', 'unit': '', 'value': False, 'raw_value': 0})])

However, the switch is unfortunately still not switched. Maybe it is due to a strange implementation of the enocean standard from the company Eltako.

romor commented 2 years ago

Hi, I have tried it with the newest commit. Strangely now the values are displayed correctly in debug mode.

Yes, this was a problem that I fixed with the last commit. But it was only the debugging output that was wrong before, the packet data has been correctly sent also before.

However, the switch is unfortunately still not switched. Maybe it is due to a strange implementation of the enocean standard from the company Eltako.

I also do not know why it is not working. There has been another issue #24 reporting a similar problem. So it might be something more fundamental either with this lib or the underlying enocean library.

If you are able to find out something more or have any feedback to me where I could help, feel free to raise it.

mak-gitdev commented 2 years ago

Hi, I am certainly too late but from your last debug output, are you sure about this : "sending: FF:BC:82:80->FF:BC:82:81". It looks like you are sending data from your EnOcean gateway (base id) to your EnOcean gateway (base id +1) and not to your switch (FF:C1:AA:84 according to your enoceanmqtt.conf)

romor commented 2 years ago

Closing this for now as no further activity is planned. Feel free to reopen it if there is new information..