Network Health Binding - not working?

Hi, trying to get a Presence switch in based on the examples provided.

I placed this in my items file:
Group gMobiles
Switch Presence
Switch phone1 (gMobiles) {nh=“192.168.1.173”}

I understand that NH should trigger anyway without the need for rule configuration, so I’ve skipped the rules bit.
Now, on my sitemap I’ve put the phone1 switch to see if it’s doing anything… and it’s not, even though I can ping that IP address from my terminal.

in openhab.log I can see the following firing every 1 second, so something’s happening
2016-01-24 23:37:05.582 [INFO ] [b.s.i.n.typicals.RefreshHEALTY] - sendHEALTY_REQUESTframe

Unfortunately, nothing in events.log happens any ideas?

You already installed the binding?

The RefreshHEALTY class belongs to the Souliss binding and has nothin to do with the NetworkHealth binding.

The code you provided should show a switch item in your sitemap. The switch’s state should indicate if the device is reachable or not. Do you see the switch?

yup - binding is in the directory and I restarted a few times.

From my understanding the .cfg lines are optional - but just for good measure I put them in there anyway with the default values - understand that this means the refresh is every minute.

I then restarted the OH service again and waited until everything loaded. The rule works fine - the problem is that for some reason NH isn’t updating the status of phone1. I tried putting the switch in the off position, waiting a few minutes (nothing happened). and vice versa - putting the switch on and disconnecting from wi-fi.

########################### NetworkHealth Binding #####################################

Default timeout in milliseconds if none is specified in binding configuration

(optional, default to 5000)

networkhealth:timeout=5000

refresh interval in milliseconds (optional, default to 60000)

networkhealth:refresh=60000

Cache the state for n minutes so only changes are posted (optional, defaults to 0 = disabled)

Example: if period is 60, once per hour the online states are posted to the event bus;

changes are always and immediately posted to the event bus.

The recommended value is 60 minutes.

networkhealth:cachePeriod=60

Ok, that’s better then I thought. :slightly_smiling:

Did you see the Quirks chapter on the binding page? Are you running OH on Win oder Lin?

It’s on a Pi.

and logging in, I can see that icmp packets are going through

pi@raspberrypi /opt/openhab/logs $ ping 192.168.1.173
PING 192.168.1.173 (192.168.1.173) 56(84) bytes of data.
64 bytes from 192.168.1.173: icmp_req=1 ttl=64 time=45.0 ms
64 bytes from 192.168.1.173: icmp_req=2 ttl=64 time=271 ms

Seems to be a permission problem. Try if user openhab can ping and read this thread.

Hope this will help.

hmm… seems to be more complex than that.

I’m actually running it as pi (which incidentally is the same user I’m using to perform an icmp ping through console.
I’ve got this on my openhab auto-start file (which is chowned on all the files/folders in OH and addons)
RUN_AS=pi