Network thing definitiion

I just added a network:device to a thing file under /etc/openhab2/things. Openhab sees the device on the network using the port I specified, all seems well. But it has no name or location. How do I define those in the things file? I tried adding them via paperui but that doesn’t work.

Contents of the things file:

network:device:icecam07 [
hostname=“192.168.1.100”,
port=554,
retry=1,
timeout=3000,
refresh_interval=60000,
use_system_ping=“false”,
dhcplisten=“false”
]

Well, the name and location are only used for display of the Thing in PaperUI. I don’t know if they are supported in .things files. I’ve never seen an example of them in a .things file.

I’m using this syntax:

Thing topic sonoffb1 “Sonoff B1” @ “Some Room” {…
The location is after the @

Here how I use it, seems to work at least with network:pingdevice

Thing network:pingdevice:ps4 "PS4" @ "Systems" [ hostname="192.168.X.XXX" ] 

Hope this helps

I totally forgot about the @ stuff. It’s been awhile since I’ve messed with .things files.

Thanks!

I use this one (without the Thing in front of):

network:pingdevice:TVSONY                   [ hostname="192.x.x.x", retry=2, timeout=5000, refreshInterval=60000 ]

For what is the @ used?

“Mylabel”@“MyLocation”

The location is used to group the things under PaperUI control.

Thanks, I got it working mostly. I’ve added a few things just to track them in openhab and they show up but until I link one of the channels it won’t get added to the location under PaperUI->Control. Is there a way to tell PaperUI which channels to use from the .things file?

All channels that are linked to an item will show under PaperUI-Control.

Is there a way to link a channel to the thing within the .things file? So far when I’ve added something using the .things file it shows up but the three channels, (Online, Latency and Last seen) are not linked and apparently the thing won’t show up in the right PaperUI group until you select one of those channels.

Links go from Channels to Items.

Channels are a property of a Thing. Things have Channels. It doesn’t make sense to link a Channel to a Thing. You can only define a link on an Item, which can be done from PaperUI or in a .items file.

PaperUI’s Control tab is only intended to be used for debugging and administration purposes. Do not go to great lengths trying to get Items/Channels to show up there. Create a sitemap or HABPanel for that.

Maybe I’m not explaining things correctly. I added a network:servicedevice using an IP camera’s IP address, defined port 554 so openhab will check that the camera’s RTSP port. I defined the camera’s location as “Cameras” so it and other cameras will show up in the same group. But when I look at that group in PaperUI the camera is not present. Going to Configuration->Things and clicking on the camera I see the three channels (Online, Latency and Last seen) but none of them are selected. If I select one, Online for instance, and check the Control->Cameras group again now the camera shows up. I’m curious is there’s a way to define the camera in the .things file and have Online already selected.

My guess is that the Things file definitions are ‘competing’ with the PaperUI database. Perhaps you should use just one or the other.

@noppes123, I had deleted them from PaperUI before adding them via the .things file.

What Group in PaperUI? If you meed on the Control tab, like we’ve said, you must link the Channel to an Item before it will show up there.

That’s because none of them are linked to an Item.

No. You have to link the Channel to an Item.