Configuring homematic in OPENHAB2 using text files

Since I am convinced that paper Ui is not the right tool for me,
I am struggling to move my homematic installation to openhab2 using text files only.

  1. addon.cfg.
    It seems that “homematic” key word is not accepted with “actions” section but only in “binding section”.
    I am not sure whether this is a bug, but I have removed it from "actions"
    Already in openhab 1 I never understood why some bindings needed “binding” and “action”, so this kind of hit me again.

Also for other bindings it is not clear for me

  1. what keyword to enter where

  2. where this is also working for “compatible” 1.x binding.

  3. x.things file.
    I have entered a long list of all homematic things.
    Bridge homematic:bridge:ccu [ gatewayAddress= “192.168.1.110”]
    {
    Thing HM-LC-Sw1-Pl-2 KEQ0166471


    }

  4. in items I have teadiously edited all my 300+ items to comply with the new syntax.
    Why there has to be a syntax change, I really do not get this point. Anyway.
    e.g.
    {channel=“homematic:HM-LC-Sw1-Pl-2:ccu:KEQ0166471:1#STATE”}

Also unclear for me is the duplication of information.
Already in things file, I have assigned the type (in the example HM-Sen-EP) to the related identifyer (e.g. KEQ0166471). Now I have to do this again. Is this correct?

  1. Normally there should be also a “homematic.cfg” file.
    Here I have added:

Hostname / IP address of the Homematic CCU

host=192.168.1.110

But this file also makes no sense because already in the things file, the IP is asigned to the ccu
So this is again a dublication of the same information.

With this setup I have started openhab2 (without any rule file to reduce further confusing errors).
I seems that somehow some items are sort of working but additionally I am receiving a lot of error message that I do not understand.
(note: I am running an openhab 1 installation in parallel, may this be related?)

e.g.
2016-06-19 06:05:07.227 [ERROR] [ematic.handler.HomematicThingHandler] - Could not update thing homematic:HM-Sec-SC:ccu:KEQ0091274. Most likely because it is read-only.
java.lang.IllegalStateException: Could not update thing homematic:HM-Sec-SC:ccu:KEQ0091274. Most likely because it is read-only.
at org.eclipse.smarthome.core.thing.internal.ThingManager$1.thingUpdated(ThingManager.java:235)[102:org.eclipse.smarthome.core.thing:0.8.0.201605311814]
at org.eclipse.smarthome.core.thing.binding.BaseThingHandler.updateProperties(BaseThingHandler.java:466)[102:org.eclipse.smarthome.core.thing:0.8.0.201605311814]
at org.openhab.binding.homematic.handler.HomematicThingHandler.initialize(HomematicThingHandler.java:88)[191:org.openhab.binding.homematic:2.0.0.201606090103]
at org.eclipse.smarthome.core.thing.binding.BaseThingHandler.thingUpdated(BaseThingHandler.java:182)[102:org.eclipse.smarthome.core.thing:0.8.0.201605311814]
at org.openhab.binding.homematic.handler.HomematicBridgeHandler$1.run(HomematicBridgeHandler.java:82)[191:org.openhab.binding.homematic:2.0.0.201606090103]
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)[:1.8.0_91]
at java.util.concurrent.FutureTask.run(Unknown Source)[:1.8.0_91]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(Unknown Source)[:1.8.0_91]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)[:1.8.0_91]
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)[:1.8.0_91]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)[:1.8.0_91]
at java.lang.Thread.run(Unknown Source)[:1.8.0_91]

Does someone has an idea?

I do have the same log entries. Did you find a solution? I am still searching.

No. I am waiting for the next release of openhab and the related binding

I’m also not convinced how the new syntax and “things” are any better than the old way of configuring items. It would make more sense if you could give some kind of alias to your “Thing” so you don’t need the duplicate information

Got the same error in the log file, but it seems to work

About actions vs bindings:

binding - Binds an item to a device/part of a device. It’s state can be controlled/viewed in the UI
action - Something that can be actively done without being tied to an item, normally from a rule or script. For example sending an email or a notfication to a phone. An action is something that makes no sense to bind to an item that can be displayed in the UI.

Hello Martin, I have a homematic setup up and running with configuration files only. I’ll just leave my config here for you: https://github.com/ThomDietrich/openhab-config

To answer your questions:

  • Bindings and actions: That’s actually a good question, we should clarify that in the docs. You can find a description of actions here.

  • which keywords: You just have to follow the documentation, in your case that is this one on homematic. Please tell me which parts of that article are unclear to you!

  • change in syntax: You are right to wonder. There were serious reasons, please read about that here

  • changing your items: with a nice editor and some search&replace magic, this was done for me in a few minutes

  • compatible addons: they still behave like in openhab1.8, just check with the article on your binding there.

  • homematic.cfg: no you don’t need one and the docs don’t tell you that. things you mentioned are all in the Things definition.

  • your error message, i saw it before, but only on startup. are you sure that’s a real problem?

Good luck!

1 Like

Hi Thom, Thanks for the reply. I will take it into account on my next attempt to move to OH 2.
regards Martin

Hi Thom, All,
May I raise another important question about things, items that are autodetected by OH2 and their usage in the sitemap resp. item files:
I am quite new to OH2 but according the new documentation and manuals it was quite straight forward to setup OH 2 on my Ubuntu 16.04.1 on an Intel NUC (i3) system. I also managed to autodetect some devices like Harmonyhub, Fritzbox, Hue, and of course my many Homematic things.
The autodetetcion went okay and I see the things and items popping up in the paperUI config section.
Now here is my main question: what is the next step to do? I understood that I still have to write my own sitemap of course and items file (why). If I go to the Karaf console, I can list the things, items and links (between). I understand that the autoconfiguration has created the items and linked them to the correct homematic at al channels. So far so good. How shall I now use the variables in the items file respectively in the sitemaps file? Do I have to re-define them or even link them to the homamtic binding {} as described for OH1? I can hardly believe that.
I played around and I noticed that for the items I redefined the OH2 log says that there were removed? Why is that?
Baseline: how can I use autodetected, and existing items/things in the sitemaps and items files correctly?
Thanks a lot for your hints.

Hello Volker,
having things and items, linked to a binding / physical device is one step. The next step is to use them in the sitemap or in rules. You do not have to mess with the items configuration file (you might of course if you want to).
Again: please look at my config, there is no better way to explain.

Just start building your sitemap following this article: http://docs.openhab.org/features/sitemap.html

Please let me know if anything stayed unclear, as I am the author of this article.

Hi Thom,
the principal process is claer and unserstood. Where i am struggling with is the code to write in the sitemaps and items file.
Again it seems to me that OH2 has created the items by auto detection already that is waht I can list in the karaf console?
Confirmed?

openhab$ items
homematic_HM_WS550STH_I_bff0443d_CUX1200003_1_TEMPERATURE (Type=NumberItem, State=20.70, Label=null, Category=null)
ntp_ntp_local_dateTime (Type=DateTimeItem, State=2016-08-05T15:39:33.569+0200, Label=null, Category=null)
squeezebox_squeezeboxplayer_57DBB386_A0F9_404F_AB31_96831814D221_0004200678ef_album (Type=StringItem, State=NULL, Label=null, Category=null)

Now can I use those items in the sitemap file directly or do I have to redefine/redeclare them in the *.items file first. And what name can I use to refer to my items?
Taking the real code example above: 3 different items from homematic, ntp and squeezebox binding.
If I want to use the Temperature item (homematic), how to use it? In items file? in sitemaps file?
Number item="homematic_HM_WS550STH_I_bff0443d_CUX1200003_1_TEMPERATURE"
can you give an example with my three items above please?
Thanks
Volker.

Hello,
okay let’s see.
Here are a few items on my system:

WZ_Heizung_ActTemp (Type=NumberItem, State=22.10, Label=WZ_Heizung Ist-Temperatur, Category=temperature, Groups=[WZ, gHeatAct])
NightStartTime (Type=DateTimeItem, State=2016-08-05T23:30:00.000+0200, Label=Nacht Beginn, Category=moon, Groups=[Astro])
PresencePC (Type=SwitchItem, State=ON, Label=Zustand PC, Category=present, Groups=[Whg])

You can either use these directly in the sitemap or redefine them in items.

Sitemap:
Text item="homematic_HM_WS550STH_I_bff0443d_CUX1200003_1_TEMPERATURE" label="Current Temperature [%.1f °C]"

homematic.items
Number CurrentTemp "Sensor 5 Current Temperatur [%.1f °C]" <temperature> (BD) { channel="homematic:HM-WS550STH-I:ccu:CUX1200003:1#TEMPERATURE" }

I’m not completely sure about the parts of the item. You can find them via links in the console, e.g. BD_Heizung_ActTemp -> homematic:HG-HM-CC-RT-DN:ccu:LEQ0851363:4#ACTUAL_TEMPERATURE