freeradius setup

see here

Script to check for accounted users

# cat /opt/openhab2/checkpresence.sh

#!/bin/sh
if (/usr/bin/radwho |grep ${1} > /dev/null)
then
	echo ON
else
	echo OFF
fi

Thing

I used Paper UI for it, however I guess that is how it looks like:
Thing exec:command:c8cf96c9 [command="/opt/openhab2/checkpresence.sh user", interval=15, timeout=5]

Items

A bit nested, but this way, I can add further sensors later on into AWUser:

cat /opt/openhab2/conf/items/example.items

Group:Switch:OR(ON, OFF) gResidents "anwesende Bewohner: [%d]" 

<present> (gStatus) Group:Switch:OR(OFF, ON) AWUser "User" <man_2> (gResidents) String PresenceUserWifi "Users Wifi Zugriff" <network> (AWUser) {channel="exec:command:c8cf96c9:output"} 

Rules

cat /opt/openhab2/conf/rules/example.rules

Item AWUser changed to ON
then
	playSound("user.wav")
end
rule "all left"
when
Item gResidents changed to OFF
then
	gSwitchable.sendCommand(OFF)
	if(WindowsLi.state == OPEN || WindowRe.state == ON) {
		sendBroadcastNotification("Dachfenster ist noch offen!")
	}
end

presence detection with freeradius and openhab