Another attempt at Setting up EnOcean - could use some help

Update: There’s a sticker on the back of the Eltako switch with what I assume is the Device ID. In this case, it’s “193FF62” - which is a bit weird, because I was expecting 8 digits that I could then us in the ‘0xAB 0xBC 0xCD 0xDE’ format.

So I thought, maybe the first ist 01 instead of just 1, and added the following to my configuration.yaml

switch:
  - platform: enocean
    id: [0x01,0x93,0xFF,0x62]

and restarted my Home Assistant. There’s a switch entity that shows up now, of course, but it turning it on and off doesn’t do anything.

Any clues on what I’m doing wrong here?

I had a similar situation: there’s a sticker with a QR code on my Nodon Soft Button, but no device ID in readable letters.

Reading the QR code revealed a 14 digit hex number that turned out to have nothing to do with the device ID, either.

I finally found it when I set up the logger for Enocean debug events.

Hi All

I’ve exactly the same setup (several FSR61 230V triggering different lights) and some unknown wall-switches (one switch, with two panels to push).
My setup: short push means on/off. If I remain on the switch, the light starts to dim and I release at the desired brightness.

I managed to make it work from the PC using DolphinView software and USB300 dongle (with lots of trial and error)

What I found out so far:

  • as the wall-switches are “stupid” (they just send a signal when pressing (and releasing again)), the ID of the FSR61 is irrelevant. FSR61 just seems to listen if a signal from a teached in switch is coming.
  • the USB300 has one ID (on the label) - and this is the “Base-ID”
  • the Base-ID (of the USB300) should not be “teached” to the FSR61 (if you have multiple, they react simultamuosly). Hence, you add a number to the Base ID (described here, post 10 or 11: EnOcean - Configure FUD61, how to get 'sender_id' - #10 by danist)
  • with DolphinView I could read the signal from the wall-switches: Push sends status 30, and releas sends status 20
  • I never captured a signal from the FSR61 (or I’m not smart enough to see it)
  • in DolphinView, I created “Send Telegram” with the respective parameter, set the FSR61 to learning, sent a signal and then it worked

With above, I assume that I can not have the status (on/off, brightness) visible in HomeAssistant, but that it should be possible to replicate the wall-switch in HA to have same function as if the wall-switch would be pushed.

Details how I managed to have it worked in DolphinView:

  1. What the wall-switch sends
    a. Radio Telegram: byte[7] F6 bb AA AA AA AA ss (bb= number defining which panel I pushed (30 in my case for push, 00 for release, AA…= is the wall-switch-ID, and ss= status (30 for push, 20 for release)
    b. RORG 0xF6 RPS Repeated Switch Communication
    c. Data byte[1] 30 (<- my panel number - when releasing, this is 00 )
    d. Status 0b0011 0000 0x30 (on release, it shows 0x20)

  2. how to replicate above in DolphinView
    a. Go to tab: “Telegram Transmit”
    b. click on “Add operation”, and select “RPS Telegram” (I had to double-click)
    c. Data: 30 (<- defines the panel I push (the other would show 70)
    ID: “USB300” + “free number” (I use just +1 and made an Excel to keep track on what FSR61 I teach what sender ID (my case, USB300 IDends with 28 → so I have 29)
    Status: 30
    Destination ID: FF FF FF FF (<- default, as it should broadcast, like wall-switch)
    Encrypt and security-level blank/empty
    d. click on “Add operation”, and select “Delay” (I had to double-click), then type in 160 milliseconds (<- this simulates a short push and release of the switch)
    e. repeat point c (you can duplicate operation), and change Data to 00, an Status to 20
    f. put your FSR61 in learning mode (light flashing) and “execute all” in Dolphin view (<- this simulates a push and release of a wall-switch)
    g. put FSR61 back in “normal operation mode” (my case “ER”, time “infinity”)
    h. with “execute all” in DolphinView, I can switch light on and off (and wall switch continue to work)
    i. to dim, I only select the “push” operation and hit “Execute selected” and wait until desired brightness is achieved, then select the other operation (release) and hit “Execute selected”. Dimming stops.

  3. How to replicate above into HA? ← This is what I don’t know yet and where any help is appreciated
    My approach would be to create two “buttons” (one push, other release) and link them with an automation… dimming would be difficult, as each time dimming, it changes direction (unless in HA we can simulate how long a finger is on the display…), and if the wall-switch is used, how to track this…

Added screenshot of DolphinView Telegram Transmit:

Best regards

2 Likes

Hey pas, I cannot say I have much progress to offer, but am stuck in the same place and your Dolphin View results are quite helpful.

I had a look at the events send by the Switch device type of the enocean integration. Their patterns does not match the one your are describing above. The part of the code that governs this seems to be switch.py and more specifically the turn_on method in there.

I guess we would need to adapt this piece of code to be configurable to the id used in teaching in and to matc the pattern you outline above. Perhaps it would be worth reaching out to the owner of that part of the github repo?

Here is the part in the code that currently assembles the messages for the switch:

    def turn_on(self, **kwargs: Any) -> None:
        """Turn on the switch."""
        optional = [0x03]
        optional.extend(self.dev_id)
        optional.extend([0xFF, 0x00])
        self.send_command(
            data=[0xD2, 0x01, self.channel & 0xFF, 0x64, 0x00, 0x00, 0x00, 0x00, 0x00],
            optional=optional,
            packet_type=0x01,
        )

I’ll have a look at adapting that code, but have not done that for has before, so :crossed_fingers:

Wanted to document what I found in the meantime. I have succeeded at getting HA to switch my Eltako FSR71NP-4x-230 , but am still struggling with the base id issue.

What I did:

  • Modified the turn_on and turn_off parts of the enocean integration
  • Deployed them as a custom component

Results:

  • I can teach in my FSR71NP-4x-230 to recognize the home assistant switch. It does switch on and off based on the switch showing in home assistant.
  • I can NOT get it to recognize different ids yet. Even if I modify the dev_id in ha it does not make my switch pick it up as different switches. This is likely an issue with working off the base ids and not modifying them properly - Any help here would be highly appeciated.

Here are the code parts I have been modifying:

    def turn_on(self, **kwargs: Any) -> None:
        """Turn on the switch."""
        data = [0xF6, 0x50]
        data.extend(self.dev_id)
        data.extend([0x30])
        self.send_command(
            packet_type = 0x01,
            data = data,
            optional = [0x03, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF]
        )
        self._on_state = True
        
    def turn_off(self, **kwargs: Any) -> None:
        """Turn off the switch."""
        data = [0xF6, 0x70]
        data.extend(self.dev_id)
        data.extend([0x20])
        self.send_command(
            packet_type = 0x01,
            data = data,
            optional = [0x03, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF]
        )
        self._on_state = False

@ruben88
Hi,
Did you also teach the modified dev_id ?
Which value are you using as new value for dev_id ?

@mak-dev

Finally got this to work with the Eltak Switch. The steps were:

  1. Find the base id in dophin view
  2. Generate ids by adding 1,2,3, etc. to the base id
  3. Use Dophin View to teach in those ids to the Eltako Switches (mine was a FSR71NP-4x)
  4. Use a custom component to modify the Enocean integration to mimick the messages send by the Eltake switches
  5. Configure the ids generated in step 2 for the custom component

Happy to go into more detail if anyone is interested.

2 Likes

Yes that’s what I meant. :+1:

1 Like

Hi ruben88
Sorry for my long absence - I also tried quite long and unsucessful via nodered, hoping there is a packet which generates the send-message needed. Turned out there was none either.

Now with your steps: can you elaborate step4 more? (I never modified or even accessed the parts of an integration in HA)

would really be super if I can get it done also. And a possibility to pin your post or make this somewhat available in the HA-Enocean manual?

Best regards

1 Like

Sure - happy to expand on 4. from above. Here is what I did:

  • Downloaded the existing Enocean component from this link on github - core/homeassistant/components/enocean at dev · home-assistant/core · GitHub
  • Modified the switch.py file and replaced the turn_on and turn_off methods that send the messages (see code below)
  • Put this code together with all the other downloaded files in in the folder custom_components/enocean/
  • Added the switches you want to add to the configurations yaml - format is below

These are the new messages I am using - they replace lines 99 ff. of this file here core/switch.py at 5d7f9aee272966ac67f6998bf9bcd133d06d6907 · home-assistant/core · GitHub

    def turn_on(self, **kwargs: Any) -> None:
        """Turn on the switch."""
        data = [0xF6, 0x30]
        data.extend(self.dev_id)
        data.extend([0x30])
        self.send_command(
            packet_type = 0x01,
            data = data,
            optional = [0x03, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF]
        )
        self._on_state = True

    def turn_off(self, **kwargs: Any) -> None:
        """Turn off the switch."""
        data = [0xF6, 0x10]
        data.extend(self.dev_id)
        data.extend([0x30])
        self.send_command(
            packet_type = 0x01,
            data = data,
            optional = [0x03, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF]
        )
        self._on_state = False

Format for configurations.yaml

switch:
  - platform: enocean
    id: [0xFF, 0x91, 0x14, 0x01] # This id here neeeds to be replaced by the ones based on the base id
    name: Living room # Pick your own name

Maybe I’m missing something but how do I get this custom_component to work?

Hi Ruben

Found finally some time to check & test.
Unfortunately got stuck quite early:
My wall buttons send Data a number depending on the putton I press (30 and 70 in my example). While releasing it’s 00 always. The status is 30 for pressing, 20 for releasing.

->In the adjusted code, you have “turn_on” data = [0xF6, 0x30], and “turn_off” data = [0xF6, 0x10]
Is it so, that releasing the button is triggering the “turn_off”?

Then, the custom_components, I have the same question as Christian above. (I created the custom_components folder and would upload the files in there - but then how to access and make HA send something?)

Thanks and best regards

1 Like

Hi there,
to your questions:

  • My Eltako wall buttons (Model FT55, they have a PTM216 inside) send a [0xF6, 0x30, button_id, …] for turning on and a [0xF6, 0x10, button_id, …] for turning off - I am ignoring the signal they send when being released - if your buttons are sending something different or you want to pick up the button release you may have to ammend the data they send, but for the Eltako switch this should be fine and I’d think you do not need to ammend this.
  • Yes, correct. Make a folder in custom_components with all the files from the github inside. Should be 11 files plus the folder for translations I believe.
  • You have to still add the switches to the configuration yaml with their corresponding ids. This will look like this:
switch:
  - platform: enocean
    id: [0xFF, 0x91, 0x14, 0x01] # This id here neeeds to be replaced by the ones based on the base id
    name: Living room # Pick your own name

Don’t forget to restart after editing all this - it won’t show or work before that.

(Have added this to the explanation above as well)

Hi @ruben88 and @pas,

Please have a look at the EEP viewer tool to understand the generated telegram.
FT55 uses the EnOcean EEP F6-02-01.

Dear @mak-dev
Dear @ruben88

Thanks for the link. Came across earlier, but as I’m not a programmer I don’t know how to translate this into HA. Now it’s in this thread - might be helpful also for others.
My “stupid” wall-switches are probably F6-01-01 (just broadcast).
In DolphinView I can simulate this behavior - (sending same informatin as if I push the wall-switch, see post4 above).
→ my big problem: I don’t know how to tell HA what to send. Ruben88’s solution I assume close to what I need: turn_on looks, good, and turn_off I’d change from 10 to 00?

def turn_on(self, **kwargs: Any) -> None:
        """Turn on the switch."""
        data = [0xF6, 0x30]
        data.extend(self.dev_id)
        data.extend([0x30])
        self.send_command(
            packet_type = 0x01,
            data = data,
            optional = [0x03, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF]
        )
        self._on_state = True

     def turn_off(self, **kwargs: Any) -> None:
        """Turn off the switch."""
        data = [0xF6, 0x00]
        data.extend(self.dev_id)
        data.extend([0x00])
        self.send_command(
            packet_type = 0x01,
            data = data,
            optional = [0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF]
        )
        self._on_state = False

When I check logs in HA and I push the wall-button (and release, and have the FSR61 sending confirmation telegrams), I see the following:

Push wall switch:
FE:FA:AD:BA->FF:FF:FF:FF (-73 dBm): 0x01 [‘0xf6’, ‘0x30’, ‘0xfe’, ‘0xfa’, ‘0xad’, ‘0xba’, ‘0x30’]
[‘0x0’, ‘0xff’, ‘0xff’, ‘0xff’, ‘0xff’, ‘0x49’, ‘0x0’]

Answer from FSR61:
04:23:3E:30->FF:FF:FF:FF (-71 dBm): 0x01 [‘0xf6’, ‘0x70’, ‘0x4’, ‘0x23’, ‘0x3e’, ‘0x30’, ‘0x30’]
[‘0x0’, ‘0xff’, ‘0xff’, ‘0xff’, ‘0xff’, ‘0x47’, ‘0x0’]

Release wall switch:
FE:FA:AD:BA->FF:FF:FF:FF (-79 dBm): 0x01 [‘0xf6’, ‘0x0’, ‘0xfe’, ‘0xfa’, ‘0xad’, ‘0xba’, ‘0x20’]
[‘0x0’, ‘0xff’, ‘0xff’, ‘0xff’, ‘0xff’, ‘0x4f’, ‘0x0’]

Answer from FSR61:
04:23:3E:30->FF:FF:FF:FF (-70 dBm): 0x01 [‘0xf6’, ‘0x50’, ‘0x4’, ‘0x23’, ‘0x3e’, ‘0x30’, ‘0x30’]
[‘0x0’, ‘0xff’, ‘0xff’, ‘0xff’, ‘0xff’, ‘0x46’, ‘0x0’]

in Short: 1 how to adjust code from ruben88 to have HA sending above structure, and 2 how to configure the switch: - platform: enocean in HA to simulate above? (just broadcast)

I’ll continue to do some trial& error, but happy for any additional hint.

Thanks and best regards

Hi All

Found some time to trial & error… unfortunately I remain stuck with errors.

I adjusted the “switch.py” file as above, and created a “binary sensor” in HA.
When I push it, logger in HA get’s triggered:

0x01 [‘0xd2’, ‘0x1’, ‘0x0’, ‘0x64’, ‘0x0’, ‘0x0’, ‘0x0’, ‘0x0’, ‘0x0’] [‘0x3’, ‘0x5’, ‘0x99’, ‘0xc5’, ‘0x29’, ‘0xff’, ‘0x0’]

When comparing to above logs (when I push wall-switch) it seems to send with a different EEP-profile (D2 instead of F6). Seems also to be “default” if nothing else matches:

If anyone has an idea (or the solution) - happy to try :slightly_smiling_face:

Best regards

Hi @pas ,
some thoughts:

  • Creating a binary sensor and triggering it will not work, since you are modifying the implementation of a switch in the code, not the implementation of a binary sensor. So you will have to create a switch (see here) as part of the config in order to trigger your turn_on and turn_off methods that are part of this.
  • Yes, the value_changed part could trigger based on what your switch does. This might be desired (if you wanna pick up the state the switch sends back after you turned it on or off). I ended up just deleting that part, since my switch is not sending such messages.

Best,
Ruben

Hi @ruben88

Thanks. I wrote Binary sensor by mistake :frowning: I meant sensor.
Binary sensor document looks like it’s only for receiving and changing/triggering things in HA (not for sending).
And sensor has a “send” part, but it looks like it’s “pre-configured” to send “D2” style. Haven’t found where this is defined. I’d need an F6 type to be sent…
Have searched in the other files of the enocean-folder for ideas/analogies, but I didn’t succeed - the closest is the interpretation in the binary sensor for reading out the telegram (from a wall panel) and triggering actions in HA - but nothing about sending these kind of telegrams.

I’m thinking if it’s easier to replace the FSR61 and my wall buttons with something else (although I still believe for an programmer this shouldn’t be too difficult to implement that F6-01-01 in HA…)

Any ideas welcome (to adapt code, or change hardware…)

Best regards and soon Merry Christmas.

Thanks @ruben88. I’ve integrate my Eltako FMS61np as a switch. teach-in was already done with FHEM but should work with DolphinView. My basic enocean-plattform I’ve take from: RomeHeim GitHub - RomeHein/homeassistant_enocean: Enocean integration for homeassistant
In the configuration I’ve set base_id as teach-in-base_id with is the base_id+Number from 1 to 126.
the id ist the ID of the aktor FMS61np.
Maybe it is cleaner to adjust the “original” integration. For now I do “Never change a running system”.

configuration:

switch:
  - platform: enocean
    name: decke_switch
    id: [0x??,0x??,0x??,0x??]
    channel: 2
    behavior: onoff
    base_id: [0x??,0x??,0x??,0x??]

  - platform: enocean
    name: tisch_switch
    id: [0x??,0x??,0x??,0x??]
    channel: 1
    behavior: onoff
    base_id: [0x??,0x??,0x??,0x??]

in the switch.py

    def turn_on(self, **kwargs: Any) -> None:
        """Turn on the switch."""
        data = [0xF6]
        if self.channel == 2:
            data.extend([0x70])
        else:
            data.extend([0x30])
        data.extend(self.base_id)
        data.extend([0x30])
        self.send_command(
            packet_type = 0x01,
            data = data,
            optional = [0x03, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF]
        )
        self._on_state = True
        
    def turn_off(self, **kwargs: Any) -> None:
        """Turn off the switch."""
        data = [0xF6]
        if self.channel == 2:
            data.extend([0x50])
        else:
            data.extend([0x10])
        data.extend(self.base_id)
        data.extend([0x30])
        self.send_command(
            packet_type = 0x01,
            data = data,
            optional = [0x03, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF]
        )
        self._on_state = False
1 Like

Cool and many thanks. Thanks to your code I was able to achieve what I wanted since 2 years :slight_smile: