Looked up the item receiving the status update from the script using Openhab Rest API - http://openhabianpi:8080/doc/index.html#!/items/getPlainItemState
Seems like we have found a clue on what’s going on we my failing presence detection.
This is the response:
Response Body
Smartphone 10.0.0.110 is not present
Response Code
200
Response Headers
{
"content-length": "36",
"server": "Jetty(9.3.22.v20171030)",
"content-type": "text/plain"
}
wtf? I was expecting a ON or OFF value here… If this is the string output i clearly cannot use this item in the if-statement in my rule:
if(RunarMobil.state == "OFF")
I’m wondering if im supposed to use a second item (the device item) in this part of the rule?
Thank you for trying to help me.
No. As i stated i was following the tutorial in the very first post by @Maurits28. If you think you see the problem i need a guiding hand here.
Edit: Last Q - No i was not aware of that. please provide a link where i can read me up on the topic?
You need to be on 2.2 release. See the readme for the Network binding. All the stuff talking about arping is basically talking about the binding doing what this script does.
Ah!!! Totally missed this. I know i’ve read this before and have actually been taking advantage of this without even realizing that i was. I’m on Openhabian 1.4 and i assume this “arping service” was included in the bundle. As a novice on Raspberry Pi and its operating system i find myself lost all the time in the jungle of different solutions and software-versions. This was one of these moments. Spent several hours trying to get this to work…
If i understand this correct i need to write me a rule that take into consideration “flapping” to avoid unintended action triggered and maybee use the DHCP request from the Android phone as a “reentry trigger” in my presence rule.
Thanx for helping me out Rich !
One last quick question. Im planning to follow this example: Generic Presence Detection
I’m not barking up the wrong tree here again?
It seems clean and simple so i think i’ll be able to work that solution out on my own.
I’ve used that for years now and it still works fine. It is what I would recommend for flapping and in case you ever decide to add more sensors for each person.
I run in Docker and don’t want to run OH as root so I don’t use the arping feature. I have an external python script that executes a version of the above script for me. Others have reported great success with the arping feature of the Network binding.
Thanks Rich!
The network binding works now after some configuration. I extended the time to 90000ms before the device is stated as offline. Seems to be working since then. Before the iPhone presence went offline/online around every minute.