I am having an issue with presence detection where my item gets set to ON then immediately “something” is setting it to “OFF” again.
I am using the script from this thread:
https://community.openhab.org/t/presence-detection-by-reading-leases-on-dhcp-server-it-works/38837
since my DHCP server on the network is not my router or even the rPI I am running OpenHabian on. I used to work, but then I tried to get presence detection by ‘networkping’ but that wasn’t working (it wouldn’t seem to use arping) so I switched things back and now this isn’t working anymore.
My Thing for my phone (added via PaperUI) is this:
Phone_Alan_IP
In my ‘default.items’ file, I have:
/* Presence */
Location HomeLocation "Alan & Vicki"
Switch Presence "Someone is Present" <present> // master presence switch, represents to the rest of OH where someone is home
Group:Switch:AND(OFF,ON) Presence_Sensors <present> // all presence sensors belong to this group
Switch Presence_Timer { expire="5m,command=OFF" } // anti-flapping timer
// Presence: Alan
Group:Switch:AND(OFF,ON) Presence_Alan "Alan is present [%s]" <present> (Presence_Sensors)
Switch Presence_Alan_Phone_IP "Alan @ Home (Phone)" <network> (Presence_Alan)
From the thread above, the item the script from the thread above is 'Presence_Alan_Phone_IP. In the script, the command that is setting the item switch to ON is:
curl -X POST -d "ON" -H "Content-Type: text/plain" http://$OH_user:$OH_pass@$OH_IP:$OH_port/rest/items/$person
If I run the command manually (replacing the variables with the actual values), I can see in the Log Viewer that the “Prresence_Alan_Phone_IP” switch gets set to ON, but then almost immediately gets set to OFF (but there is no indication as to what actually sets it to OFF)
Any insight to what could be going on is appreciated.