Goal: Connect to Toyota’s connected services API to retrieve vehicle parameters (odometer, fuel, locks) inside Home Assistant.
Why CLI Scripts? (Agentic AI Observability)
Before jumping into the script code, it is important to understand why command-line scripts are extremely useful for modern smart homes. Beyond convenience for terminal users, these CLI scripts act as a programmatic interface (API bridge) for agentic AI assistants like Antigravity (agy).
By exposing Home Assistant states through standard shell scripts, an AI agent running in your workspace can query, check, and verify live IoT metrics or network states autonomously. This enables the agent to check if the network is healthy, read environment levels, or verify configurations without having to scrape web-based dashboards or utilize complex browser interfaces. It bridges human developer terminal workflows with agentic automation.
Step-by-Step Configuration
1. Add Toyota Integration in HACS
- Open Home Assistant UI and navigate to HACS.
- Click the 3 dots in the top-right corner -> Custom Repositories.
- Paste the repository URL:
https://github.com/DvdGiessen/homeassistant-toyotaand select Integration. - Download the integration and restart Home Assistant.
2. Authenticate the Car Portal
- Navigate to Settings -> Devices & Services -> Add Integration.
- Search for and click Toyota.
- Enter your MyToyota portal username (email address) and password.
- Select the region Europe and click submit.
3. Discovered Car Telemetry
All vehicle details and endpoints will automatically load. Key stats can now be queried directly from the terminal or dashboard using the VIN identifier (e.g., JTPABAAA70R000000):
$ /home/gvoina/scripts/get_ha_sensor.sh sensor.jtpabaaa70r000000_odometer
Odometer: 3004.0 km
$ /home/gvoina/scripts/get_ha_sensor.sh sensor.jtpabaaa70r000000_fuel_level
Fuel level: 100 %
