← 返回
效率工具 Key 中文

Commute Traffic

Check real-time traffic conditions for a route between two locations using TomTom. Use when the user asks about traffic, commute time, best time to leave, dr...
使用 TomTom 检查两地点之间的实时交通状况,适用于询问路况、通勤时间、最佳出发时间等。
xavjer
效率工具 clawhub v0.1.0 1 版本 99875.2 Key: 需要
★ 1
Stars
📥 780
下载
💾 9
安装
1
版本
#latest

概述

Commute Traffic Checker (TomTom)

Purpose

Query real-time traffic data from TomTom for any route and provide the user with actionable travel advice. The script handles geocoding (resolving place names to coordinates) and routing (calculating travel time with live traffic) — all via the same TomTom API key.

Determining Origin and Destination

The origin and destination are not static — you must determine them from what the user tells you. Examples:

  • "How's traffic from the office to home?" → You must know (or ask) where their office and home are.
  • "Check traffic Basel to Zurich" → origin=Basel, destination=Zurich.
  • "Should I leave now?" → Use previously discussed or known origin/destination. If unknown, ask.
  • "What's the commute like?" → If you know the user's regular commute, use that. Otherwise, ask.

Rules:

  1. If both origin and destination are clear from context, proceed immediately.
  2. If only one is clear, ask for the missing one.
  3. If neither is clear and you have no prior context, ask the user for both.
  4. Accept any format: addresses, city names, landmarks, coordinates — the script geocodes automatically.

Running the Traffic Check

Execute the script with origin and destination as arguments:

python3 {baseDir}/scripts/check_traffic.py --origin "<ORIGIN>" --destination "<DESTINATION>"

Examples:

python3 {baseDir}/scripts/check_traffic.py --origin "Basel, Switzerland" --destination "Zurich, Switzerland"
python3 {baseDir}/scripts/check_traffic.py --origin "Basel SBB" --destination "Paradeplatz, Zürich"
python3 {baseDir}/scripts/check_traffic.py --origin "Aeschenplatz, Basel" --destination "ETH Zürich"

Interpreting the Output

The script returns JSON with one or more route alternatives. For each route:

FieldMeaning
----------------
travel_time_minTotal travel time with current live traffic
no_traffic_time_minTravel time with zero traffic (free-flow)
historic_traffic_time_minTypical travel time based on historical patterns
live_traffic_time_minTime including live incident data
traffic_delay_minExtra delay caused by current traffic
traffic_delay_pctDelay as percentage of free-flow time
congestionDerived level: light, moderate, or heavy
distance_kmRoute distance in kilometers
departure_time / arrival_timeDeparture and estimated arrival timestamps

Congestion classification:

  • Light: traffic delay adds less than 20% to free-flow time
  • Moderate: 20–50% above free-flow
  • Heavy: more than 50% above free-flow

Presenting Results to the User

When presenting traffic data, always include:

  1. The fastest route and its estimated travel time.
  2. Traffic delay in plain language (e.g., "Currently 8 minutes delay due to traffic on the A2, adding about 15% to the normal drive time").
  3. Comparison of alternatives if multiple routes are returned.
  4. A recommendation: whether to leave now or wait, based on congestion level.

Keep it concise and practical. The user wants to know: "How long will it take and should I go now?"

Error Handling

  • If the script returns {"status": "error"}, relay the error message to the user.
  • If TOMTOM_API_KEY is not configured, tell the user to set it up in ~/.openclaw/openclaw.json.
  • If geocoding fails (no coordinates found), the location may be too vague — ask the user to be more specific.
  • If no routes are returned, suggest trying different location descriptions.

版本历史

共 1 个版本

  • v0.1.0 当前
    2026-03-30 03:05 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

productivity

Nano Pdf

steipete
使用nano-pdf CLI通过自然语言指令编辑PDF
★ 275 📥 114,931
developer-tools

K8s Self Hosted Whisper Api

xavjer
通过运行在Kubernetes上的自托管Whisper ASR实例转录音频。当用户想要转录音频文件时使用此技能。
★ 0 📥 788
productivity

Word / DOCX

ivangdavila
创建、检查和编辑 Microsoft Word 文档及 DOCX 文件,支持样式、编号、修订记录、表格、分节符及兼容性检查等功能。
★ 440 📥 148,007