Documentation of channel config in items-file

Hi there,

I understood that it is still preferred to store the configuration of openhab2 in the textual config files.

I did not find any info about how to specify the link of a channel to an item in the items-file. I saw some examples like this, which works fine.

DateTime Sunrise_Time  "Sonnenaufgang [%1$tH:%1$tM]" <sun> (Astronomie)   { channel="astro:sun:home:rise#start" }

However, another channel like this does not work for me

Switch Sunrise_Event    <switch> (Astronomie) {channel="astro:sun:home:rise#start"}

I was using such event in openhab1 for triggering rules. However, while the Sunrise_Time gets properly set, the Sunrise_Event is not triggered anymore in openhab2.

Another example as I just entered to ZWave:

Number Verbrauch_Strom_Switch1    {channel="zwave:aeon_zw096_00_000:xxx:node5:meter_current"}
Switch Switch1                    {channel="zwave:aeon_zw096_00_000:xxx:node5:switch_binary"}

The Switch works fine while the Number does not return anything.

I wonder if the configuration is enough.

  • The Habmin has an additional field called “category”. Where can I set that in the items file? what is it used for?
  • Other binding-strings in the items file have a ‘<’ or a ‘>’ sign to indicate the direction of data. Is this not required for channels (it gives syntax errors)?
  • The ESH Docu looks like it does distinguish between reading and writing to channels. So do I need to specify that in the item?
  • The wiki seems only to cover openhab1 files as it does not mention channels. Is the wiki intended to also cover openhab2 features? Or is there another wiki for openhab2?
  • In the ESH Docu I did not find nothing about the textual configs at all. Did I miss it?

Cheers,
Hauke

2 Likes

Hmm… nobody knows how to configure channels in the items-config-file? @Kai, is that a missing piece of documentation?
I’ve read the surprisingly short Xtext grammar, which does not give any clue, because the binding strings are just strings.

Not sure what exactly you are missing, but every single binding documentation page shows how to configure channels in an item file, see e.g. here. Does this help?

No thats not the way a new oh2 user will understand most of the stuff.
And for Zwave a lot of stuff has changed thats not written anywhere. I will think about that and try to answer some stuff.

For the question about values not coming…
See if it’s in the log. That it is not visible on the UI can be related to

That issue is still existing. And I see it on many Installations of friends

Maybe my problems are too concrete to ask a too generic question :wink:

How do I map a channel that returns a DateTime to a switch item?

Something like this was perfectly possible in OH1. Is it not ok in OH2?

The problems of my Z-Wave devices might be individual issues with the configuration there. The main problem could be that I’m trying to use OH2 with HabMin2 and Zwave-Binding 2.0, which are all in quite beta stage and not fully documented. So I hook into another post in order to come closer to my Z-Wave issues. As a total Z-Wave noob I might miss some fundamentals there.

How do I map a channel that returns a DateTime to a switch item?

You don’t, because it really does not make much sense. Instead, we need something like a “triggering channel”, see https://github.com/openhab/openhab2-addons/issues/310, but this is not yet implemented.