Device presence

Hello all,
I’m looking to create an item to monitor if a specific device is on the network. I have an RTSP camera which is not always on. What would be the best way to monitor and record the status of the camera (online/offline) and track the last time it was on?

I’m running OpenHAB on a Raspberry Pi 2 and it’s running fine as I don’t have a lot on it but I don’t want to put too much load by doing this.

Thanks in advance

Try the networkhealth binding to have OH ping it at defineable intervals.

The Network binding might be a better choice on OH 2. But both will work but Network may be a bit more comfortable to use if you are mainly familiar with 2.x versoon bindings.

Sorry yes the ‘network’ binding is the one I meant, too.

Thank you very much guys.

I’ve installed the binding and configured the following:

A Thing
network:pingdevice:ipcam[ hostname=“”, retry=1, timeout=5000, refreshInterval=60000]

An Item
Switch IPCam “IP Camera” { channel=“network:pingdevice:ipcam:online” }

On my Sitemap I have
Text item=IPCam

All I get is the camera icon on the sitemap. How can I get it to display “online” or “offline”

Set the icon to what you want it to be. You can also print the item’s state in the label. See the Item docs for details.

Thanks for the tip. I’ve managed to get it to work now. However, I’ve had to use network:device:ipcam instead of network:pingdevice:ipcam and added to the sitemap

Text item=IPCam label="[%s]"

1 Like