Jey-Cee / ioBroker.enocean

Connect and control your EnOcean devices with ioBroker.
Other
24 stars 12 forks source link

Add simultaneous button press support for Eltako FT4 #152

Closed derterz closed 1 year ago

derterz commented 1 year ago

Manufacturer: Eltako Model: FT4 Production date/period: 2009 Link to product: https://www.eltako.com/fileadmin/downloads/de/_bedienung/FT4_FHS8_FHS12_FMH4_30000100-1_internet_dtsch.pdf

Data from the sticker on the rear side: "PTM200 DB" FCC ID: SZV-PTM200 IC: 5713A-PTM200 "S3001-A200-14" 10/09

Adding it as "TF-4FT", also EEP "F6-02-02", works flawless. However when pressing two buttons simultaneously only A0/AI is been triggered.

In my ancient automation implemented in C for the TCM120 I found the following code:

    if ((in.DATA_BYTE3 == 0x00) && (lastButton == in.ID_BYTE0) && (diff > minMacroTime) && (diff < maxMacroTime)){
      if ((lastAction == 0x15) || (lastAction == 0x51)){ //both down
        [...]
      }
      if ((lastAction == 0x37) || (lastAction == 0x73)){ //both up
        [...]
      }
      if ((lastAction == 0x35) || (lastAction == 0x53)){ //left up, right down
        [...]
      }
      if ((lastAction == 0x17) || (lastAction == 0x71)){ //left down, right up
        [...]
      }
    }
    [...]
    lastAction = in.DATA_BYTE3

This is the data recorded with my two USB adapters for the same events:

TCM120

Press both up: a55a0b05370000000015a34a3079 Release both up: a55a0b05000000000015a34a2032

USB300

Press both up: 55000707017af6370015a34a3001ffffffff5600 Release both up: 55000707017af6000015a34a2001ffffffff5800

Jey-Cee commented 1 year ago

In version 0.8.4

derterz commented 1 year ago

After updating to 0.8.4 and adding the device again I can distinguish all possible combinations of pressed keys. Great!

It seems the relevant commit is fda5292 changing the profile from F6-02-02 to F6-02-03. According to the specifications F6-02-02 should also supports 2 actions in one message?

Jey-Cee commented 1 year ago

For compability reasons i decided to not touch the false definition of F6-02-02 and use F6-02-03 instead. Otherwise a lot of people has to delete the devices and teachin again.

derterz commented 1 year ago

I see.

Is it an option to keep the object "AI", "A0", "BI", "B0" unchanged and just consider the second half of the data Byte too and update the corresponding object? Would this still require re-teaching?

I must admit I don't understand the contents of F6-02-02.json. Is there a way to implement the following:

Jey-Cee commented 1 year ago

Possible, could be. But this makes things a lot more complicated and i see no benefit.

derterz commented 1 year ago

I still see a small advantage but since it is working fine, as long as you are aware of the different implementation of F6-02-02 and F6-02-03, there is indeed no need additional complexity.