Computer is offline in network binding

Hi everyone,
I have one computer in my network which I want to track the status with the network binding:

Thing network:pingdevice:kodi “Kodi” [ hostname=“”, macAddress=“xx:xx:xx:xx:2f:1b” ]

Switch KodiOnline “Online” {channel=“network:pingdevice:kodi:online”}
Number:Time KodiLatency “Pingzeit” {channel=“network:pingdevice:kodi:latency”}
DateTime KodiLastseen “Zuletzt gesehen” {channel=“network:pingdevice:kodi:lastseen”}

But this KodiOnline item is always shown in Openhab as OFF. The other values remain as UNDEF

I am using openHAB 3.1.0.M3 running on Ubuntu 20.04.2 LTS

The computer I want to track is running on Windows 10.

Am I doing something wrong?

The windows 10 box might be blocking the ping, try pinging the machine manually from the command line of the OpenHAB host

1 Like

This is working without a problem

root@openhab-ansible:/var/log/openhab# ping
PING ( 56(84) bytes of data.
64 bytes from icmp_seq=1 ttl=128 time=0.218 ms
64 bytes from icmp_seq=2 ttl=128 time=0.311 ms
64 bytes from icmp_seq=3 ttl=128 time=0.458 ms
64 bytes from icmp_seq=4 ttl=128 time=0.384 ms
64 bytes from icmp_seq=5 ttl=128 time=0.299 ms
64 bytes from icmp_seq=6 ttl=128 time=0.460 ms
64 bytes from icmp_seq=7 ttl=128 time=0.398 ms
64 bytes from icmp_seq=8 ttl=128 time=0.250 ms

Maybe worth double checking that the openhab account is able to do the same:

sudo -u openhab ping

Any errors show up in your logs with your configuration in the OP?

You are right. The user is not permitted:

root@openhab-ansible:~# sudo -u openhab ping
ping: socket: Operation not permitted

I am running openhab in a Proxmox Container. I guess I have to change the permission in proxmox then.

Ok I could fix this with the following command

$ sudo setcap cap_net_raw+p /bin/ping

Ping with user openhab is now working:

root@openhab-ansible:~# sudo -u openhab ping
PING ( 56(84) bytes of data.
64 bytes from icmp_seq=1 ttl=128 time=0.233 ms
64 bytes from icmp_seq=2 ttl=128 time=0.442 ms

But the item is still shown as OFF

I changed the log level to trace:
log:set TRACE

But in the log I only see the following:
2021-04-08 09:53:45.063 [TRACE] [] - Perform java ping presence detection for

Interesting - I am also using OH3 in an LXC container on Proxmox, on an Ubuntu 20.04 base, same as you.

How did you install openHAB? I followed the apt based install guide. I didn’t have to mess around with any permissions at all - ping worked immediately.

It may be worth stopping and starting the container again, to make sure all openHAB configurations are properly registered.


After a restart it seems to be working.

2021-04-08 12:48:29.583 [TRACE] [] - Perform native ping presence detection for

2021-04-08 12:48:29.589 [DEBUG] [network.internal.utils.LatencyParser] - Parsing latency from input 64 bytes from icmp_seq=1 ttl=128 time=0.238 ms

2021-04-08 12:48:29.590 [DEBUG] [] - Getting latency from ping result PingResult{success=true, responseTimeInMS=0.238, executionTimeInMS=4.0} using latency mode false

Thank you for your help

1 Like