Skip to content

Comments

Add Traffic & Travel Time ability#101

Open
samsonadmasu wants to merge 5 commits intoopenhome-dev:devfrom
samsonadmasu:add-traffic-travel-time
Open

Add Traffic & Travel Time ability#101
samsonadmasu wants to merge 5 commits intoopenhome-dev:devfrom
samsonadmasu:add-traffic-travel-time

Conversation

@samsonadmasu
Copy link
Contributor

Voice-powered traffic and travel time checker using Google Maps Routes API.

Features:

  • Quick check: saved destination + live traffic
  • Custom route: origin + destination from voice with LLM address cleanup
  • Commute check: home↔work shortcut with time-of-day direction detection
  • Departure planner: reverse-calculate leave time for arrival target
  • Save locations: up to 20 named locations with voice confirmation
  • Traffic severity: clear/light/moderate/heavy/severe classifications
  • First-run onboarding: API key setup + home/work addresses
  • Routes API primary, Distance Matrix API fallback
  • LLM-based intent classification, address cleanup, natural voice responses
  • BYOK pattern (user provides their own Google Maps API key)

See README.md for setup instructions.

What does this Ability do?

Voice-powered traffic and travel time checker. Ask for live traffic, travel times, commute updates, departure planning, and mid-trip progress all by voice using Google Maps APIs with automatic IP-based location detection.

Suggested Trigger Words

  • traffic
  • check traffic
  • how long to get to
  • how far is
  • how long from
  • from here to
  • distance from
  • drive time
  • travel time
  • how's my commute
  • commute check
  • when should I leave
  • what time should I leave
  • save location
  • how much is left
  • how much longer
  • where am I
  • how long to drive
  • route to
  • distance to

Type

  • New community Ability
  • Improvement to existing Ability
  • Bug fix
  • Documentation update

External APIs

  • No external APIs
  • Uses external API(s): Google Maps Routes API, Google Maps Distance Matrix API, Google Maps Geocoding API, ip-api.com (free, no key needed)

Testing

  • Tested in OpenHome Live Editor
  • All exit paths tested (said "stop", "exit", etc.)
  • Error scenarios tested (API down, bad input, etc.)

Checklist

  • Files are in community/my-ability-name/
  • main.py follows SDK pattern (extends MatchingCapability, has register_capability + call)
  • README.md included with description, suggested triggers, and setup
  • resume_normal_flow() called on every exit path
  • No print() — using editor_logging_handler
  • No hardcoded API keys — using placeholders
  • No blocked imports (redis, connection_manager, user_config)
  • No asyncio.sleep() or asyncio.create_task() — using session_tasks
  • Error handling on all external calls
  • Tested in OpenHome Live Editor

Anything else?

Supports 6 modes: quick check, custom route, commute, departure planner, mid-trip status, save location. Uses IP geolocation for automatic origin detection and session tracking for follow-up queries like "how much is left?". API key provided via GOOGLE_MAPS_API_KEY environment variable or voice setup on first use.

@samsonadmasu samsonadmasu requested a review from a team as a code owner February 20, 2026 11:05
@github-actions github-actions bot added the first-contribution First-time contributor label Feb 20, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Feb 20, 2026

🔀 Branch Merge Check

PR direction: add-traffic-travel-timedev

Passedadd-traffic-travel-timedev is a valid merge direction

@github-actions github-actions bot added the community-ability Community-contributed ability label Feb 20, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Feb 20, 2026

✅ Ability Validation Passed

📋 Validating: community/traffic-travel-time
  ✅ All checks passed!

@github-actions
Copy link
Contributor

github-actions bot commented Feb 20, 2026

🔍 Lint Results

🔧 Auto-formatted

Some files were automatically cleaned and formatted with autoflake + autopep8 and committed.

  • Unused imports removed (autoflake)
  • Unused variables removed (autoflake)
  • PEP8 formatting applied (autopep8)

__init__.py — Empty as expected

Files linted: community/traffic-travel-time/main.py

✅ Flake8 — Passed

✅ All checks passed!

@Rizwan-095
Copy link
Contributor

Kindly look at the validate_ability.py file in root directory of this repo again there are few changes so build your ability according to that.
Also look at these docs.
https://docs.openhome.com/how_to_build_an_ability

@samsonadmasu samsonadmasu force-pushed the add-traffic-travel-time branch from 4a83153 to 6a8a046 Compare February 21, 2026 05:52
Voice-powered traffic and travel time checker using Google Maps Routes API.

Features:
- Quick check: saved destination + live traffic
- Custom route: origin + destination from voice with LLM address cleanup
- Commute check: home↔work shortcut with time-of-day direction detection
- Departure planner: reverse-calculate leave time for arrival target
- Save locations: up to 20 named locations with voice confirmation
- Traffic severity: clear/light/moderate/heavy/severe classifications
- First-run onboarding: API key setup + home/work addresses
- Routes API primary, Distance Matrix API fallback
- LLM-based intent classification, address cleanup, natural voice responses
- BYOK pattern (user provides their own Google Maps API key)

See README.md for setup instructions.
@samsonadmasu samsonadmasu force-pushed the add-traffic-travel-time branch from 1e7fafe to d3621fc Compare February 21, 2026 05:55
@samsonadmasu
Copy link
Contributor Author

I fixed the issue

@Rizwan-095
Copy link
Contributor

Team will test and provide feedback accordingly.

@codermohsin
Copy link
Contributor

Hey
I ran your abiliy code but it give this error : "Modifying or using 'register_capability(cls)' is not allowed (os import found outside allowed block) (File: .temp/2766/github_abilities/main.py, Line: 2)"

image

kindly check this

@samsonadmasu
Copy link
Contributor Author

can you check now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community-ability Community-contributed ability first-contribution First-time contributor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants