Enocean add thing to "xxx.things" file manually

  • Raspberry PI 3+
  • Kernel Linux 4.14.79-v7+
  • OpenJDK Runtime Environment (Zulu Embedded 8.25.0.76-linux-aarch32hf) (build 1.8.0_152-b76)
  • openHAB(ian) 2.4.0~S1458-1 (Build #1458)

Issue of the topic:
From my FHEM Installation I did try before the Enocean binding (formal OpenOcean) was added to the latest OH2 Build just some weeks ago (@fruggy83: Thank you very much for your work) , I have all actors data like Enocean ID and EEP codes present together with where they are placed in the flat and the purpose of them.
As some of the actors are at places not so easily assessable I do have the question if it is possible to add those devices manually through the “xxx.things” file in the /openhab2-conf/things/ folder.

As I did add one actor through PapeUI Inbox, I thought I could be able to see how it is implemented into OH2, but it seams very very complicated to manipulate the files I did find any reference to the imported thing.
It is existing with different data in

  • /openhab2-userdata/jsondb/org.eclipse.smarthome.core.items.Item.json
  • /openhab2-userdata/jsondb/org.eclipse.smarthome.core.items.Metadata.json
  • /openhab2-userdata/jsondb/org.eclipse.smarthome.core.thing.link.ItemChannelLink.json

Can anyone suggest me a working procedure and way to add them properly through the “xxxx.things” file?

Thank you for your answers, suggestions and feedback.
Regards
Thomas

Start with the examples in the bindings docs:

Hi Thomas (@thotha),

as vzorglub said, just have a look into the examples of the binding doc first. I really tried hard to explain everything in detail. If you are missing some information, just ask here, I will try to clarify the docs afterwards.

However I have some hints for the FHEM => openHAB conversion, which are not explicitly mentioned in the docs:

  • You do not need to teach in your actors again in openHAB if you are using the same enocean gateway as in fhem. If you want to use another one, you could use the “set base id” channel of the enocean bridge and change it to your fhem base id. Be aware that you can change the base id just 10 times. Remaining changes are displayed in the properties of your bridge.
  • As I also used fhem in my first smart home setup, I tried to use the same vocabulary as in fhem but simplified the setup a little bit in my binding. For example the sender id is also very important for this binding. However you do not have to specifiy it as a hex number, a simple integer between 1-127 is sufficient. To convert the hex sender id from your fhem setup into the integer sender id of openHAB, you just have to subtract the base id of your gateway from your fhem sender id and “convert” the result into an int. For example: senderId aabbcc10, base id aabbcc00 => aabbcc10 - aabbcc00 = 00000010 => 16
  • Whenever possible try to use the specific EEPs and avoid the rocker switch emulation, as fhem does it in certain cases

If you want you could post your fhem config for each device type here and I can try to give you the converted openHAB thing definition.

Best regards
Daniel

Clean new installation for this testings!
openhab-distro : 2.4.0.M8
smarthome : 0.10.0.oh240M8
openhab-core : 2.4.0.M8
openhab1-addons : 1.13.0.M8
openhab2-addons : 2.4.0.M8
karaf : 4.2.1
Only EnOcean Binding installed, NO other stuff next to the default installation.

Dear Daniel

Thank you for your feedback, suggestions and help offer.
I did try as you and @vzorglub did mention.

Unfortunately I wasn’t able to get any of my devices to work through the “xxx.things” file way.
I did try the following configuration.

Bridge enocean:bridge:gtwy “EnOcean Gateway” [path="/dev/serial0"]
{Thing measurementSwitch dim_wozi_standlamp “Omnio Aktor (EEP D2_01_01)” @ “TEST” [
enoceanID=“0190D273”,
senderIdOffset=3,
sendingEEPId=“D2_01_01”,
broadcastMessages=false,
receivingEEPId=“D2_01_01”,
suppressRepeating=false,
pollingInterval=300]
}
{Thing measurementSwitch dim_wozi_standlamp “Omnio Dimmer (EEP D2_01_03)” @ “TEST” [
enoceanID=“018D1393”,
senderIdOffset=4,
sendingEEPId=“D2_01_03”,
broadcastMessages=false,
receivingEEPId=“D2_01_03”,
suppressRepeating=false,
pollingInterval=300]
}
{Thing measurementSwitch dim_wozi_standlamp “Omnio 2 Kanal Aktor (EEP D2_01_11)” @ “TEST” [
enoceanID=“01918048”,
senderIdOffset=5,
sendingEEPId=“D2_01_11”,
broadcastMessages=false,
receivingEEPId=“D2_01_11”,
suppressRepeating=false,
pollingInterval=300]
}

Except the “EnOceanId”, all other parameters have been acepted through the xxx.things file.

Next to the added thing I see the following error message in the PaperUI: “UNINITIALIZED - HANDLER_CONFIGURATION_PENDING”

If I add the EnOceanId “” manually, in the rigth lower corner of the PaperUI I see failure “Error 409 Conflict”.
In the log I can see the following:

[hingStatusInfoChangedEvent] - ‘enocean:measurementSwitch:act_d2_01_01’ changed from UNINITIALIZED to UNINITIALIZED (HANDLER_MISSING_ERROR)
[hingStatusInfoChangedEvent] - ‘enocean:measurementSwitch:dim_d2_01_03’ changed from UNINITIALIZED to UNINITIALIZED (HANDLER_MISSING_ERROR)
[hingStatusInfoChangedEvent] - ‘enocean:measurementSwitch:act_d2_01_11’ changed from UNINITIALIZED to UNINITIALIZED (HANDLER_MISSING_ERROR)

After long tries and errors I gave the PapierUI a last chance to use the “Inbox” and after starting it with the EnOcean Bridge, went through “ADD MANUALLY” and filled in the required data.
This time I was able to integrate the devices and they where working some how, at least the normal actuators (D2_01_01, D2_01_11). The dimmer (D2_01_03) didn’t react on any klicks at all.
But there is an more difficult failure with this EnOcean and Openhab 2 setup.
The switches of the singel actuator (D2_01_01) and the not responding dimmer (D2_01_03) do change there switch position without ANY interaction of my side.
The two channel actuator (D2_02_11) doesn’t show this behavior.
Also all of this EnOcean devices sometime do only physically switch from ON to OFF or viceversa after I did change the switches in the PaperUI two times in a row.

So, Is this somehow a

  • known problem?
  • something which I can solve?
  • something I did setup wrongly?

What’s next to go on?
Which log file data do you need and how/where to get the right ones?

Thank you all for your feedback and response.
Regards and have a nice weekend
Thomas

And just shortly after I did write this, I was able to see directly in the logfiles when this PaperUI switching thing happened.
I do upload the log parts with some notes from my side.
Hope that helps

PaperUI Failure EnOcean.txt (14.7 KB)

Hi Thomas (@thotha),

I would say, that we should solve your problems step by step. First of all, you said, that you have already a fhem installation running. You should stop fhem (or at least the enocea plugin) when you are setting up openHAB. Second, it would be nice if you could post your enocean specific fhem configuration here (like you did it with the log file). I just want to be sure that you have done the fhem teachin with the same EEP. In most cases these actuators support different EEPs to control them.
Next, you thing syntax is somehow broken. That is the reason for some of your errors. So I would recommend to clean everything up, delete all you thing and item files and delete all remaining things and items in PaperUI. Next we should do the setup thing by thing. As you had no success with you dimmer at all, I would say that we start with this device.

Following the thing file

Bridge enocean:bridge:gtwy "EnOcean Gateway" [path="/dev/serial0"] {
   Thing measurementSwitch dim_wozi_standlamp "Omnio Dimmer (EEP D2_01_03)" @ "TEST" [
        enoceanId="018D1393",
        senderIdOffset=4,
        sendingEEPId="D2_01_03",
        broadcastMessages=false,
        receivingEEPId="D2_01_03",
        suppressRepeating=false,
        pollingInterval=300 ]
}

By the way which kind of enocean gateway do you use? An USB300 or an EnOceanPI? I would have expected something like /dev/ttyAMA0 or /dev/ttyUSB0 for your gateway path.

Best regards
Daniel

Hi Thomas (@thotha),

I have just found a bug in the implementation of the D2_01 EEPs. The switching state is not correctly parsed. I will do a PR.

Best regards
Daniel

Hello,

I can confirm, that I have the same issue. Adding a thing in manual text configuration results in UNINITIALIZED - HANDLER_CONFIGURATION_PENDING state, while adding the same thing via paper UI works without a problem.
The details:
Openhab stable 2.4 with new enocean binding and the following manual things configuration:

Bridge enocean:bridge:020b40e9 "EnOcean Gateway" [ path="/dev/ttyS0" ] {
    Thing mechanicalHandle ug_garage_kon "Garagentor Kontakt" @ "UG" [ enoceanID="01A89BBE", receivingEEPId="F6_10_00"]
}

This results in the following error:

2018-12-26 12:46:06.489 [hingStatusInfoChangedEvent] - 'enocean:mechanicalHandle:020b40e9:01A89BBE' changed from ONLINE to UNINITIALIZED
2018-12-26 12:46:06.511 [hingStatusInfoChangedEvent] - 'enocean:mechanicalHandle:020b40e9:01A89BBE' changed from UNINITIALIZED to UNINITIALIZED (HANDLER_MISSING_ERROR)
2018-12-26 12:46:06.517 [hingStatusInfoChangedEvent] - 'enocean:mechanicalHandle:020b40e9:ug_garage_kon' changed from UNINITIALIZED (HANDLER_CONFIGURATION_PENDING) to UNINITIALIZED
2018-12-26 12:46:06.541 [hingStatusInfoChangedEvent] - 'enocean:mechanicalHandle:020b40e9:ug_garage_kon' changed from UNINITIALIZED to UNINITIALIZED (HANDLER_MISSING_ERROR)
2018-12-26 12:46:06.547 [hingStatusInfoChangedEvent] - 'enocean:bridge:020b40e9' changed from ONLINE to UNINITIALIZED
2018-12-26 12:46:06.705 [hingStatusInfoChangedEvent] - 'enocean:bridge:020b40e9' changed from UNINITIALIZED to UNINITIALIZED (HANDLER_MISSING_ERROR)
2018-12-26 12:46:07.041 [hingStatusInfoChangedEvent] - 'enocean:bridge:020b40e9' changed from UNINITIALIZED to INITIALIZING
2018-12-26 12:46:07.054 [hingStatusInfoChangedEvent] - 'enocean:bridge:020b40e9' changed from INITIALIZING to OFFLINE (CONFIGURATION_PENDING): trying to connect to gateway...
2018-12-26 12:46:07.060 [hingStatusInfoChangedEvent] - 'enocean:bridge:020b40e9' changed from OFFLINE (CONFIGURATION_PENDING): trying to connect to gateway... to OFFLINE (CONFIGURATION_PENDING): opening serial port...
2018-12-26 12:46:07.117 [hingStatusInfoChangedEvent] - 'enocean:bridge:020b40e9' changed from OFFLINE (CONFIGURATION_PENDING): opening serial port... to OFFLINE (CONFIGURATION_PENDING): starting rx thread...
2018-12-26 12:46:07.130 [hingStatusInfoChangedEvent] - 'enocean:mechanicalHandle:020b40e9:ug_garage_kon' changed from UNINITIALIZED to UNINITIALIZED (HANDLER_CONFIGURATION_PENDING)
2018-12-26 12:46:07.134 [hingStatusInfoChangedEvent] - 'enocean:mechanicalHandle:020b40e9:01A89BBE' changed from UNINITIALIZED (HANDLER_MISSING_ERROR) to INITIALIZING
2018-12-26 12:46:07.139 [hingStatusInfoChangedEvent] - 'enocean:mechanicalHandle:020b40e9:01A89BBE' changed from INITIALIZING to OFFLINE (BRIDGE_OFFLINE)
2018-12-26 12:46:07.168 [hingStatusInfoChangedEvent] - 'enocean:bridge:020b40e9' changed from OFFLINE (CONFIGURATION_PENDING): starting rx thread... to OFFLINE (CONFIGURATION_PENDING): trying to get bridge base id...
2018-12-26 12:46:07.200 [me.event.ThingUpdatedEvent] - Thing 'enocean:bridge:020b40e9' has been updated.
2018-12-26 12:46:07.207 [me.event.ThingUpdatedEvent] - Thing 'enocean:bridge:020b40e9' has been updated.
2018-12-26 12:46:07.211 [hingStatusInfoChangedEvent] - 'enocean:bridge:020b40e9' changed from OFFLINE (CONFIGURATION_PENDING): trying to get bridge base id... to ONLINE
2018-12-26 12:46:07.232 [hingStatusInfoChangedEvent] - 'enocean:mechanicalHandle:020b40e9:01A89BBE' changed from OFFLINE (BRIDGE_OFFLINE) to ONLINE

The manual configured Thing enocean:mechanicalHandle:020b40e9:ug_garage_kon stays in error state, while the thing created with PaperUI (enocean:mechanicalHandle:020b40e9:01A89BBE) goes online.


Any suggestion in this ? I would like to configure all things and items using text file, beacause my whole setup is made in this way.

Found the solution !
Now it works also with manual configuration. It must be enoceanId="xxxxxxxx" instead of enoceanID="xxxxxxxx" (pay attention on the different spelling of Id vs ID). In my opinion parts of the documentation https://www.openhab.org/addons/bindings/enocean/ is not correct. I will try to fix this.

Best regards
schogit