Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to switch Eltako FL62 or FD62 #130

Open
andreas-bulling opened this issue Dec 6, 2021 · 17 comments
Open

Unable to switch Eltako FL62 or FD62 #130

andreas-bulling opened this issue Dec 6, 2021 · 17 comments

Comments

@andreas-bulling
Copy link

andreas-bulling commented Dec 6, 2021

I am trying to use this library to switch an Eltako FL62 and FD62 (in the context of Home Assistant) but without success so far. I've studied the corresponding official technical specifications in detail (PDF page 16 and 17) and have assembled packets that, from my point of view, match the specification. Specifically, I create on and off packets using

ON

if self._type == "fl62":
    packet = RadioPacket.create(
        rorg=RORG.BS4,
        rorg_func=0x38,
        rorg_type=0x08,
        destination=self._destination_id,
        sender=self._sender_id,
        COM=1,
        LCK=1,
        SW=1)
                
elif self._type == "fd62":
    packet = RadioPacket.create(
        rorg=RORG.BS4,
        rorg_func=0x38,
        rorg_type=0x08,
        destination=self._destination_id,
        sender=self._sender_id,
        COM=2,
        LCK=1,
        SW=1,
        STR=1,
        TIM=0.5,
        EDIMR=1,
        RMP=127,
        EDIM=bval)

OFF

if self._type == "fl62":
    packet = RadioPacket.create(
        rorg=RORG.BS4,
        rorg_func=0x38,
        rorg_type=0x08,
        destination=self._destination_id,
        sender=self._sender_id,
        COM=1,
        LCK=1,
        SW=0)
        
elif self._type == "fd62":
    packet = RadioPacket.create(
        rorg=RORG.BS4,
        rorg_func=0x38,
        rorg_type=0x08,
        destination=self._destination_id,
        sender=self._sender_id,
        COM=2,
        LCK=1,
        SW=0)

Switching the FL62 simply doesn't work for some reason. For switching on the FD62 I see the following error message in the logs although the EEP XML description shows them:

2021-12-06 09:54:17 WARNING (SyncWorker_8) [enocean.protocol.eep] Cannot find data description for shortcut STR
2021-12-06 09:54:17 WARNING (SyncWorker_8) [enocean.protocol.eep] Cannot find data description for shortcut EDIMR
2021-12-06 09:54:17 WARNING (SyncWorker_8) [enocean.protocol.eep] Cannot find data description for shortcut RMP
2021-12-06 09:54:17 WARNING (SyncWorker_8) [enocean.protocol.eep] Cannot find data description for shortcut EDIM
2021-12-06 09:54:17 DEBUG (SyncWorker_8) [custom_components.enocean.device] SENT radio packet: FF:E3:01:82->04:14:7F:22 (-255 dBm): 0x01 ['0xa5', '0x2', '0x0', '0x5', '0xd', '0xff', '0xe3', '0x1', '0x82', '0x0'] ['0x3', '0x4', '0x14', '0x7f', '0x22', '0xff', '0x0'] OrderedDict([('COM', {'description': 'Command ID', 'unit': '', 'value': 'Command ID 2', 'raw_value': 2}), ('TIM', {'description': 'Time in 1/10 seconds. 0 = no time specifed', 'unit': 's', 'value': 0.5, 'raw_value': 5}), ('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': 'Lock', 'raw_value': 1}), ('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': 'On', 'raw_value': 1})])
@andreas-bulling
Copy link
Author

andreas-bulling commented Dec 6, 2021

These are the packets that are being put together:

FL62

ON
FF:E3:01:81->04:14:B2:66 (-255 dBm): 0x01 ['0xa5', '0x0', '0x0', '0x0', '0xd', '0xff', '0xe3', '0x1', '0x81', '0x0'] ['0x3', '0x4', '0x14', '0xb2', '0x66', '0xff', '0x0']
OFF
FF:E3:01:81->04:14:B2:66 (-255 dBm): 0x01 ['0xa5', '0x1', '0x0', '0x0', '0xc', '0xff', '0xe3', '0x1', '0x81', '0x0'] ['0x3', '0x4', '0x14', '0xb2', '0x66', '0xff', '0x0']

FD62

ON
FF:E3:01:82->04:14:7F:22 (-255 dBm): 0x01 ['0xa5', '0x0', '0x0', '0x5', '0xd', '0xff', '0xe3', '0x1', '0x82', '0x0'] ['0x3', '0x4', '0x14', '0x7f', '0x22', '0xff', '0x0']
OFF
FF:E3:01:82->04:14:7F:22 (-255 dBm): 0x01 ['0xa5', '0x2', '0x0', '0x0', '0xc', '0xff', '0xe3', '0x1', '0x82', '0x0'] ['0x3', '0x4', '0x14', '0x7f', '0x22', '0xff', '0x0']

@lolplusultra
Copy link

Let me ask the stupid question first: did you perform a teach in between the sender and the receiver?

@andreas-bulling
Copy link
Author

andreas-bulling commented Dec 6, 2021

yes, I can toggle both when plugging in the USB dongle to my laptop and teaching in/testing using example kipe code that I found in one of the Home Assistant forums. That code uses RORG.RPS packets but setting the dimmer doesn't work with these AFAIK and, according to the specs, RORG.BS4 should also work...

@andreas-bulling
Copy link
Author

... base id of my dongle is [0xFF, 0xE3, 0x01, 0x80] and I've tought in using 0x81 and 0x82 ids (see above)

@zpfvo
Copy link
Contributor

zpfvo commented Dec 6, 2021

Did you do a 4BS teach-in? The process is different to RPS.

@andreas-bulling
Copy link
Author

No, I didn't... :( how is it different? With the special packets that are mentioned in the specs?

@zpfvo
Copy link
Contributor

zpfvo commented Dec 6, 2021

Yes,
https://www.enocean-alliance.org/wp-content/uploads/2020/07/EnOcean-Equipment-Profiles-3-1.pdf
on page 19

@zpfvo
Copy link
Contributor

zpfvo commented Dec 6, 2021

Now I remember, could be, that Eltako has a special telegram that needs to be sent. There is a PDF out there in the internet that describes it.

@andreas-bulling
Copy link
Author

https://www.eltako.com/fileadmin/downloads/de/Gesamtkatalog/Eltako_Gesamtkatalog_KapT_low_res.pdf

@andreas-bulling
Copy link
Author

Thanks a lot for the hint - I will look into this and report back ;)

@andreas-bulling
Copy link
Author

But do you know why I see that error message? This should be unrelated to the teach in - is this a bug in the code?

@andreas-bulling
Copy link
Author

andreas-bulling commented Dec 6, 2021

Alright, I tried this for the normal switch (FL62) and it worked! For future reference, this is what I did (I didn't find a code example from anyone having done this - I therefore hope it will also be useful for others):

command = [0xa5, 0x00, 0x00, 0x00, 0x28]
command.extend(sender_id)
command.extend([0x30])
opt = [0x3]
opt.extend(destination_id)
opt.extend([0xff, 0x0]) 
packet = Packet(0x01, data=command, optional=opt)
communicator.send(packet)
time.sleep(3)

command = [0xa5, 0xE0, 0x40, 0x0D, 0x80]
command.extend(sender_id)
command.extend([0x30])
opt = [0x3]
opt.extend(destination_id)
opt.extend([0xff, 0x0]) 
packet = Packet(0x01, data=command, optional=opt)
communicator.send(packet)

The light switched on and off to confirm and the actor responded with the following confirmation packet
0x01 ['0xa5', '0xe3', '0x1', '0x81', '0x8', '0x4', '0x14', '0xb2', '0x66', '0x0'] ['0x0', '0xff', '0xff', '0xff', '0xff', '0x49', '0x0']

What does the confirmation message mean? '0xe3', '0x1', '0x81', '0x8' seems to be like part of the sender_id that I had used ([0xFF, 0xE3, 0x01, 0x81]).

The remaining problem is now the error message for the FD62 - it prevents me from switching that light. Any ideas on how I can fix this / what the problem is?

@zpfvo
Copy link
Contributor

zpfvo commented Dec 6, 2021

Could the errors occur when you don't specify all data fields? I think if you dont the library just assumes raw_value = 0

I don't know any further unfortunately. But I got a Eltako FR62 to work with the same profile. So I think yours should be possible too. I build the package with:

data = {'CMD': 'Command ID 1', 'TIM': 0.5, 'SW': 'On', 'command': 1}
packet = RadioPacket.create(
             component.enocean.rorg,
             component.enocean.rorg_func,
             component.enocean.rorg_type,
             sender=sender_id,
             **data
         )

The difference i see is:

  • I somehow used 'CMD' and 'command'. I now realize 'CMD' is a mistake (Should be COM), but the command might have made it work
  • And I didnt set the destination id

EDIT: You also used the lock command without any time duration. Maybe try with LCK=0 so you dont lock it by accident and that is the reason why it is not accepting any commands anymore.

@andreas-bulling
Copy link
Author

Thanks for the suggestions/input. The wrong LCK setting I also noticed before when I suddenly couldn't operate the light with the wall switches anymore ;)

I actually do set all data fields - I copied them over from the EEP.XML file... :/ The FL62 works fine now (see above) - but for the FD62 I can't set the dimmer-specific data fields unfortunately, which are rather quite important...

@andreas-bulling
Copy link
Author

This is where the error is triggered...

self.logger.warning('Cannot find data description for shortcut %s', shortcut)

@andreas-bulling
Copy link
Author

andreas-bulling commented Dec 6, 2021

It works! I traced back from the function in which the error message was triggered and stumbled over this line in which the EEP is selected:

packet.select_eep(rorg_func, rorg_type, direction, command)

I realised that while command is used here, in contrast to you, I don't set it when constructing the packet. And that, as a result, there is a chance that the wrong EEP was selected (that misses the data types). I added this parameter (copying COM) and - voila it works. I can switch on/off and also setting the dimming value works "out of the box", i.e. with the code from my very first message.

Thank you very much for your help and particularly your comment on the command parameter!

For future reference again, should anyone else encounter the same problem:

ON

bval = math.floor(self._brightness / 256.0 * 100.0)
if bval == 0:
    bval = 1
    
if self._type == "fl62":
    packet = RadioPacket.create(
        rorg=RORG.BS4,
        rorg_func=0x38,
        rorg_type=0x08,
        destination=self._destination_id,
        sender=self._sender_id,
        COM=1,
        command=1,
        DEL=0,
        LCK=0,
        SW=1)
        
elif self._type == "fd62":
    packet = RadioPacket.create(
        rorg=RORG.BS4,
        rorg_func=0x38,
        rorg_type=0x08,
        destination=self._destination_id,
        sender=self._sender_id,
        COM=2,
        command=2,
        LCK=0,
        SW=1,
        STR=1,
        TIM=0.5,
        EDIMR=1,
        RMP=127,
        EDIM=bval)

self.send_command(packet)

OFF

if self._type == "fl62":
    packet = RadioPacket.create(
        rorg=RORG.BS4,
        rorg_func=0x38,
        rorg_type=0x08,
        destination=self._destination_id,
        sender=self._sender_id,
        COM=1,
        LCK=0,
        SW=0)
        
elif self._type == "fd62":
    packet = RadioPacket.create(
        rorg=RORG.BS4,
        rorg_func=0x38,
        rorg_type=0x08,
        destination=self._destination_id,
        sender=self._sender_id,
        COM=2,
        LCK=0,
        SW=0)

self.send_command(packet)

@andreas-bulling
Copy link
Author

Hm - I assume after the latest upgrades of Home Assistant it stopped working (haven't changed anything else) and I see a new error in the logs before the first packet for switching on the FD62:

2021-12-18 16:59:05 WARNING (SyncWorker_7) [enocean.protocol.eep] Cannot find data description for shortcut LCK
2021-12-18 16:59:05 WARNING (SyncWorker_7) [enocean.protocol.eep] Cannot find data description for shortcut TIM
2021-12-18 16:59:05 WARNING (SyncWorker_7) [enocean.protocol.eep] Cannot find data description for shortcut CMD

I have a suspicion that maybe the enocean version is not the most recent (0.60.1). Where can I find the installed dependency? I have HA OS installed - the documentation says "Home Assistant will try to install the requirements into the deps subdirectory of the Home Assistant configuration directory". But the deps subdirectory is empty...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants