-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathtransport.yaml
95 lines (91 loc) · 3.05 KB
/
transport.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
# Public Transport NSW
homeassistant:
customize:
package.node_anchors:
common: &common
package: "transport"
sensor.busmonitor1:
icon: mdi:bus
<<: *common
sensor.busmonitor2:
icon: mdi:bus
<<: *common
sensor.trainmonitor1:
icon: mdi:train
<<: *common
sensor.trainmonitor2:
icon: mdi:train
<<: *common
sensor.kariong_gosford:
icon: mdi:bus
<<: *common
sensor.gosford_kariong:
icon: mdi:bus
<<: *common
sensor.central_gosford:
icon: mdi:train
<<: *common
sensor.gosford_central:
icon: mdi:train
<<: *common
sensor:
- platform: transport_nsw
name: 'Kariong-Gosford'
stop_id: '2250275'
api_key: !secret trans_nsw
- platform: transport_nsw
name: 'Gosford-Kariong'
stop_id: '225042'
api_key: !secret trans_nsw
- platform: transport_nsw
name: 'Gosford-Central'
stop_id: '2250791'
route: 'Central Coast & Newcastle Line'
destination: 'Central via Strathfield'
api_key: !secret trans_nsw
- platform: transport_nsw
name: 'Central-Gosford'
stop_id: '2000329'
route: 'Central Coast & Newcastle Line'
destination: 'Newcastle Interchange via Strathfield'
api_key: !secret trans_nsw
- platform: template
sensors:
busmonitor1:
friendly_name: "Bus Kariong to Gosford"
value_template: >-
{% if is_state_attr('sensor.kariong_gosford', 'due', 'n/a') %}
No schedule found
{% else %}
{{ state_attr('sensor.kariong_gosford', 'route') }} in {{ state_attr('sensor.kariong_gosford', 'due') }}m ({{ state_attr('sensor.kariong_gosford', 'delay') }}m delay)
{% endif %}
- platform: template
sensors:
busmonitor2:
friendly_name: "Bus Gosford to Kariong"
value_template: >-
{% if is_state_attr('sensor.gosford_kariong', 'due', 'n/a') %}
No schedule found
{% else %}
{{ state_attr('sensor.gosford_kariong', 'route') }} in {{ state_attr('sensor.gosford_kariong', 'due') }}m ({{ state_attr('sensor.gosford_kariong', 'delay') }}m delay)
{% endif %}
- platform: template
sensors:
trainmonitor1:
friendly_name: "Train Gosford to Central"
value_template: >-
{% if is_state_attr('sensor.gosford_central', 'due', 'n/a') %}
No schedule found
{% else %}
{{ state_attr('sensor.gosford_central', 'route') }} in {{ state_attr('sensor.gosford_central', 'due') }}m ({{ state_attr('sensor.gosford_central', 'delay') }}m delay)
{% endif %}
- platform: template
sensors:
trainmonitor2:
friendly_name: "Train Central to Gosford"
value_template: >-
{% if is_state_attr('sensor.central_gosford', 'due', 'n/a') %}
No schedule found
{% else %}
{{ state_attr('sensor.central_gosford', 'route') }} in {{ state_attr('sensor.central_gosford', 'due') }}m ({{ state_attr('sensor.central_gosford', 'delay') }}m delay)
{% endif %}