[SOLVED] OH3, i need help with gps logger rule

Old system: OH 2.5 win10
New system: openhabian 3
*the rule works on the old system no problems at all.

The rule is location via APP gps logger on Android, I see on the map in OH that the phone moves but ITEM does not change from ON to OFF and stays stuck on ON, I checked via Fake GPS and through this the ITEM does change to OFF when I choose a fake location.

val Number DistanceArrived = 150
val Number DistanceLeft = 150
val Number AccuracyThreshold = 200

/* sapir at home */
rule "sapir at home"
Item distanceHomesapir received update
	var Number distance = (distanceHomesapir.state as QuantityType<Number>).doubleValue
	var Number accuracy = (accuracysapir.state as QuantityType<Number>).doubleValue
if (accuracy < AccuracyThreshold) { // do only something if the accuracy is high enough
	if ((distance < DistanceArrived) && (sapirAtHome.state == OFF)) {
	else if ((sapirAtHome.state == ON) && (distance > DistanceLeft)) {


I guess you’ll need to log some values out, to understand what is happening.

I solved this, the item distanceHomesapir
Report in km and not in meters
So I added [% d m] to item via Edit Item Metadata: stateDescription Pattern:

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.