I run openhab on a raspberry pi b2. Installed the network binding. scanned for my mobile phone, has a fixed ipadress. added the thing through paperui. works as expected.
When I check properties the thing, it tells me ‘uses_arpings No’ and ‘Uses dhcp listen NO’. I created a network.cfg in the services folder
Ok, i found some more information in another topic.
I created the following device in custom.things file:
Thing network:pingdevice:OnePlus5t [ hostname=“10.0.0.30”, uses_dhcp_listen=1, uses_arp_pings=1, retry=30, timeout=5000, refreshInterval=30000 ]
but still:
uses_dhcp_listen
no
dhcp_state
Running normally
presence_detection_type
arp_state
IPUTILS_ARPING
uses_ios_wakeup
On
icmp_state
IPUTILS_LINUX_PING
uses_arp_pings
no
I can see some change though, ios_wakeup is now on while I have not specified it. Cannot turn it of. I use android so I just want the arping and the dhcp_listen on yes.
I still have the same output, uses_arp_ping no. But the presence detection is working as intended, it is fast an reliable so for now this is just fine. I will look into it further when I have a better understanding of OpenHab. There is so much cool stuff to look into so for now I will park this and return to it later. Thanks for the help so far.
I’m not sure why the output is no, maybe try stopping OH, cleaning the cache and restarting. Or, as you mentioned, its working so not a big deal what the output is.
I have a rule that checks when I’m present and starts a timer (20 min) when I’m away. After the 20 min, if I’m still away, other rules are used to turn stuff like lights off. If during the 20 min timer period my presents is detected the timer stops and gets reset. This prevents turning stuff off if I leave the network area for a short time e.g. walk over to the neighbors for a few minutes. If your interested let me know, I can share what I have and you can tweak it to fit your needs.
Now that arping is working, please mark the post solved by clicking the square box (lower right corner) on the post that provided the solution. Also add [Solved] to the start of the title as well.
The same thing have bogged my mind, so some time ago I checked the source code from the binding. The uses_arp_pings, uses_ios_wakeup and uses_dhcp_listen are all defined in the ThingType xml-file, but in the binding code these properties are never used or updated, instead the presence_detection_type is updated according to the discovery methods that finds the device in the network. Probably the developer changed the code, but haven’t changed the ThingType xml accordingly.
Someone with more info is very welcome to correct me if I misread the code
Cool. Presence_detection_type was updated indeed and stated ‘Arp_Pings’. That’s why is was fine with it. Cool to see that it is fixed now. Thanks for the help anyway!
I found a little problem, not verified with latest snapshot but exist in snapshot 1443
Not on every time the binding reloads the network.cfg file on changes. Only a bundle:stop (binding number) and bundle:start (binding number) will force a reload of network.cfg file
Could you please open an Issue for this? I have never changed the values during runtime. I can imagine that binding modifications during runtime are not propagated to the Things.