{"id":49254665,"url":"https://github.com/johnbr/mlb-live-scoreboard","last_synced_at":"2026-05-24T21:00:53.366Z","repository":{"id":353678925,"uuid":"1220485243","full_name":"johnbr/mlb-live-scoreboard","owner":"johnbr","description":"Home Assistant MLB live game scorecard.","archived":false,"fork":false,"pushed_at":"2026-05-20T23:18:18.000Z","size":951,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-21T06:00:16.946Z","etag":null,"topics":["gametracker","hacs","homeassistant","mlb"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/johnbr.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-04-25T00:30:33.000Z","updated_at":"2026-05-21T04:01:23.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/johnbr/mlb-live-scoreboard","commit_stats":null,"previous_names":["johnbr/mlb-live-scoreboard"],"tags_count":48,"template":false,"template_full_name":null,"purl":"pkg:github/johnbr/mlb-live-scoreboard","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnbr%2Fmlb-live-scoreboard","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnbr%2Fmlb-live-scoreboard/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnbr%2Fmlb-live-scoreboard/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnbr%2Fmlb-live-scoreboard/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/johnbr","download_url":"https://codeload.github.com/johnbr/mlb-live-scoreboard/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnbr%2Fmlb-live-scoreboard/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33450402,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-24T19:21:36.376Z","status":"ssl_error","status_checked_at":"2026-05-24T19:21:10.562Z","response_time":57,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["gametracker","hacs","homeassistant","mlb"],"created_at":"2026-04-25T02:08:40.330Z","updated_at":"2026-05-24T21:00:53.359Z","avatar_url":"https://github.com/johnbr.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MLB Live Scoreboard / GameTracker\n\nA Home Assistant custom integration and Lovelace card for displaying live MLB game data from ESPN.\n\n![HACS](https://img.shields.io/badge/HACS-Custom-orange.svg)\n![Version](https://img.shields.io/badge/version-1.8.7-blue.svg)\n\n## Features\n\n- **Live game tracking** - Real-time scores, innings, count, and base runners\n- **Pitcher/Batter matchup** - Current at-bat with player headshots and stats\n- **Play-by-play** - Recent plays and pitch-by-pitch updates\n- **Pre-game info** - Scheduled game times and probable pitchers\n- **Post-game results** - Final scores and game leaders\n- **Compact-card expand panel** - Click an upcoming or completed game card to expand it. Upcoming games show probable starters + current division standings; completed games show every scoring play of the game + game leaders (top hitters / pitchers per side) above the same standings block\n- **Player career popup** - Click any (yellow) player name to open an in-card popup with their bio and season-by-season career stats; configurable to open ESPN's player page instead (`player_link_target`)\n- **Team lineup popup** - Click a team's side of the pitcher/batter matchup (anywhere but the player name) to open an in-card popup with that team's full lineup and every player who appeared in the game, toggleable between **Game** (this game's box score) and **Season** stats for hitters and pitchers\n- **Configurable game-event actions** - Fire Home Assistant events (or invoke services directly from the integration options) on team scored, opponent scored, game won, game lost, and game started, so you can drive lights, TTS, notifications, or any other automation. See [Game Event Actions](#game-event-actions) below.\n- **Configurable display** - Toggle various UI elements on/off\n- **Auto-registered card** - The Lovelace card is automatically registered on install\n\n## Screenshots\n\n\u003c!-- Absolute raw.githubusercontent.com URLs (not relative paths) so the\n     images render on the HACS frontend as well as on GitHub — HACS doesn't\n     resolve relative paths or always preserve raw \u003cimg\u003e HTML tags. Each\n     WebP is pre-sized to its intended display width so no width attribute\n     is needed. --\u003e\n\n**Live game** — scoreline, live win probability, count + outs, pitcher/batter matchup with portraits, base runners, pitch sequence, and recent plays.\n\n![Live game card showing Dodgers vs Padres with full live UI](https://raw.githubusercontent.com/johnbr/mlb-live-scoreboard/main/docs/screenshots/01-live-game.webp)\n\n**Final game with scoring summary** — click a completed game's card to expand it and see every scoring play of the game plus the current division standings.\n\n![Final-game expand panel listing scoring plays and division standings](https://raw.githubusercontent.com/johnbr/mlb-live-scoreboard/main/docs/screenshots/02-final-summary.webp)\n\n**Player career popup** — click any (yellow) player name to open an in-card popup with that player's bio and season-by-season career stats.\n\n![Player career popup showing Vladimir Guerrero Jr.'s career batting table](https://raw.githubusercontent.com/johnbr/mlb-live-scoreboard/main/docs/screenshots/03-career-popup.webp)\n\n**Between-innings due-up panel** — after the third out, the matchup row swaps to show the next three batters' portraits and stats until the half-inning ends.\n\n![Due-up panel showing three on-deck batter portraits between innings](https://raw.githubusercontent.com/johnbr/mlb-live-scoreboard/main/docs/screenshots/04-due-up.webp)\n\n**Track multiple teams** — one card per team, each independently configurable, sharing the dashboard with the rest of your Home Assistant tiles.\n\n![Four MLB cards tiled on a tablet dashboard showing different game states](https://raw.githubusercontent.com/johnbr/mlb-live-scoreboard/main/docs/screenshots/05-multiple-teams.webp)\n\n## Installation\n\n### HACS (Recommended)\n\n1. Open HACS in Home Assistant\n2. Click the three dots in the top right and select \"Custom repositories\"\n3. Add this repository URL and select \"Integration\" as the category\n4. Click \"Install\"\n5. Restart Home Assistant\n\nThe JavaScript card is automatically served by the integration - no manual file copying needed!\n\n### Manual Installation\n\n1. Copy the `custom_components/mlb_live_scoreboard` folder to your Home Assistant `config/custom_components/` directory\n2. Restart Home Assistant\n\n## Configuration\n\n### Integration Setup\n\n1. Go to **Settings → Devices \u0026 Services → Add Integration**\n2. Search for \"MLB Live Scoreboard\"\n3. Select your team (e.g., LAD for Los Angeles Dodgers)\n4. Enter a display name (optional)\n\nThis creates a sensor entity like `sensor.mlb_live_scoreboard_lad`.\n\n### Lovelace Card Setup\n\nThe card resource is automatically registered at `/mlb_live_scoreboard/mlb-live-game-card.js`.\n\nIf the auto-registration doesn't work, manually add the resource:\n\n1. Go to **Settings → Dashboards → ⋮ → Resources**\n2. Add URL: `/mlb_live_scoreboard/mlb-live-game-card.js`\n3. Type: **JavaScript Module**\n\nAdd the card to your dashboard — either way:\n\n- **Visual (no YAML):** _Edit dashboard → Add card → search \"MLB Live Game Card\"_. The picker shows a live preview; the card lands pre-configured against the first MLB Live Scoreboard sensor it finds. Every option below is exposed as a form field — click **Edit** on the card and use the **Visual editor** tab.\n- **YAML** (equivalent):\n\n  ```yaml\n  type: custom:mlb-live-game-card\n  entity: sensor.mlb_live_scoreboard_lad\n  title: Dodgers\n  ```\n\n## Card Configuration Options\n\n| Option                 | Type    | Default      | Description                                                                                                                                                                                                                                                                                              |\n| ---------------------- | ------- | ------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `entity`               | string  | **required** | The MLB scoreboard sensor entity                                                                                                                                                                                                                                                                         |\n| `title`                | string  | Team name    | Card title                                                                                                                                                                                                                                                                                               |\n| `refresh_rate`         | number  | `0`          | Auto-refresh interval in seconds (0 = disabled)                                                                                                                                                                                                                                                          |\n| `show_batter`          | boolean | `true`       | Show pitcher/batter matchup panel                                                                                                                                                                                                                                                                        |\n| `show_records`         | boolean | `true`       | Show team win/loss records                                                                                                                                                                                                                                                                               |\n| `show_linescore`       | boolean | `false`      | Show detailed inning-by-inning linescore                                                                                                                                                                                                                                                                 |\n| `show_pitches`         | boolean | `true`       | Show pitch-by-pitch display                                                                                                                                                                                                                                                                              |\n| `show_play_results`    | boolean | `true`       | Show play-by-play results                                                                                                                                                                                                                                                                                |\n| `show_on_deck`         | boolean | `true`       | Show on-deck batter                                                                                                                                                                                                                                                                                      |\n| `show_base_occupancy`  | boolean | `true`       | Show base runner names                                                                                                                                                                                                                                                                                   |\n| `show_diamond`         | boolean | `true`       | Show base diamond graphic                                                                                                                                                                                                                                                                                |\n| `show_count`           | boolean | `true`       | Show balls/strikes/outs dots                                                                                                                                                                                                                                                                             |\n| `show_win_probability` | boolean | `true`       | Show live win-probability bar between the score rows and the balls/strikes/outs row (hidden pre-game when ESPN doesn't yet publish a probability series)                                                                                                                                                 |\n| `show_highlights`      | boolean | `false`      | Show a \"Watch highlights on ESPN\" link in the final-game expand panel. Only renders once ESPN publishes clips (typically 30-90 min after the final pitch); off by default                                                                                                                                |\n| `player_link_target`   | string  | `popup`      | What clicking a (yellow) player name does: `popup` opens an in-card career-stats popup; `espn` opens ESPN's player page directly. The popup always includes a \"View on ESPN\" link, so ESPN stays reachable either way                                                                                    |\n| `show_lineup_popup`    | boolean | `true`       | Allow clicking a team's side of the matchup to open the team-lineup popup. Set `false` to make the matchup sides inert (player-name links still work)                                                                                                                                                    |\n| `lineup_default_view`  | string  | `auto`       | Which view the lineup popup opens to: `auto` (Game while the game is live, Season otherwise), or force `game` / `season`                                                                                                                                                                                 |\n| `headshot_size`        | string  | `auto`       | Size of inline headshots (matchup, due-up, probable pitchers). `auto` scales them with the card's actual width via a CSS container query — responsive to HA's per-column dashboards. Fixed presets: `small` (40px), `medium` (56px), `large` (72px), `xlarge` (88px). Modal-popup avatars are unaffected |\n\n### Example with all options\n\n```yaml\ntype: custom:mlb-live-game-card\nentity: sensor.mlb_live_scoreboard_lad\ntitle: Dodgers\nrefresh_rate: 10\nshow_batter: true\nshow_records: true\nshow_linescore: false\nshow_pitches: true\nshow_play_results: true\nshow_on_deck: true\nshow_base_occupancy: true\nshow_diamond: true\nshow_count: true\nshow_win_probability: true\nshow_highlights: false\nplayer_link_target: popup\nshow_lineup_popup: true\nlineup_default_view: auto\nheadshot_size: auto\n```\n\n## Game Event Actions\n\nThe integration fires Home Assistant events on the bus whenever notable\nin-game things happen for the team you've configured. You can react to\nthese in two ways:\n\n1. **Built-in options flow** — quick \u0026 visual: Settings → Devices \u0026 Services →\n   _MLB Live Scoreboard_ → **Configure**. Each event has a field that accepts\n   any sequence of Home Assistant actions (call services, run scripts, fire\n   notifications, activate scenes, etc.).\n2. **Automations against the event bus** — more flexible: write your own\n   automations triggered on the events listed below. Use this when you need\n   conditions, multi-step logic, or want different behavior in different\n   automations.\n\nBoth mechanisms work simultaneously. Configured options run in addition to,\nnot instead of, any automations you have listening for the same events.\n\n### Events fired\n\n| Event type                            | When it fires                                   |\n| ------------------------------------- | ----------------------------------------------- |\n| `mlb_live_scoreboard_team_scored`     | Your team's score increased since the last poll |\n| `mlb_live_scoreboard_opponent_scored` | The opposing team's score increased             |\n| `mlb_live_scoreboard_game_started`    | The game transitioned from scheduled to live    |\n| `mlb_live_scoreboard_game_ended`      | The game transitioned to final (any result)     |\n| `mlb_live_scoreboard_game_won`        | Game ended and your team won                    |\n| `mlb_live_scoreboard_game_lost`       | Game ended and your team lost                   |\n\nA tie/suspension fires `game_ended` but neither `game_won` nor `game_lost`.\n\n### Event payload\n\nEvery event includes the same base payload, with two extra fields on\nscore-change events:\n\n| Field               | Type   | Description                                             |\n| ------------------- | ------ | ------------------------------------------------------- |\n| `team_abbr`         | string | Your configured team's abbreviation, e.g. `\"LAD\"`       |\n| `team_name`         | string | Your configured team's display name                     |\n| `team_score`        | int    | Your team's score _after_ this event                    |\n| `opponent_abbr`     | string | Opposing team's abbreviation                            |\n| `opponent_name`     | string | Opposing team's display name                            |\n| `opponent_score`    | int    | Opponent's score _after_ this event                     |\n| `is_home`           | bool   | True if your team is the home side                      |\n| `inning`            | int    | Current inning number (0 if not started)                |\n| `inning_half`       | string | `\"top\"`, `\"bottom\"`, or `\"\"`                            |\n| `event_id`          | string | ESPN event ID for the game                              |\n| `status_detail`     | string | Human-readable status text, e.g. `\"Bot 7th\"`            |\n| `score_delta`       | int    | (`*_scored` only) How many runs scored on this play     |\n| `scoring_play_text` | string | (`*_scored` only) ESPN play description, when available |\n\n### Detection rules\n\n- The first refresh after Home Assistant starts only **establishes a\n  baseline** — it does not fire any events. Score and state changes are\n  detected on subsequent refreshes.\n- When a new game appears (different `event_id`), no events are fired for\n  that polling cycle to avoid spurious score events across game boundaries.\n  The next refresh becomes the new baseline.\n- `team_scored` / `opponent_scored` only fire on positive score deltas, and\n  are suppressed while the game is delayed (since ESPN occasionally\n  corrects scores during a delay).\n- `game_ended` / `game_won` / `game_lost` only fire on the _transition_\n  into the final state — they will not re-fire on subsequent refreshes\n  while the game remains final.\n\n### Example: automation triggered by a bus event\n\n```yaml\nautomation:\n  - alias: \"Flash lights and notify when Dodgers score\"\n    trigger:\n      platform: event\n      event_type: mlb_live_scoreboard_team_scored\n      event_data:\n        team_abbr: LAD\n    action:\n      - service: light.turn_on\n        target:\n          entity_id: light.living_room\n        data:\n          flash: short\n          color_name: blue\n      - service: notify.mobile_app_phone\n        data:\n          title: \u003e-\n            Dodgers scored! ({{ trigger.event.data.team_score }}-{{\n            trigger.event.data.opponent_score }})\n          message: \"{{ trigger.event.data.scoring_play_text }}\"\n```\n\n### Example: configured action via the options flow\n\nIn the options flow's **When my team wins** field:\n\n```yaml\n- service: notify.persistent_notification\n  data:\n    title: \"{{ team_name }} won!\"\n    message: \"Final: {{ team_score }}-{{ opponent_score }} vs {{ opponent_name }}\"\n- service: scene.turn_on\n  target:\n    entity_id: scene.victory_celebration\n```\n\nInside an option-flow action sequence, payload fields are available as\ntop-level template variables (e.g. `{{ team_score }}`), whereas in\nautomations they're nested under `trigger.event.data` (e.g.\n`{{ trigger.event.data.team_score }}`).\n\n## Supported Teams\n\n| Abbreviation | Team                  |\n| ------------ | --------------------- |\n| ARI          | Arizona Diamondbacks  |\n| ATH          | Athletics             |\n| ATL          | Atlanta Braves        |\n| BAL          | Baltimore Orioles     |\n| BOS          | Boston Red Sox        |\n| CHC          | Chicago Cubs          |\n| CIN          | Cincinnati Reds       |\n| CLE          | Cleveland Guardians   |\n| COL          | Colorado Rockies      |\n| CWS          | Chicago White Sox     |\n| DET          | Detroit Tigers        |\n| HOU          | Houston Astros        |\n| KC           | Kansas City Royals    |\n| LAA          | Los Angeles Angels    |\n| LAD          | Los Angeles Dodgers   |\n| MIA          | Miami Marlins         |\n| MIL          | Milwaukee Brewers     |\n| MIN          | Minnesota Twins       |\n| NYM          | New York Mets         |\n| NYY          | New York Yankees      |\n| OAK          | Oakland Athletics     |\n| PHI          | Philadelphia Phillies |\n| PIT          | Pittsburgh Pirates    |\n| SD           | San Diego Padres      |\n| SEA          | Seattle Mariners      |\n| SF           | San Francisco Giants  |\n| STL          | St. Louis Cardinals   |\n| TB           | Tampa Bay Rays        |\n| TEX          | Texas Rangers         |\n| TOR          | Toronto Blue Jays     |\n| WSH          | Washington Nationals  |\n\n## Data Source\n\nThis integration uses ESPN's public API for MLB game data. Data is refreshed every 5 seconds during live games.\n\nFor details on data flow, sensor attributes, ESPN endpoints, and the card's\ninternal architecture, see [ARCHITECTURE.md](ARCHITECTURE.md).\n\n## License\n\nMIT License - see LICENSE file for details.\n\n## Contributing\n\nContributions are welcome! Please open an issue or pull request.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjohnbr%2Fmlb-live-scoreboard","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjohnbr%2Fmlb-live-scoreboard","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjohnbr%2Fmlb-live-scoreboard/lists"}