A comprehensive Home Assistant integration for monitoring Israeli public transportation in real-time. Track buses, trains, and light rail with live arrival times and get notified when your ride is approaching.
- π Real-time Bus Tracking - Get live arrival times for Israeli buses
- π Train Route Support - Monitor train departures between stations
- π Light Rail (Kala) Support - Track Jerusalem and Tel Aviv light rail
- π― Multi-Station Support - Monitor multiple stations and routes simultaneously
- π Automatic Updates - Smart polling with dynamic update intervals
- π Bilingual - Full support for Hebrew and English
- π Rich Sensor Data - Detailed attributes including direction, real-time status, and upcoming arrivals
- βοΈ Easy Configuration - User-friendly UI configuration flow for all transport types
- π Automation Ready - Perfect for creating arrival notifications and automations
- π οΈ Custom Services - Force refresh and dynamically update tracked lines
- π Long-term Statistics - Sensor data compatible with Home Assistant history and statistics
- β‘ Device Class Support - Proper duration device class for time-based sensors
- Open HACS in your Home Assistant instance
- Click on "Integrations"
- Click the three dots in the top right corner
- Select "Custom repositories"
- Add this repository URL:
https://github.com/ziv-daniel/hass-israel-transportation-integration - Select category: "Integration"
- Click "Add"
- Find "Israel Transportation" in the integrations list
- Click "Download"
- Restart Home Assistant
- Download the latest release from the releases page
- Extract the
custom_components/israel_transportationfolder - Copy it to your Home Assistant
custom_componentsdirectory - Restart Home Assistant
- Go to Settings β Devices & Services
- Click Add Integration
- Search for Israel Transportation
- Follow the configuration steps:
- Step 1: Select transport type (Bus, Train, or Light Rail)
- For Buses/Light Rail:
- Step 2: Enter station number (e.g.,
24068) - Step 3: Enter line numbers separated by commas (e.g.,
249, 40, 605)
- Step 2: Enter station number (e.g.,
- For Trains:
- Step 2: Enter origin station (e.g.,
3600for Tel Aviv Center) - Step 2: Enter destination station (e.g.,
2800for Haifa Center)
- Step 2: Enter origin station (e.g.,
- rail.co.il - Israel Railways official site
Common train station IDs:
- Tel Aviv - Savidor Center:
3600 - Tel Aviv - HaShalom:
3700 - Jerusalem - Yitzhak Navon:
680 - Haifa Center - HaShmona:
2800 - Beer Sheva Center:
5800 - Ben Gurion Airport:
8600
After setup, you can modify settings by clicking Configure on the integration:
- Bus Lines: Comma-separated list of bus line numbers to track
- Update Interval: How often to fetch data (15-600 seconds, default: 30)
- Maximum Arrivals: Number of upcoming arrivals to track per line (1-10, default: 3)
The integration creates one sensor per line:
Entity ID: sensor.{type}_station_{station_name}_line_{line_number}
Example:
- Bus:
sensor.bus_station_azrieli_center_line_249 - Light Rail:
sensor.light_rail_station_central_station_line_1
Shows minutes until the next arrival:
5- Arriving in 5 minutesArrived- Currently at the stationNo data- No upcoming arrivalsUnavailable- API connection error
line_number: "249"
station_id: "24068"
station_name: "Azrieli Center"
next_arrival: "2025-12-25T14:35:00+02:00"
real_time: true
direction: "Tel Aviv - Jerusalem"
upcoming_arrivals:
- arrival_time: "2025-12-25T14:35:00+02:00"
minutes_until: 5
is_realtime: true
direction: "Tel Aviv - Jerusalem"One sensor per route:
Entity ID: sensor.train_route_{from}_{to}_next_train
Example: sensor.train_route_tel_aviv_center_haifa_center_next_train
Shows minutes until next departure:
15- Departing in 15 minutesDeparting- Train is departing nowNo data- No upcoming trains
from_station: "3600"
to_station: "2800"
from_station_name: "Tel Aviv - Savidor Center"
to_station_name: "Haifa Center - HaShmona"
next_arrival: "2025-12-25T14:45:00+02:00"
duration_minutes: 65
real_time: true
direction: "Haifa Center - HaShmona"
upcoming_arrivals:
- arrival_time: "2025-12-25T14:45:00+02:00"
minutes_until: 15
duration_minutes: 65
is_realtime: trueDisplay public transport times using the built-in entities card:
type: entities
title: Public Transport
entities:
- entity: sensor.bus_station_azrieli_center_line_249
name: Bus 249
- entity: sensor.light_rail_station_central_station_line_1
name: Light Rail 1
- entity: sensor.train_route_tel_aviv_center_haifa_center_next_train
name: Train to HaifaIcons are automatically set based on transport type:
- π Bus:
mdi:bus - π Light Rail:
mdi:tram - π Train:
mdi:train
Get notified when your bus is 10 minutes away:
automation:
- alias: "Bus 249 Approaching"
trigger:
- platform: numeric_state
entity_id: sensor.bus_station_azrieli_center_line_249
below: 10
condition:
- condition: numeric_state
entity_id: sensor.bus_station_azrieli_center_line_249
above: 0
action:
- service: notify.mobile_app_your_phone
data:
title: "Bus 249 Approaching"
message: "Bus arrives in {{ states('sensor.bus_station_azrieli_center_line_249') }} minutes"Get notified when your train is departing soon:
automation:
- alias: "Train to Haifa Departing Soon"
trigger:
- platform: numeric_state
entity_id: sensor.train_route_tel_aviv_center_haifa_center_next_train
below: 15
action:
- service: notify.mobile_app_your_phone
data:
title: "Train Departing Soon"
message: >
Train to {{ state_attr('sensor.train_route_tel_aviv_center_haifa_center_next_train', 'to_station_name') }}
departs in {{ states('sensor.train_route_tel_aviv_center_haifa_center_next_train') }} minutes.
Journey time: {{ state_attr('sensor.train_route_tel_aviv_center_haifa_center_next_train', 'duration_minutes') }} minPrepare to leave when bus is 5 minutes away:
automation:
- alias: "Prepare to Leave - Bus Approaching"
trigger:
- platform: numeric_state
entity_id: sensor.bus_station_azrieli_center_line_249
below: 5
action:
- service: light.turn_on
target:
entity_id: light.hallway
- service: notify.mobile_app_your_phone
data:
message: "Time to leave! Bus 249 in {{ states('sensor.bus_station_azrieli_center_line_249') }} min"Create a sensor showing the soonest bus from multiple lines:
template:
- sensor:
- name: "Next Bus Home"
state: >
{% set lines = [
states('sensor.bus_station_azrieli_center_line_249'),
states('sensor.bus_station_azrieli_center_line_40'),
states('sensor.bus_station_azrieli_center_line_605')
] %}
{% set times = lines | reject('in', ['No data', 'Arrived', 'unavailable']) | map('int') | list %}
{% if times | length > 0 %}
{{ times | min }}
{% else %}
No data
{% endif %}
unit_of_measurement: "min"
icon: mdi:bus-clockRefresh arrival times when you're getting ready to leave:
automation:
- alias: "Refresh Bus Times When Leaving"
trigger:
- platform: state
entity_id: binary_sensor.front_door
to: "on"
action:
- service: israel_transportation.refresh_data
data:
entity_id: sensor.bus_station_azrieli_center_line_249Update tracked lines based on time of day:
automation:
- alias: "Update Bus Lines for Morning Commute"
trigger:
- platform: time
at: "07:00:00"
action:
- service: israel_transportation.update_lines
data:
entity_id: sensor.bus_station_azrieli_center_line_249
lines: "249, 40, 189" # Morning express lines
- alias: "Update Bus Lines for Evening Commute"
trigger:
- platform: time
at: "17:00:00"
action:
- service: israel_transportation.update_lines
data:
entity_id: sensor.bus_station_azrieli_center_line_249
lines: "249, 40, 605" # Evening linesCreate a script to check if you need to hurry:
script:
check_bus_status:
sequence:
- service: israel_transportation.refresh_data
- delay:
seconds: 2
- choose:
- conditions:
- condition: numeric_state
entity_id: sensor.bus_station_azrieli_center_line_249
below: 5
sequence:
- service: notify.mobile_app_your_phone
data:
title: "Hurry!"
message: "Bus arrives in {{ states('sensor.bus_station_azrieli_center_line_249') }} minutes!"
data:
priority: high
- conditions:
- condition: numeric_state
entity_id: sensor.bus_station_azrieli_center_line_249
above: 15
sequence:
- service: notify.mobile_app_your_phone
data:
message: "You have {{ states('sensor.bus_station_azrieli_center_line_249') }} minutes. No rush!"For more examples including train and light rail configurations, see examples/configuration_examples.yaml.
The integration provides custom services for advanced automation scenarios:
Force an immediate refresh of arrival times data. Useful when you want the latest information before making a decision.
Parameters:
entity_id(optional): Specific entity to refresh. If not provided, all Israel Transportation entities will be refreshed.
Example:
service: israel_transportation.refresh_data
data:
entity_id: sensor.bus_station_azrieli_center_line_249Dynamically update the bus lines being tracked for a station. Perfect for adjusting monitored routes based on time of day or other conditions. Only works for bus and light rail sensors, not trains.
Parameters:
entity_id(required): The Israel Transportation entity to updatelines(required): Comma-separated list of bus line numbers
Example:
service: israel_transportation.update_lines
data:
entity_id: sensor.bus_station_azrieli_center_line_249
lines: "249, 40, 605"The integration automatically adjusts update frequency based on context:
- Bus approaching (<10 min): Updates every 15 seconds
- Normal hours (6:00-22:00): Updates every 30 seconds (default)
- Night hours (22:00-6:00): Updates every 5 minutes
- No upcoming buses (>60 min): Updates every 5 minutes
This optimizes API usage while ensuring timely updates when you need them most.
The integration includes robust error handling:
- Automatic retries with exponential backoff for network errors
- Graceful degradation when API is unavailable
- Clear error messages in the UI
- Sensor availability tracking - sensors marked unavailable during errors
This integration uses the BusNearby API, which provides real-time Israeli public transportation data. The API does not require authentication and is free to use.
- Check your internet connection
- Verify the station ID is correct
- Ensure the bus lines serve that station
- Check Home Assistant logs for errors:
ConfigurationβLogs
- Double-check the station number at bus.co.il
- Try entering the station number without any prefix
- Some stations may not be available in the API
- Verify the line number is correct
- Check if the line serves this station
- The line may not be operating at the current time
# Clone the repository
git clone https://github.com/ziv-daniel/hass-israel-transportation-integration.git
cd hass-israel-transportation-integration
# Install development dependencies
pip install -r requirements_test.txt
# Install pre-commit hooks
pip install pre-commit
pre-commit install# Run all tests
pytest
# Run with coverage
pytest --cov=custom_components.israel_transportation --cov-report=html
# Run specific test file
pytest tests/unit/test_api.py
# Run pre-commit checks manually
pre-commit run --all-filesThis integration uses GitHub Actions for automated testing and validation:
- Hassfest: Validates integration structure and Home Assistant compatibility
- HACS Validation: Ensures HACS repository standards compliance
- Tests: Runs pytest across Python 3.12/3.13 and multiple HA versions
- Pre-commit: Automated code formatting and linting with Ruff
- Release Drafter: Automatically generates release notes from PRs
- Dependabot: Keeps dependencies and actions up to date
All workflows run automatically on push and pull requests.
This project uses:
- Ruff for fast Python linting and formatting
- pytest with coverage reporting via Codecov
- Pre-commit hooks for automated code quality checks
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Make your changes and ensure tests pass
- Run pre-commit checks:
pre-commit run --all-files - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
All PRs are automatically validated by CI/CD workflows.
This project is licensed under the MIT License - see the LICENSE file for details.
- Integration developed by @ziv-daniel
- Data provided by BusNearby
- Inspired by the original silent-bus Lovelace card
- π Report bugs: GitHub Issues
- π¬ Discussions: GitHub Discussions
- π Documentation: Integration Plan
See CHANGELOG.md for release history.
Disclaimer: This is an unofficial integration and is not affiliated with or endorsed by the Israeli Ministry of Transportation or BusNearby.