List all unlinked Things or Items?

I just spent an hour debugging something only to find I just forgot to link my Item to a Thing.

Is there any way to:

  1. List all Items that are not linked to any Thing?
  2. List all Things that are not linked to any Item?

I let OH2 discover Things, I create Items (without links) in files, then I link them to hardcoded Items in Paper UI - this seems to work best for me. Is this bad?

It’s ok, but there is a better way: Define the link to the appropriate channel, directly within your *.items file.

Examples:
Syntax: <Item_Type> <Item_Name> "<Item_Desc> <icon> (Group) {channel="<channel_name>"}

Number	WDim01_Meter		"Meter Power [%.2f W]"		<energy>	(gZWave)	{channel="zwave:device:ZW090C:node4:meter_watts"}

String		Sun_Phase	"Sun Phase [%s]"		(gAstro)	{channel="astro:sun:local:phase#name"}

Switch	Angelos_S6_PRES	"Angelos S6 Presence"	<present>	(gUnifi)	{channel="unifi:client:Unifi_HomeR:Angelos_S6:online"}

You can copy the channel_name from PaperUI (in the Thing configuration). This works for most 2.x Bindings.

From what I know: No
What could help you is the list of existing Links from the Karaf console with "smarthome:links list".

1 Like