wolfgang ziegler


„make stuff and blog about it“

HomeMatic HM-PBI-4-FM not sending events to openHAB

May 8, 2019

The problem I am describing here had cost me almost 3 hours of my life recently. So I'm hoping that I can spare someone else that pain by blogging about it.

I'm doing home automation for quite a while now, using a couple of different technologies (Hue, HomeMatic, Sonoff, ...). All off those different systems and technologies are integrated on my Raspberry Pi openHAB installation.

Recently, I was adding another HomeMatic component to the system, namely a HM-PBI-4-FM interface for pushbutton light switches. It's a batter-powered device that can be mounted under a light switch and connect up to four different channels. Switch interactions will then be sent as events to the HomeMatic central unit (CCU2) and can further be processed in integration hubs like HomeMatic.

The HM-PBI-4-FM wireless transmitter for pushbutton switches

The openHAB Configuration

I added an entry in my openHAB things file.

Thing HM-PBI-4-FM  XXXXXXXXXX  "2-fach Schalter" @ "Küche"

And two entries (since I used a double-switch) for the channel in the items file.

Switch Schalter_Kueche_1  "Küche 1"  <wallswitch> (UG_Kueche) { channel="homematic:HM-PBI-4-FM:ccu2:XXXXXXXXXX:1#PRESS" }
Switch Schalter_Kueche_2  "Küche 2"  <wallswitch> (UG_Kueche) { channel="homematic:HM-PBI-4-FM:ccu2:XXXXXXXXXX:2#PRESS" }

The XXXXXXXXXX is the unique id of the device, which I'm masking here for the usual paranoia reasons.

What I wanted to do then was having a new rule in which I would respond to the PRESS events of those channels in order to control Philips Hue lights. Something along the lines of the code below, which I had done in a similar way dozens of times before:

rule "Button 1"
when
    Item Schalter_Kueche_1 changed to ON
then
    if (Licht_Essbereich.getStateAs(OnOffType) == ON)
    {
        Licht_Essbereich.sendCommand(0)
    }
    else
    {
        Licht_Essbereich.sendCommand(100)
    }
end

For some reason it wasn't working this time!

The lights just would not respons to pressing the switch. When I checked the openHAB log, I didn't see any events from the new device.

$ tail /var/log/openhab2/events.log
... 

So I went into error-diagnosis mode, checked configurations, syntax and so on and finally when into the CCU2 HomeMatic web interface looking at the actual device. To my surprise, I noticed that those events would be generated perfectly fine when I "pushed" the button through software.

Trigger button events through the CCU2

$ tail /var/log/openhab2/events.log
...
2019-05-28 20:40:00.263 [vent.ChannelTriggeredEvent] - homematic:HM-PBI-4-FM:ccu2:XXXXXXXXXX:1#PRESS triggered SHORT
...

Also my rule was working perfectly fine then. What the heck was going on here?

wuuut!

It took me quite a while to figure out what was going on there or rather how to find a workaround for the problem. It turned out that this device (probably with the newest firmware - this behavior is apparently new) will not send events any more, if it has no direct connections or programs configured in the CCU2.

So I create a dummy program in the CCU2 web interface and the problem was solved. The problem does not even have to trigger actual activity, the condition alone is apparently sufficient.

A dummy program solved the issue

You're welcome!

Apparently it was not just me having this problem. During me desperate search for the problem s root cause and a possible solution, I found this GitHub issue where someone described exactly the same scenario. Unfortunately, I was almost half a year late with my answer, but maybe it helps in the future. Or hopefully this blog post will.