Distance between location items

Hi Guys,

i want to calculate the distance between two different Location Items. A i right that i have to use a rule like this ?


or this the definition of a location item?

in case i can use it to calc the distance what would be my two items? one would obiously the away item


I don’t understand the question or you don’t understand OH. You would define two Location Items and they will be populated somehow (Own Tracks?). In a rule you then use:

val distanceM = (myLocation1 as LocationItem).distanceFrom(myLocation2 as LocationItem)

Oh didnt know that it would be that simple. thanks a lot