New openHab2 EnOcean binding

Hi all,

sorry for not answering any more since such a long time. I had a lot of other projects to be finished first, so I did found much time for this binding. However situation is changing in the next few weeks, so I should look a lot more regularly here.

Best regards
Daniel

Hi Justin @lordloki

nice to hear that you like this binding.

When I press the rocker button a few times, I end up with a “simple push button” being connected. However, when I change the toggle position of the button, it does not appear to be sending a message that the other side of the system (a wireless relay) will read.

This binding supports two/three types of things.

  1. Sensors: things which send status messages
  2. Actuators: things which receive command messages and do some actions
  3. Mixed: things which send status messages and which can receive messages

A “simple rocker switch” is just a simple sensor. It receives messages of your HUSA03 and emits openhab events on which you can react. However it is not able to send any messages to your HUSA05.
You need a “classic device”. This thing can react on your HUSA03 messages and send messages to your HUSA05 too.

I am thinking the reason why it may not be working is that the hardswitch had to be “paired” with the relay during setup. I was hoping that merely mimicking it would be sufficient, but it does not appear to be so simple unfortunately

After setting up your classic device, you have to pair it with your HUSA05. EnOcean devices just react on messages of paired devices. Other messages are ignored. You just have to active the teach in or pairing mode of your HUSA05 and press a switch of your classic device. Afterwards you should be able to control your HUSA05.
All messages send with your enoceanpi (or any other gateway) have a unique id. So it is not possible to mimicking messages of other devices (or at least not so easy). However it is not required as you can pair your devices with a merely open number of devices.

If you need more advice/help with your setup, just post a message here.

Best regards
Daniel

Hi Berti @Bize

The EEP D2-50-00 is indeed not yet supported/implemented in this binding. So using a generic thing is correct. However if you want to control your ventilation device it would be better to implement this EEP natively as you have to send a special teach in answer (UTE) to do the pairing. Otherwise you would be only able to receive the status updates of your device. I would try to implement this EEP in my openocean binding (my binding for testing) and after a successfull test I would merge it back to the official binding.

Best regards
Daniel

Hello Ludwig @lu089

I am not sure if you have already made a decision, but as EnOcean is a open platform it should be possible to let openhab communicate with any other enocean device. However I did not found any information about which EEP is used by Maico. Do you have more information for me?

Best regards
Daniel

First, thanks for the super quick response and help!

Secondly, this makes sense, but three more questions:
1: Do I create two classic devices? One for the on button and on for the off button? Or just a single one? The pairing mode for the HUSA05 is a bit finicky, and requires that I press “ON” 3 times – it notes " Press the ON button 3 times in quick succession. Only one switch/remote control can be linked at a time."
2: So that I can control it on the control panel, I believe I have to link it to an “item” – I believe this should be a “switch”?
3: Assuming 2 is “yes” - that only has an “on/off” state – is it possible to send “on” 3 times in a row without an intervening “off”? I’m going to just give it a try to see if flipping state 3 times works even with the off, but I don’t know that it will.

[update] pressing on then off a handful of times (3, or 3+) does not seem to result in it pairing.

Lastly, do you have a patreon account or anything where I can donate?

Hi Daniel,

what excatly do you mean with “implement this EEP natively”?
Do you mean to take the JAVA code from GitHub and implement the D2-50-00 EEP there?
If yes, I really would like to do so, but I don’t have any idea how to start.

Greets,
Berti

Hi Daniel,

Gentle ping in case you didn’t see the reply. I’m hopeful your help will get me there, but at present I can’t seem to pair. I think I need to send “on” 3 times in a row with no intervening “off”.

No rush, but your help would be awesome.

Thanks! (And seriously, do you have a patreon account/page? Would love to send some $ your way for the awesome work).

Hi Justin @lordloki,

sorry for my late answer. Had a busy weekend and did found time to answer.

1: Do I create two classic devices? One for the on button and on for the off button? Or just a single one? The pairing mode for the HUSA05 is a bit finicky, and requires that I press “ON” 3 times – it notes " Press the ON button 3 times in quick succession. Only one switch/remote control can be linked at a time."

A single classic device is enough. This device can emit rocker switch messages and receive/react to rocker switch messages of an user-defined number of devices.

So that I can control it on the control panel, I believe I have to link it to an “item” – I believe this should be a “switch”?

Correct.

Assuming 2 is “yes” - that only has an “on/off” state – is it possible to send “on” 3 times in a row without an intervening “off”?

It is not possible to send 3 “ON”-meesages in a row, as it flips between On/Off. However you could create a rule which sends three “On”-messages. I guess you should wait 500ms between each message otherwise these message could get lost at you HUSA05. I try to create a rule for you this weekend when I have access to my openhab instance…

Lastly, do you have a patreon account or anything where I can donate?

Sorry I do not have a patreon account. However you can buy me a coffee or donate through paypal.

Best regards
Daniel

Hi Berti @Bize ,

I have just started implementing the D2-50 EEP. Should be finished this weekend. I will upload a new release in github afterwards for testing. If you have successfully tested it, I will merge it back to the official binding.

Best regards
Daniel

Hi Justin @lordloki,

here are the config files:

.things

Thing classicDevice ID "HUSA" [ senderIdOffset=123, sendingEEPId="F6_02_01", receivingEEPId="F6_02_01", broadcastMessages=true, suppressRepeating=false ] {Channels: Type virtualSwitchA:virtualSwitchA [duration=0, switchMode="rockerSwitch"]}

This is the ClassicDevice config for your HUSA05. I have disabled the automatic “release” switch message (duration=0), as I could imagine that this release message could mess up the teach in. Just replace ID with your id and 123 witch any senderIdOffset your want. This config just contains the rocker switch to control your HUSA05. It does not contain the rocker switch listeners to your HUSA03.

.items

Switch                              TeachInSwitch    "TeachIn" 
Switch                              Virtual_Rocker    "Switch {channel="enocean:classicDevice:XYZ:ID:virtualSwitchA"}

First item is need for a rule to do the tripple ON, second item is your virtual rocker switch to control your HUSA05, you can imagine it as a virtual HUSA03. Replace XYZ with your gateway Id and ID with your classicDevice Id.

.rules

rule "TrippleOn"
when
    Item TeachInSwitch changed to ON
then
    Virtual_Rocker.sendCommand(ON)
    Thread::sleep(500)
    Virtual_Rocker.sendCommand(ON)
    Thread::sleep(500)
    Virtual_Rocker.sendCommand(ON)
end

I hope this helps. If teach in is successfull and you can control your HUSA05, you could add additional rocker switch listeners to update the openhab state of your HUSA05 when you use a physical HUSA03 rocker switch.

Best regards
Daniel

Hi Daniel, @fruggy83

About the Thermokon SR06 room thermostat-
Is the D2-11-01 included in Openoceans latest release [2.5.1.0] ?

Could you please add support for D2-11-02, only change being it has extra humidity value reading.

Best Regards,
Tanel

I am probably being an irritating noob (btw, buying you a few coffees) – but I tried to create three files in etc/openhab2/things /items and /rules using sudo nano [filename]

files are named enocean.things, enocean.items, and enocean.rules. I literally copy pasted what you put above, and then as instructed replaced XYZ with my gateway ID and ID with a random 8 character ID (e.g., abcde12a) for the thing.

Nothing is showing up in paperui. I tried stopping the service, clearing the cache, and restarting. other than an irritating wait as it came back up, nothing changed.

am I just an idiot? (I’m pretty new to openhab, but I spent about 30 minutes looking around at posts on manually creating things and can’t find anything telling me to do anything more specific than creating the file in that directory.) sorry if it is just a noob problem.

Btw – in my log, I don’t see anything related to my newly created things, items and rules.

[edited to remove information about not connecting – as it turns out the usb cable was not great. I switched cables and the lightning bolt is gone and the bridge comes up immediately).

Still cannot see the newly added thigns, though.

Just to confirm, the gateway ID I am supposed to use in place of XYZ is the final part in this string, right?
enocean:bridge:aaaa2222 ( changed from the real id at the end – so if that were my Id, and my random id for the classic device were abcde12a (this is just a random ID, right?), I would put

Thing classicDevice abcde12a “HUSA” [ senderIdOffset=123, sendingEEPId=“F6_02_01”, receivingEEPId=“F6_02_01”, broadcastMessages=true, suppressRepeating=false ] {Channels: Type virtualSwitchA:virtualSwitchA [duration=0, switchMode=“rockerSwitch”]}

in enocean.things

and
Switch TeachInSwitch “TeachIn”
Switch Virtual_Rocker "Switch {channel=“enocean:classicDevice:aaaa2222:abcde12a:virtualSwitchA”}

in enocean.items

)

am I understanding that right?

I tried changing the ID to enocean:classicDevice:abcde12a – and at least that makes it show up as a thing in the paperui – but it says offline, and says a bridge is needed. and nothing shows up in items. if I try to add it to the bridge from paperui, it allows it, but when I save says error 409 conflict.

I figured out what was wrong with the item – you were missing a " mark after “Switch”. Once I fixed the parsing error, the items appeared, too. and I can link them to the thing.

[fixed that error too – I couldn’t get it to connect to the bridge, but realized I needed to declare the bridge in the .things file].

So now – everything works!! (we’re connected and I can control my heater from my phone!! – and I can still control it from the physical switch) The only thing that is a little wonky is that the switch is reversed. When I change the switch to “On” - the heater turns off, and vice versa. Any idea how to fix this? thanks SO much for your help.

And if I hit the physical switch, it obviously isn’t listening to that (so I lose that status) – but I assume this is what you meant before when you said I now need a listener for the HUSA03. So i’ll try to figure that out once I can switch the polarity of the switch so the status I have is correct :slight_smile:

Hi all,
I am using the EnOcean binding with the USB300 connected to a Fritzbox 7490 via the port rfc2217.

Settings:
Fritzbox (ser2net.conf):
3001:telnet:0:/dev/ttyUSB0:57600 8DATABITS NONE 1STOPBIT remctl

Linux (enocean.things)
Bridge enocean:bridge:gtwy “EnOcean Gateway” [ path=“rfc2217://192.168.7.64:3001” ] {
blabla
}

The binding is working. The problem is, that the bridge state remains ONLINE when stopping the ser2net service on the Fritzbox side. For example when rebooting the Fritzbox, the binding on the openhab side show still ONLINE but that isn´t correct.

How can I detect, that the bridge ist OFFLINE and how can I start a reconnect?

Hi @matty67,

I just looked for a way to detect lost connections. I did not found a good way to detect a lost connection. However you could use a workaround by periodically “pinging” the gateway. For example you could send an enocean message (rocker switch message) every 5 minutes. If the connection is lost, the gateway will receive an exception while trying to send the message. Afterwards the gateway tries to reset the connection every minute.

Hope this helps you in some way.

Best regards
Daniel

Hi Justin @lordloki,

sorry for my late answer and my mistake in the item file. I am glad to hear that it works for you now.

The only thing that is a little wonky is that the switch is reversed.

You could change this behaviour by using the F6_02_02 as the sendingEEP for your classicDevice. This will reverse the rocker switch messages.

[fixed that error too – I couldn’t get it to connect to the bridge, but realized I needed to declare the bridge in the .things file].

My fault, forgot to mention this bridge part. Good to know that you found a way to solve it by your own. I woudl recommend to configure/declare all your things in a thing file. This way you can just backup all your things and items files and easily reset your system.

And if I hit the physical switch, it obviously isn’t listening to that (so I lose that status) – but I assume this is what you meant before when you said I now need a listener for the HUSA03

If the reversal of the switch messages works, you could add the following lines to your classicDevice:

Thing classicDevice ID "HUSA" [ senderIdOffset=123, sendingEEPId="F6_02_01", receivingEEPId="F6_02_01", broadcastMessages=true, suppressRepeating=false ] 
{
  Channels: 
     Type virtualSwitchA:virtualSwitchA [duration=0, switchMode="rockerSwitch"]
     Type rockerswitchListenerSwitch:Listener1 [enoceanId="aabbccdd", channel="channelA", switchMode="rockerSwitch"]
}

You have to replace “aabbccdd” by the enoceanId of your physical rocker switch. The channel parameter depends which channel is used by your rocker. Normally an enocean rocker switch has two channels each with 2 buttons. In your case you have to try “channelA” or “channelB”.
Afterwards you can link your Switch item to this listener to update the state in openhab if you press your physical rocker.

Switch Virtual_Rocker "Switch" {channel="enocean:classicDevice:XYZ:ID:virtualSwitchA", channel="enocean:classicDevice:XYZ:ID:Listener1"}

Replace XYZ and ID accordingly.

btw, buying you a few coffees

Thanks a lot :+1: :coffee:

Best regards
Daniel

Hi Tanel @Ratiomatic,

I am really really sorry that I did not respond to you for such a long time. I did not found time to work on this projects in the last months. However situation is changing now.

I was chasing a really dumb error the last days (serial port crashes on windows systems and I am developing under windows most the time).

However I found a workaround for this problem (rfc connection) and hopefully will find some time in the next days to implement this EEP and push the SMACK features for SR06 to the official binding.

Best regards
Daniel

1 Like

Great! And thanks again!! No need to apologise for a delayed reply. You have no obligation to help us!

So the first thing worked - changing to F6_02_02 did it. So now I can ask Google to turn it on and it turns on instead of off.

But for some reason the listener component is not working.

To determine the Id, I used the paper ui to add a thing, and it gave me a simple push button. I used that id and made the changes you said.

[Edit] I actually got it working, but to do so had to go into paper ui and link the listener to the husa device. Is that supposed to be necessary? It worked, but now I have two items in the control panel. And it seems that my ability to control or over Google Assistant is a bit laggy now. But that could be unrelated.

Thoughts?

Thanks again for everything! You’re quite awesome for being willing to help.

Hi Daniel.
I found a solution for the reconnect problem.
One of my enocean components is a psc234 measurementSwitch.
When I define the component, the instantpower channel automatically starts a polling interval (D2_01_04). So a lost connection can be detected and the state of the bridge goes to offline. Than a reconnect starts automatically.

Thing measurementSwitch ms01 “TV Smart Plug” @ “Living room” [ enoceanId=“xyz”, senderIdOffset=z, sendingEEPId=“D2_01_04”, broadcastMessages=false, receivingEE$

Thx for your answer.

1 Like