EnOcean with HA_enoceanmqtt

Hi,

This topic is a follow-up of discussions started in WTH is the enocean support that basic where I introduced a solution I developed to use EnOcean devices in HA through MQTT.
It can be installed as an addon, via docker or standalone.
More details on this solution on github (development version), github (stable version) and latest news.
At the moment, the development version is the recommended one.

EDIT: Proper support for Eltako devices is currently being added. For more details, please have a look at this post.

To contextualize this topic, unfold to see the related previous posts.
4 Likes

Hi @JAD,

Sorry for my late response.
You can start with no device configured in your device list.
Just start the addon with debug and log_packets enabled.
Then just generate some EnOcean traffic.
Then your log should be filled with lines like unknown sensor XX:XX:XX:XX and packet information.

Maybe this can help (from Iobroker)

1 Like

Thanks for providing this Add-On!

I got it installed but get the following error messages:

2023-01-10 06:16:29,115 DEBUG: FF:BD:74:80->FF:FF:FF:FF (-79 dBm): 0x01 ['0xa5', '0xff', '0x6', '0x98', '0x49', '0xff', '0xbd', '0x74', '0x80', '0x0'] ['0x0', '0xff', '0xff', '0xff', '0xff', '0x4f', '0x0'] OrderedDict()
2023-01-10 06:16:29,116 INFO: received: FF:BD:74:80->FF:FF:FF:FF (-79 dBm): 0x01 ['0xa5', '0xff', '0x6', '0x98', '0x49', '0xff', '0xbd', '0x74', '0x80', '0x0'] ['0x0', '0xff', '0xff', '0xff', '0xff', '0x4f', '0x0'] OrderedDict()
2023-01-10 06:16:29,119 WARNING: message not interpretable: enoceanmqtt/contact/wohnzimmer
2023-01-10 06:16:29,121 DEBUG: FF:E4:1B:00->FF:FF:FF:FF (-88 dBm): 0x01 ['0xa5', '0xff', '0x2', '0x61', '0x49', '0xff', '0xe4', '0x1b', '0x0', '0x0'] ['0x0', '0xff', '0xff', '0xff', '0xff', '0x58', '0x0'] OrderedDict()
2023-01-10 06:16:29,123 INFO: received: FF:E4:1B:00->FF:FF:FF:FF (-88 dBm): 0x01 ['0xa5', '0xff', '0x2', '0x61', '0x49', '0xff', '0xe4', '0x1b', '0x0', '0x0'] ['0x0', '0xff', '0xff', '0xff', '0xff', '0x58', '0x0'] OrderedDict()
2023-01-10 06:16:29,126 WARNING: message not interpretable: enoceanmqtt/contact/bibliothek

This is my device file:

[contact/wohnzimmer]
address         = 0xFFBD7480
rorg            = 0xD5
func            = 0x00
type            = 0x01

[contact/bibliothek]
address         = 0xFFE41B00
rorg            = 0xD5
func            = 0x00
type            = 0x01

Would appreciate, if I could get some help or hint. Thanks for that

Hi @CHTHSCH,

From your log, it seems that the EEP you set in your device file is not correct.
As you can see, the first byte of the packet is 0xA5 which means that your device have rorg = 0xA5 instead of rorg = 0xD5. Hence I am sure that func and type are also different.

What is the reference of your device ? I can help you find your EEP.

It is this one AFRISO TĂźr-/Fensterkontakt AMC 20 and this one OPUS TĂźr-/Fensterkontakt

basically the same product. And in the specs it says EEP D5-00-01

Strange that !

Ok so either the specs are wrong or you may have used a wrong device address.
Because for sure, the devices with addresses 0xFFBD7480 and 0xFFE41B00 have their RORG equal to 0xA5.

How did you generate the log ? How did you find the device addresses ?

Also, if these devices have a learn button, please press it and report the log. You should have something like “learn message not emitted to MQTT” in the log.

The log is the one, that the add-on generates. How I found the address I sent in the private mail

Hello everyone:

I got two questions and would appreciate any help:

  1. Can anyone please tell me how I can figure out the base ID of my EnOcean USB300 stick? This is needed to transmit any signals. Receiving works fine, but so far I cant transmit anything.

  2. I am currently trying to figure our how to switch an individual (virtual) button. For example, I try to mimik my 2 rocker switches, EEP F6-02-01. They have two rockers with two states each: “on” or “off”. Since they only show up as binary_senors in MQTT, I can’t set them individually. If I trigger an event: “button_pressed”, it will change the state on all 4 binary sensors simultaneously. I need to set them individually to turn the lights “on” or “off”

All off:


All on:

Thanks!

Hi @Ewoodster81,

1- EnOcean Base ID is reported in the MQTT integration on ENOCEANMQTT device. Look at the What’s new discussion on github for more details (on 2022/11/25).

2- If I correctly understood, you want HA to generate F6-02-01 telegrams ? This is not yet available but can be achieved with a kind of a hack of the existing code. See this github discussion for more details.

1 Like

I’ve been running an Eltako setup for more then 10 years now on a FHEM system. But since we installed a SMA solar installation and Heliotherm heatpump FHEM is not up to the task of running my domotica. So I switched to Home assistant.

Everything is running except… you guest Enocean.

I do have a good understanding on how everything works on FHEM and I bought a USB300 and cloned the starting adress of my tcm120 (which is the interface on my old system)

This gives me the oportunitie to keep the old system running and migrate step by step to HA.
I have seen in the logging that the USB300 is working and the packages do show.

Next step is to see if I can get some of my FUD12 (dimmer) and FSR12 (relay) showing up in MQTT and here where it gets dificult. I did copy the “enoceanmqtt.devices.sampl” and changed the address of rocker 1 to one of my FSR’s but how do I switch this device.

I’m running Generic X86 on a NUC and EnOcean MQTT (dev) as an addon.

Could someone explain me how to control one of the two devices so I can build my knowledge from there.

HI i try to add a EIMSIG window sensor with vibration seonsor. The id is A5-14-0A.

from log:
Device enoceanmqtt/terrace_left (@: 0599F0E8 / EEP: A5-14-0A) updated on device database

2023-01-31 12:34:19,614 DEBUG: 05:99:F0:E8->FF:FF:FF:FF (-53 dBm): 0x01 [‘0xa5’, ‘0x99’, ‘0x0’, ‘0x0’, ‘0xe’, ‘0x5’, ‘0x99’, ‘0xf0’, ‘0xe8’, ‘0x0’] [‘0x0’, ‘0xff’, ‘0xff’, ‘0xff’, ‘0xff’, ‘0x35’, ‘0x0’] OrderedDict()
2023-01-31 12:34:19,615 INFO: received: 05:99:F0:E8->FF:FF:FF:FF (-53 dBm): 0x01 [‘0xa5’, ‘0x99’, ‘0x0’, ‘0x0’, ‘0xe’, ‘0x5’, ‘0x99’, ‘0xf0’, ‘0xe8’, ‘0x0’] [‘0x0’, ‘0xff’, ‘0xff’, ‘0xff’, ‘0xff’, ‘0x35’, ‘0x0’] OrderedDict()
2023-01-31 12:34:19,618 WARNING: Cannot find type in EEP!
2023-01-31 12:34:19,619 WARNING: message not interpretable: enoceanmqtt/terrace_left

Update:

I implemented 3 switches and added them to a dashboard to do some testing. If I press this is visible in the dashboard. So al is good.

If I intergrade the USB300 as a “normal intergration” and add a light in configuration.yaml i’m able to add this light (controlled by a FUD12) to the same dashboard.
code:

light:

  • platform: enocean
    id: [0xFF,0x8C,0xE8,0x88]
    sender_id: [0xFF,0x8C,0xE8,0x88]
    name: waseiland

I can control it On, Off and Dim. But of coarse the USB300 is now controlled by the “normal intergration” and the MQTT part does not work anymore.

So my question is, how do add a device in (I guess in mapping.yaml) to act as if is does when using the light.py from the “normal Enocean Intergration”

Hi @DarkDaniel1974,

This is because it is not yet supported.
I will release support for this EEP and others this week.

1 Like

Hi @heubie,

Sorry, I don’t understand your question. What do you mean by add a device ?
Depending on that, the answer can be either enoceanmqtt.devices or mapping.yaml.

In general, Eltako devices have some particularities and are not well supported yet.
But some of them are supported out of the box.
As it seems FUD12 works with the EnOcean integration, then there is a high probability that it is controllable by A5-38-08 telegrams.
A5-38-08 is in the To-Do list.

If I understand how it works… and that is a BIG IF of course… I hope I did the right thing by:

I made a copy of the mapping.yaml and placed it in /config and made sure in de config to use this one.
I copied the light D2-01-12 and made a D2-01-13 to do some testing.
In devices I made the following device:

[eltako/test light]
address = 0xFF8CE888 ← is id learned in FHEM (base +8)
rorg = 0xD2
func = 0x01
type = 0x013
sender_id = 0xFF8CE888 ← used as above since this works in the “normal enocean”

I looked up in light.py from enocean what they send

command = [0xA5, 0x02, bval, 0x01, 0x09]
command.extend(self._sender_id)
command.extend([0x00])
self.send_command(command, , 0x01)
#bval is dimm value between 0 an 64 (0 to 100%)

So to start of I want to edit the mapping file to get two buttons:
one who sends A5 02 64 01 09 sender_id 00 ?? 01 ← for on because 64 = 100%
one who sends A5 02 00 01 09 sender_id 00 ?? 01 ← for off 0%

?? for the which I don’t understand.

In a later stage I would like to be able to send also a value which is determined by a slider to dim the light.

I hope this makes sense since I new to Home Assistant.

I think you are right with the telegram since I looked up the FUD12 EEP (G5-38-08)

Hi mak-dev … spent some more time on the D2-01-0E and tried to understand what you do in the mappings against comparing the eep-viewer documents.
Learning from your feedback I think and got what the changed payloads are doing in the ‘switch’ section of the mappings file.

Perhaps not reporting power/energy got to do with CMD5 missing? And a question, would it be that easy to simply add such buttons to the mappings or does is need more code from your side under the hood?

Like justone I’m trying to work out how the mapping file works.
I added the 0x38 0x08 to the mapping file and adjusted the device file.
I do get the switch(SW) to work and come back with “on” and “off”

2023-02-01 21:58:49,947 DEBUG: Sending PUBLISH (d0, q0, r1, m48), ‘b’homeassistant/light/enocean_A53808_FF8CE888_FUD12/config’‘, … (434 bytes)
2023-02-01 21:58:49,948 DEBUG: Sending PUBLISH (d0, q0, r1, m49), ‘b’homeassistant/light/enocean_A53808_FF8CE888_Dimming value/config’’, … (354 bytes)
2023-02-01 21:58:49,948 DEBUG: Sending PUBLISH (d0, q0, r1, m50), ‘b’homeassistant/light/enocean_A53808_FF8CE888_Command ID/config’‘, … (312 bytes)
2023-02-01 21:58:49,948 DEBUG: Sending PUBLISH (d0, q0, r1, m51), ‘b’homeassistant/sensor/enocean_A53808_FF8CE888_rssi/config’’, … (399 bytes)
2023-02-01 21:58:49,948 DEBUG: Sending PUBLISH (d0, q0, r1, m52), ‘b’homeassistant/button/enocean_A53808_FF8CE888_delete/config’‘, … (351 bytes)
2023-02-01 21:58:49,948 DEBUG: Sending SUBSCRIBE (d0, m53) [(b’enoceanmqtt/lights/waseiland/__system/#’, 0)]
2023-02-01 21:58:49,951 DEBUG: 0x02 [‘0x0’, ‘0xff’, ‘0x8c’, ‘0xe8’, ‘0x80’] [‘0x9’] OrderedDict()
2023-02-01 21:58:49,951 INFO: got response packet: OK
2023-02-01 21:58:49,952 INFO: Device enoceanmqtt/lights/waseiland (@: FF8CE888 / EEP: A5-38-08) updated on device database
2023-02-01 21:58:49,952 DEBUG: Sending PUBLISH (d0, q0, r1, m54), ‘b’homeassistant/switch/enoceanmqtt_learn_FF8CE880/config’', … (374 bytes)

but when I send a dim value of 50 the I cannot get this value(EDIM) to show up.

2023-02-01 22:07:14,631 DEBUG: FF:8C:E8:88->FF:FF:FF:FF (-57 dBm): 0x01 [‘0xa5’, ‘0x2’, ‘0x32’, ‘0x1’, ‘0x9’, ‘0xff’, ‘0x8c’, ‘0xe8’, ‘0x88’, ‘0x0’] [‘0x0’, ‘0xff’, ‘0xff’, ‘0xff’, ‘0xff’, ‘0x39’, ‘0x0’] OrderedDict()
2023-02-01 22:07:14,632 INFO: received: FF:8C:E8:88->FF:FF:FF:FF (-57 dBm): 0x01 [‘0xa5’, ‘0x2’, ‘0x32’, ‘0x1’, ‘0x9’, ‘0xff’, ‘0x8c’, ‘0xe8’, ‘0x88’, ‘0x0’] [‘0x0’, ‘0xff’, ‘0xff’, ‘0xff’, ‘0xff’, ‘0x39’, ‘0x0’] OrderedDict()
2023-02-01 22:07:14,636 DEBUG: enoceanmqtt/lights/waseiland: COM (Command ID)=Command ID 2
2023-02-01 22:07:14,637 DEBUG: enoceanmqtt/lights/waseiland: TIM (Time in 1/10 seconds. 0 = no time specifed)=1280.1 s
2023-02-01 22:07:14,637 DEBUG: enoceanmqtt/lights/waseiland: LCK (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)=Unlock
2023-02-01 22:07:14,638 DEBUG: enoceanmqtt/lights/waseiland: DEL (Delay or duration (if Time > 0); 0 = Duration (Execute switching command immediately and switch back after duration) 1 = Delay (Execute switching command after delay))=Duration
2023-02-01 22:07:14,638 DEBUG: enoceanmqtt/lights/waseiland: SW (Switching command ON/OFF)=On
2023-02-01 22:07:14,639 DEBUG: enoceanmqtt/lights/waseiland: Sent MQTT: {“RSSI”: -57, “COM”: 2, “TIM”: 1280.1, “LCK”: 0, “DEL”: 0, “SW”: 1}
2023-02-01 22:07:14,640 DEBUG: Sending PUBLISH (d0, q0, r1, m58), ‘b’enoceanmqtt/lights/waseiland’', … (67 bytes)

So is there somewhere were I can read how the mapping of actuator (like relay’s dimmers and switches) works. On the part where the readout is sensors there are a lot of examples.

ps. it is quit a steep learning curve…

It is not that difficult I think :sweat_smile:
Did you have a look at the Contributing section of the wiki ?

The mapping.yaml file is used to map EEPs to HA entities thanks to MQTT discovery.
It is used as a link between enocean-mqtt and Home Assistant as shown on the wiki.

For a device to be supported, it has to be supported both by the Python EnOcean library through the EEP.xml file and by the mapping.yaml file.

The most important things are the EEP documentation and the MQTT discovery documentation. Both links are available on the wiki in the contributing section.
The EEP documentation details the content of the telegram(s) sent by the EEP. Each field of the telegram(s) are sent to MQTT thanks to enocean-mqtt.

The mapping job is then to see which MQTT discovery supported entities are best suited to map the content of the telegram. These entities are declared as EEP components in the mapping.yaml file.
The MQTT configuration is then reported in the config section of the component.
The device_config section is used to set parameters for enocean-mqtt to correctly handle the EEP.

Thanks for the quick reply.

I guess some more reading to do.

So if a telegrams is presented the values are updated, but how do I add a on and off button and slider to control the dimmer in a dashboard.