New openHab2 EnOcean binding

Hi @fruggy83 @dominikkv
Please will somebody involved post a short instruction and maybe update the documentation how to utilize the Generic Thing using A5_FF_FF or D2_FF_FF. I have looked trough forums and can’t get an idea how this can be done to receive numeric values, all examples are with MAP transform.

For example if I wanted to read EEP A5-09-04 how to get the raw data and divide it to 3 raw bytes (Temp, Humidity and CO2 value in this case) Should we use this with JS transform?
I think this would solve many seldom used EEPs, that neccessarily do not need full support.

Hi Rainer @jahnra,

you can enable the debug log with log:set debug org.openhab.binding.enocean
I kept the binding id of the official version, so you do not have to change your config files when you switch between the official version and openocean.

I should be sufficient to just feature:install openhab-transport-serial in the karaf console.

Could you please tell me more about your setup? Is it like RaspPi => FGW14 => BUS => FAM14 => WinEtel? Is WinEtel connected by USB or by radio with FAM14? I just checked again but I cannot image why 256 should be added to the senderId.

Best regards
Daniel

Hi Tanel @Ratiomatic,

for complex and not yet implemented EEP like D2 EEP we must use a Generic Thing in conjunction with a JS transform. A simple MAP transform would be to complicated as you have to list all different combinations in you mapping file. I have not found time yet to document a JS transformation. So if you have time, it would be great if you could create an example.

Best regards
Daniel

Hello Daniel @fruggy83,

log:set debug org.openhab.binding.enocean
instead of
log:set debug org.openhab.binding.openocean
was successful - thank you!

Yes, it is exactly like this. and FAM14 was connected over USB to WinEtel.
Sending over ttyAMA0 => FGW14 is looking like:

2019-03-26 00:00:49.167 [DEBUG] [ernal.transceiver.EnOceanTransceiver] - Enqueue new send request with ESP3 type RADIO_ERP1 without callback

2019-03-26 00:00:49.171 [DEBUG] [ernal.transceiver.EnOceanTransceiver] - Sending data, type RADIO_ERP1, payload F600000000012001FFFFFFFFFF00

But the actuator programmed to address 0x00000101 will respond. With ttyUSB0 over FAM14 this actuator does not respond.

The FGW14 is designed also to connect two series 14 buses. I guess this behaviour is normal to not have a conflict between the actuator status messages of two different buses. I’m sure that FGW14 will modify the sender address when a address between 0 and 255 is received. Because of this, modifying the BaseId in this mode would be great…

With my serial problem I did:

sudo service openhab2 stop
sudo openhab-cli clean-cache
sudo service openhab2 start
feature:install openhab-transport-serial on Karaf

After I was able to receive over ttyAMA0, but after openhab2 restart or reboot the raspi, receiving channel is dead again! :thinking:

Update:
I used a fresh installation with only openocean.
This seems to solve my problem also: New openHab2 EnOcean binding - #449 by fnu

Best Regards,
Rainer

First I need a hint how to access the raw payload, when I just assign a variable to Number there is no update. I also tried the JS transform to just return the value:
(function(inputData) {
return (inputData);
})(input)
Only thing I can get is last update timedate:
11:12:01.985 [TRACE] [ternal.transceiver.EnOceanTransceiver] - Received Sync Byte
11:12:02.002 [TRACE] [ternal.transceiver.EnOceanTransceiver] - >> Received header, data length 12 optional length 7 packet type 1
11:12:02.013 [DEBUG] [ternal.transceiver.EnOceanTransceiver] - RADIO_ERP1 with RORG VLD for 050466FE payload D24000E00000B0050466FE0000FFFFFFFF2E00 received
11:12:02.022 [DEBUG] [ernal.handler.EnOceanBaseThingHandler] - ESP Packet payload D24000E00000B0050466FE00 for 050466FE received
11:12:02.138 [INFO ] [smarthome.event.ItemStateChangedEvent] - VM_Pressac_VU changed from 2019-03-26T11:11:31.880+0200 to 2019-03-26T11:12:02.118+0200

Hi @Ratiomatic, @JGKK, and all other asking for more info on genericThings

following you find a generic implementation of EEP D2-03-0A. This EEP is used by NodOn SoftButtons. I hope that this example is helpful and can be adopted to any other not yet implemented EEP.

Thing definition

Thing genericThing NodOnButton "Button" [ 
      enoceanId="AABBCCDD",
      sendingEEPId="D2_FF_FF", 
      broadcastMessages=true, 
      receivingEEPId="D2_FF_FF",
      suppressRepeating=false] {
      
        Channels: 
            Type genericNumber : genericNumber [transformationType="JS", transformationFunction="generic.js"]
            Type genericString : genericString [transformationType="JS", transformationFunction="generic.js"]
            Type genericSwitch : genericSwitch [transformationType="JS", transformationFunction="generic.js"]
      }      

generic.js file

(function(inputData) {

    var parts = inputData.split('|'),
        hexToBytes = function(hex) {
        for (var bytes = [], c = 0; c < hex.length; c += 2)
        bytes.push(parseInt(hex.substr(c, 2), 16));
        return bytes;
    };
    
    if(!parts || parts.length != 2)
        return null;
    
    var b = hexToBytes(parts[1]);
    switch(parts[0]){
        case "genericSwitch":
            if(b[1] == 1){
                return "OnOffType" + "|" + "ON";
            } else if(b[1] == 2){
                return "OnOffType" + "|" + "OFF";
            }
            break;
            
        case "genericRollershutter":
            break;
            
        case "genericDimmer":
            break;
        
        case "genericNumber":            
            return "DecimalType" + "|" + b[0];
            
        case "genericColor":
            break;
            
        case "genericString":
            if(b[1] == 1){
                return "StringType" + "|" + "SinglePress";
            } else if(b[1] == 2){
                return "StringType" + "|" + "DoublePress";
            } else if(b[1] == 3){
                return "StringType" + "|" + "LongPress";
            } else if(b[1] == 4){
                return "StringType" + "|" + "LongRelease";
            }
            break;
            
        case "genericTeachInCMD":
            break;
    }
    
    return (inputData);
})(input)

The transformation function is provided with a string consisting of “ChannelId” + Pipe + “Payload”. The generic.js file already contains a helper function which converts the payload into a byte array (b). The result of the transformation function has to be “OpenHAB State” + Pipe + “Value”. Just return inputData, if you cannot convert it.

Best regards
Daniel

ps @JGKK I have already implemented the EEP, however as long as it is not published you can use this generic thing approach. The number channel holds the battery status in percent.

2 Likes

Hi @fruggy83,

Thanks for the clear example. Works fine.
Slight problem is only having one number value as genericNumber
A5-09-04 has 3 Number values, I managed to extract CO2 to genericNumber and humidity + temperature into one genericString.
Is it the best way to solve it right now? Later dividing the string into two numbers using a rule.

Hi,

does anybody has a NODON temperature & humidity sensor? It is written on the back that it uses EEP A5-04-01. However the teach-in data (received by FHEM) looks like this:

2019.03.09 17:06:02 4 : EnOcean Unknown device with SenderID 051173E2 and STE telegram, activate learning mode.
2019.03.09 17:06:02 5 : EUL dispatch EnOcean:1:31:0324AC221D9CBE457A:051173E2:00:01FFFFFFFF4900
2019.03.09 17:06:02 4 : EnOcean received via EUL: EnOcean:1:31:0324AC221D9CBE457A:051173E2:00:01FFFFFFFF4900
2019.03.09 17:06:02 5 : EnOcean received PacketType: 1 RORG: 31 DATA: 0324AC221D9CBE457A SenderID: 051173E2 STATUS: 00
2019.03.09 17:06:02 4 : EnOcean Unknown device with SenderID 051173E2 and ENC telegram, activate learning mode.

I would not expect RORG 31 here. Does anybody has an idea?

Thorsten

I have one of the Nodon temperature and humidity sensors, don’t know about the teach in message but the teach in and function works without any problems in the openhab enocean binding.

… just saw on GitHub that the NODON temperature & humidity sensor is supported. I guess I don’t get it running because I use 2.5.0.SNAPSHOT.

Im using it with the openocean 2.5.0.1 binding

Hi Johannes @JGKK,

did you use the configuration files to set it up. This is my preferred way to do it. If yes, you might give me a hint how to do it.

Thorsten

sorry, no I used the automatic discovery in the PaperUI

Hey @ThAO, I also use the NodON STPH-2-1-05 devices with the latest binding version (or better said, a self-compiled version :smiley: ). Here are my DSLs:

Thing:

Thing temperatureHumiditySensor 11223344 "Temperatursensor Bad" @ "Bad" [ enoceanId="11223344", receivingEEPId="A5_04_01" ]

Items:

Number:Temperature c_bad_temperatur "Temperatur Bad [%.1f °C]" <temperature> (g_temperature_avg, g_bind_enocean) [ "CurrentTemperature" ] {channel="enocean:temperatureHumiditySensor:usb300:11223344:temperature"}
Number c_bad_humidity "rel. Luftfeuchtigkeit Bad [%d%%]" <humidity> (g_humidity_avg, g_bind_enocean) [ "CurrentHumidity" ] {channel="enocean:temperatureHumiditySensor:usb300:11223344:humidity"}

You do not have to teach them in if you use DSL files. If they do not work, please post a log from receiving a message from your sensor.

Hi @fruggy83

I tried to include Eltako FAFT60 temperature/humidity sensor.
image

Pairing worked without an issue:

Unfortunately openHAB does not get any updates. Is this a generic issue with this kind of sensor?

Thank you!

EDIT:
It works. I had just issues with the range…

Nope, should work, I also have an ELTAKO FAFT60:

Thing temperatureHumiditySensor 11223344 "Temperatursensor Außen" @ "Außen" [ enoceanId="11223344", receivingEEPId="A5_04_02_ELTAKO" ]

Number:Temperature c_outside_temperatur "Temperatur Außen [%.1f °C]" <temperature> (g_outside_temperatures, g_type_temperature, g_bind_enocean) [ "CurrentTemperature" ] {channel="enocean:temperatureHumiditySensor:usb300:11223344:temperature"}
Number c_outside_humidity "Luftfeuchtigkeit Außen [%d%%]" <humidity> (g_type_humidity, g_bind_enocean) [ "CurrentHumidity" ] {channel="enocean:temperatureHumiditySensor:usb300:11223344:humidity"}

Please note the ELTAKO special EEP as ELTAKO is again ignoring the specification. If this doesn’t help, please show us a Log of the received telegram.

Ok, it works. I had just issues with the range… Thank you

Hello Daniel @fruggy83,

I have found the Eltako document what I was talking about last time:

There you can find on page 3:
“Die ID‘s der FTS12EM-Telegramme werden vom FGW14 vor der Ausgabe auf den BR14-Bus um 255 (0x100) erhöht, da die Antworten der BR14-Aktoren den ID-Bereich von 1-254 belegen.”

So a possibility to be outside of sender ID 0-255 is still very welcome in RS485 mode :slight_smile:

But for all of my sensors the binding is working very well!!

Best regards,
Rainer

Hi Rainer @jahnra,

thanks a lot for this document. Makes sense to me :wink: I will change the binding. In case of a RS485 connection, the SenderId will no longer be checked if it is between 0-255.
So in your case Id range 0-255 => BR14-Aktoren
256-512 => FTS12EM rocker switches
513-xxx => openhab things?

Best regards
Daniel

Hi Daniel @fruggy83,

Thank you for your understanding!
This would be a big improvement in two ways:

  • no conflict with the actuator response messages and OH when using FAM14
  • same actuator configuration when using FAM14 or FGW14

Best Regards,
Rainer