From 27f3d67529afff93bfa1b5292cb4a4b4a9dea942 Mon Sep 17 00:00:00 2001 From: plutomedia987 Date: Fri, 13 Dec 2024 12:46:23 +0000 Subject: [PATCH] Update README.md --- README.md | 86 +------------------------------------------------------ 1 file changed, 1 insertion(+), 85 deletions(-) diff --git a/README.md b/README.md index 8489727..37f0731 100644 --- a/README.md +++ b/README.md @@ -11,95 +11,16 @@ This repo is HACS compatible and can be added in to the custom repositories in H [![Open your Home Assistant instance and open a repository inside the Home Assistant Community Store.](https://my.home-assistant.io/badges/hacs_repository.svg)](https://my.home-assistant.io/redirect/hacs_repository/?owner=plutomedia987&repository=https%3A%2F%2Fgithub.com%2Fplutomedia987%2Fhomeassistant_nationalrail&category=Integration) -Todo: Below this line needs an update - ---- - ## Manual 1. Copy the custom_components/nationalrailuk folder into your config/custom_components folder and restart home assistant 2. Find the crs code for your origin and destination station using the [National Rail website](https://www.nationalrail.co.uk/). If you live in Weybridge and commutte to Waterloo, the codes are WYB and WAT 3. You need to add 2 integration for for monitoring your morning journey WYB to WAT and one for your evening route WAT to WYB 4. This should create 2 sensors `sensor.train_schedule_wyb_wat` and `sensor.train_schedule_wat_wyb` -# Integration within the UI - ## Custom Card A custom card for this integration can be found here: https://github.com/plutomedia987/lovelace-nationalrail -## Disruption Sensor - -You might want to create a binary sensor to be alerted of disruptions - - template: - - binary_sensor: - - unique_id: train_perturbation_mtl_wat - state: "{{state_attr('sensor.train_schedule_wyb_wat', 'perturbations') }}" - attributes: - friendly_name: "Perturbation on the Weybridge -> Waterloo line" - - - unique_id: train_perturbation_wat_mtl - state: "{{state_attr('sensor.train_schedule_wat_wyb', 'perturbations') }}" - attributes: - friendly_name: "Perturbation on the Waterloo -> Weybridge line" - -## Departing board display - -I have not cracked the UI coding yet so I did my display with an [HTML template card](https://github.com/PiotrMachowski/Home-Assistant-Lovelace-HTML-Jinja2-Template-card). - - type: custom:html-template-card - title: WYB - WAT timetable - ignore_line_breaks: true - content: > - - - - - {% if states.sensor.train_schedule_wyb_wat and (states.sensor.train_schedule_wyb_wat.attributes.trains | length) > 0 -%} - - {% for train in states.sensor.train_schedule_wyb_wat.attributes.trains %} - - - - - - {% for dest in train.destinations -%} - - - - - {% endfor -%} - {%- endfor -%} - {%- else -%} - - {%- endif -%} -
Destination Sch'd Expt'dPlatform
{{ train.terminus }}{{ as_timestamp(train.scheduled) | timestamp_custom('%I:%M %p') }}{% if train.expected is not string -%} - {{ as_timestamp(train.expected) | timestamp_custom('%I:%M %p') }} - {%- else -%}{{ train.expected -}} - {% endif %}{{ train.platform }}
{{ dest.name }} {% if dest.time_at_destination is not string -%} - {{ as_timestamp(dest.time_at_destination) | timestamp_custom('%I:%M %p') }} - {%- else -%}{{ dest.time_at_destination -}} - {% endif %}
No Trains
- - -## Automation and notifications - -I created 4 zone. -* Neighbourhood (includes my local station) -* Weybridge station -* Waterloo station -* City (where I work) - -I want -* platform notification when I reach the station -* notification of delays in the morning on the WYB->WAT line if I am still around home -* notification of delays in the evwning on the WAT->WYB line if I am still around work - -A blueprint is included in the repository. Follow the docs -[here](https://www.home-assistant.io/docs/automation/using_blueprints/) - - # Fair use policy National Rail limits API call to five million requests per four week railway period. @@ -110,10 +31,5 @@ We are currently refreshing once every 15 minutes in normal conditions but start # Support / Questions Please raise questions in the thread on the -[home assistant forum](https://community.home-assistant.io/t/national-rail-integration/529940/18) - -# Todo +[home assistant forum](https://community.home-assistant.io/t/national-rail-integration-fork-of-jfparis/803104/41) -* Proper UI -* clean up and port into core -* tests