seler/ha-prd

Ramówka Polskiego Radia Dzieciom w Home Assistancie

★ 0Forks 0PythonGitHub ↗Compare

README

Ramówka Polskiego Radia Dzieciom w Home Assistant

Home Assistant custom integration and Lovelace card to display today's schedule for Polskie Radio Dzieciom.

Showcase

Lovelace card showcase

  • Fetches today's schedule from https://apipr.polskieradio.pl/api/schedule?Program=11 with browser-like headers.
  • Sensor sensor.polskie_radio_dzieciom_schedule holds the current item title, with attributes for current, next, and rest of day (including progress, remaining time, and formatted times).
  • Sensor sensor.polskie_radio_dzieciom_now.
  • Sensor sensor.polskie_radio_dzieciom_next.
  • Lovelace card prd-card shows current programme with progress bar, next with start time, and an expandable list for the rest of the day.

Install via HACS

  1. In HACS, go to Integrations ➜ Custom repositories ➜ Add:
    • Repository: https://github.com/seler/ha-prd
    • Category: Integration
  2. Install the repository. Restart Home Assistant.
  3. Go to Settings ➜ Devices & services ➜ Add integration ➜ search for "Polskie Radio Dzieciom" and add it.
  4. Frontend card (manual):
    • Copy www/community/prd-card/prd-card.js from this repository into your HA config at /config/www/prd-card/prd-card.js (create the folder if needed).
    • In Settings ➜ Dashboards ➜ Resources, add:
      • URL: /local/prd-card/prd-card.js?v1
      • Type: module
    • If the card doesn't update after replacing the file, bump the resource URL with a version, e.g. /local/prd-card/prd-card.js?v=2, and hard-refresh the browser.

Example card config

- type: 'custom:prd-card'
  entity: sensor.polskie_radio_dzieciom_schedule

Update

  1. In HACS, open the repo and click Update when available, then restart HA.
  2. Copy the updated www/community/prd-card/prd-card.js into /config/www/prd-card/.
  3. Update resource version (?vN+1).
  4. Restart HA.

Contributors

seler

Issues