Configuring Homematic door sensor

I want to add ma first Homematic door sensor to OH via files.
But it doesn’t work:


    Bridge homematic:bridge:ccu [ gatewayAddress="" ]
        Thing HM-Sec-SCo OEQ0440924 "Terrassentür" @ "Wohnzimmer"


Switch TerrassenTuerITM   "Terrassentür"    { channel="homematic:HM-Sec-SCo:ccu:OEQ0440924:1#STATE" }

The ID I got from autodiscover after I added the thing.

In the sitemap the value is not displayed…
If I access the item via REST the state seems to be always NULL, no matter what the sensor shows in the CCU2 GUI.

What did I do wrong in the configuration?


I declared my door sensor as type “Contact” in the .items file. The rest is similar to your configuration.
How did you configure the sitemap entry for the sensor?

1 Like

I agree with Lars. Provided the channel you are using in your items file is correct, it will only display if you have configured the item as a contact and your sitemap looks like:

Text item=Haustuersensor_1_State					label="Haustür [MAP(]"		icon="frontdoor"


MAP translates the CLOSED to “ZU”. Important is that you configure as Text item and use [%s]. By the way the icon frontdoor changes to open as well when the door opens.

btw, you could configure the item directly from Paper UI, is much easier.


1 Like

thanks, I tried that, but the value oft the item (state) ist still NULL…

Do you see any lines in the events.log if the door sensor opens/closes? Maybe the communication between the CCU and OH is blocked?

[quote=“larshendrikkorte, post:5, topic:37243, full:true”]
Do you see any lines in the events.log if the door sensor opens/closes? [/quote]

No, nothing… But I found this:
2017-12-14 01:40:05.058 [INFO ] [ommunicator.AbstractHomematicGateway] - No event since 310 seconds from gateway 'ccu', restarting RPC server

Maybe the communication between the CCU and OH is blocked?

Looks that way… What can I do?
Is it possible that it is an authentification issue?


Do you have other Homematic devices in your OH or is the door sensor the only one?
Have you opened the firewall on the CCU for OH? You have to allow connections from your OH server to the CCU. In the CCU WebUI go to “Einstellungen” -> “Systemsteuerung” -> “Firewall konfigurieren” and enter the appropriate values.

At the moment it is the only one… I want to test one device before I buy more…

Thanks didn’t know that… I added the OH IP to the Firewall settings… But still the same problem…

Does the CCU have an API URL that is accesable via Browser so I could test it?

Sorry, I forgot to mention that you also have to change the drop down fields for at least “HomeMatic XML-RPC API” to “Vollzugriff” to make it work. That’s the API where OH communicates with the CCU. HTH.

I kind of thought so myself… But it still doen’t work…

Any ideas?

For what do I need this Gateway Thing? Could that be the cause?

Did you check the bridge configuration?

The Gateway-Extras is a container for CCU variables & scripts, it’s not neccessary for connecting a contact. The bridge on the other hand is.

Since you are using a CCU and not Homegear on openHABian, is it possible that Homegear is still running and occupying the ports?

Hmmmm there is only the Gateway address visible (It’s logic becaue I didn’t configured anything else in the things file)… Is that correct or do I have to enter callback address and the ports also (how do I do this via things file?)

thx & regards

Like that:

Bridge homematic:bridge:homegear "Homegear Bridge" @ "AZ" [ gatewayAddress="", callbackHost="", binCallbackPort=9125, xmlCallbackPort=9126 ]

Cool… Thanks… Now the REST API shows the correct value, but on the sitemap there seems something wrong… it doesn’t show the value Just the Label


Contact TerrassenTuerITM "Terrassentür"    { channel="homematic:HM-Sec-SCo:ccu:OEQ0440924:1#STATE" }


Text item=TerrassenTuerITM icon="door"

Easy. Because you didn’t define the value at your item.

Contact TerrassenTuerITM "Terrassentür [%s]"    { channel="homematic:HM-Sec-SCo:ccu:OEQ0440924:1#STATE" }

or even

Contact TerrassenTuerITM "Terrassentür [MAP(]"    { channel="homematic:HM-Sec-SCo:ccu:OEQ0440924:1#STATE" }

with that “transform/”


Do you have a download link for your icon set? Looks nice & clean.

Thanks… it works now…
But actually I don’t understand why I addiationally have to add the value… On my temperature or power sensors the value is displayed right away…

Do you have a download link for your icon set? Looks nice & clean.

Yeah it’s a very common icon set from Google (or I guess based on that and extended by the commnunity):

Here is the Github repository for seperate SVGs to directly import to OH folder:

speaking of… I had some issues there…

  • Is it possible to colorize SVG icons?
  • the OH default icons overwrite the custom icons if they are named the same (e.g. door.svg) how can I avoid that?
  • can I use icons for buttons or states (like the OPEN/CLOSE state of the door)?


It’s not additionally. Here is the definition, straight from the docs:

itemtype itemname "labeltext [stateformat]" <iconname> (group1, group2, ...) ["tag1", "tag2", ...] {bindingconfig}