I have setup the GPS binding just like in the tutorial using ontracks. It would appear that everything is working but the region settings. I have tried several variations but I cant seem to get either the distance from home or atHome working. No matter what I try I get a message that the item does not exist. The docs dont really explain the channels part of the things file.
Things
//tracker definition with extra distance channel
Thing gpstracker:tracker:KM "Kirk tracker" [trackerId="KM"] {
Channels:
Type regionDistance : homeDistance "Distance from Home" [
regionName="Home",
regionCenterLocation="44.7736825,-46.6935502",
regionRadius=100,
accuracyThreshold=30
]
}
Items:
//items for basic channels
Location locationKM "Location" {channel="gpstracker:tracker:KM:lastLocation"}
DateTime lastSeenKM "Last seen" {channel="gpstracker:tracker:KM:lastReport"}
Number batteryKM "Battery level" {channel="gpstracker:tracker:KM:batteryLevel"}
Number:Length accuracyKM "GPS Accuracy [%d m]" {channel="gpstracker:tracker:KM:gpsAccuracy"}
//linking switch item to regionTrigger channel. assuming the Home distance channel is defined in the binding config (see above)
Switch atHomeKM "Home presence" {channel="gpstracker:tracker:KM:regionTrigger" [profile="gpstracker:trigger-geofence", regionName="Home"]}
//another switch for work region. assuming the OTWork is defined in OwnTracks application (no distance channel is needed like for Home)
Switch atWorkKM "Work presence" {channel="gpstracker:tracker:KM:regionTrigger" [profile="gpstracker:trigger-geofence", regionName="Work"]
}
SItemap:
sitemap gpstracker label="GPSTracker Binding" {
Text item=homeDistance
Switch item=atWorkKM
Switch item=atHomeKM
Text item=lastSeenKM
Text item=batteryKM
Text item=accuracyKM
Mapview item=locationKM height=4
}