Status of things

When looking at Things in the Paper UI (Configuration > Things) or in the karaf console (smarthome:things) the status of each Thing is reported as ONLINE or OFFLINE (or any of the other states, I guess).

Is there any way to map this information to an item in openHAB? Finding a consistent way to determine whether a certain thing (device) is available (or not) is something that I really would like to have in my openHAB setup.

This is not possible right now, but there is an issue for it

Thanks for the pointer! Sound promising… although to me it would be more natural to be able to map status of a Thing to items just like other channels - rather than having a “function API” as seems to be the thinking from the issue description.

If it will be accessible on rules, you can use the information to set item states.
What else would you need?

Yes, I understand that I can use it to set items.

My thinking was that since Things provide Channels that can be mapped to Items, why not simply let the status information be Channels as well and keep with a proven pattern?

Yes, I think it should be possible. Some of bindings do that already. For example SamsungTV binding updates POWER-button channel to OFF/ON together with thing’s state OFFLINE/ONLINE. I doubt only whether ON/OFF enough is, because offline state of a thing can have different reasons. Thing can be not powered or service/binding is disabled.