← 返回
未分类

owntracks-location

Real-time phone location tracking via OwnTracks HTTP webhook receiver with named places and distance-based queries. Use when: (1) user asks "where am I?", (2) storing named locations (home, gym, work), (3) querying nearby places by distance, (4) checking location history. Requires: OwnTracks app on phone, Tailscale or LAN connectivity, Node.js 22+, better-sqlite3.
Real-time phone location tracking via OwnTracks HTTP webhook receiver with named places and distance-based queries. Use when: (1) user asks "where am I?", (2) storing named locations (home, gym, work), (3) querying nearby places by distance, (4) checking location history. Requires: OwnTracks app on phone, Tailscale or LAN connectivity, Node.js 22+, better-sqlite3.
yjkj999999
未分类 community v1.0.0 1 版本 100000 Key: 无需
★ 0
Stars
📥 21
下载
💾 0
安装
1
版本
#latest

概述

OwnTracks Location

Real-time location awareness via OwnTracks → HTTP webhook → SQLite.

Architecture

Phone (OwnTracks) → HTTP POST → server.mjs (port 18793) → SQLite + latest.json
Agent queries → places.mjs CLI or curl http://localhost:18793/latest

Setup

1. Start the receiver

node scripts/server.mjs
# Default port: 18793. Override: OWNTRACKS_PORT=9999
# Data dir override: OWNTRACKS_DATA=/path/to/data

Recommended: install as user systemd service for persistence.

mkdir -p ~/.config/systemd/user
cat << 'EOF' > ~/.config/systemd/user/owntracks-receiver.service
[Unit]
Description=OwnTracks Location Receiver
After=network.target

[Service]
Type=simple
Environment=OWNTRACKS_PORT=18793
Environment=OWNTRACKS_DATA=<SKILL_DIR>/scripts/data
ExecStart=/usr/local/bin/node <SKILL_DIR>/scripts/server.mjs
Restart=always
RestartSec=5

[Install]
WantedBy=default.target
EOF
systemctl --user daemon-reload
systemctl --user enable --now owntracks-receiver

Replace with the absolute path to this skill directory.

2. Configure OwnTracks on phone

  1. Install OwnTracks from F-Droid or Play Store
  2. Open → Menu → Preferences → Mode → HTTP
  3. URL: http://:18793/owntracks
  4. Tap 📤 on the map to send a test ping

Phone must reach the receiver (same LAN or Tailscale).

3. Verify

curl http://localhost:18793/latest
# Should return JSON with lat, lon, acc, batt, etc.

Places CLI

Named locations with haversine distance queries.

# Add a place
node scripts/places.mjs add "Home" 41.3200 1.8900 home "Olivella"
node scripts/places.mjs add "Gym" 41.2229 1.7385 gym "Aqua Sport, Vilanova"

# Where am I? (reads OwnTracks latest + finds nearest named place)
node scripts/places.mjs where

# Find nearby places from arbitrary coordinates
node scripts/places.mjs nearest 41.22 1.74 5 500

# Search by name/category/notes
node scripts/places.mjs search "gym"

# List all
node scripts/places.mjs list
node scripts/places.mjs list gym

# Remove
node scripts/places.mjs remove "Old Place"

Agent Usage

When user asks "where am I?":

curl -s http://localhost:18793/latest
node scripts/places.mjs where

When user says "this is my X" at a location:

  1. Get current coords from /latest
  2. Reverse geocode via Nominatim or web search for the business name
  3. node scripts/places.mjs add ""

Server Endpoints

MethodPathDescription
---------------------------
POST/owntracksOwnTracks webhook (expects _type: "location")
GET/latestLast known location
GET/history?limit=50Location history
GET/healthHealth check

Dependencies

  • Node.js 22+
  • better-sqlite3 (for places.mjs)
  • OwnTracks app (Android/iOS)
  • Network path from phone to receiver (Tailscale recommended)

版本历史

共 1 个版本

  • v1.0.0 从ClawHub迁移发布 当前
    2026-06-07 11:14 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

life-service

Caldav Calendar

asleep123
使用 vdirsyncer + khal 同步并查询 CalDAV 日历(iCloud、Google、Fastmail、Nextcloud 等)。适用于 Linux。
★ 244 📥 30,669
life-service

Sonoscli

steipete
控制Sonos音箱(发现/状态/播放/音量/分组)
★ 56 📥 85,207
design-media

agnes-image-gen

user_15292d5a
使用 Agnes AI 的图片生成模型生成图片,支持文生图(agnes-image-2.1-flash)和图生图(agnes-image-2.0-flash)。支持自定义 API Key,用户可使用自己的 Agnes Key。优化重点:降低
★ 1 📥 212