Hi community.
I use this custom component https://github.com/Emilv2/stib_mivb to get a sensor named sensor.delta_line_5
with the following attributes :
attribution: Data provided by opendata.stib-mivb.be
stop_id: '8231'
stop_name: DELTA
line_name: ERASME - HERRMANN-DEBROUX
line_type: subway
line_color: F6A90B
line_text_color: FFFFFF
messages:
- >-
Sommet EU. Du 21/10 10h au 22/10, SCHUMAN ouvert (côté gare SNCB). 21-22/10,
bus 12 21 36 56 60 79 à MAELBEEK.
next_passages:
- next_passing_time: '2021-10-19T18:58:00+02:00'
next_passing_destination: ERASME
waiting_time: 2
line_number: '5'
line_name: ERASME - HERRMANN-DEBROUX
messages:
- >-
Sommet EU. Du 21/10 10h au 22/10, SCHUMAN ouvert (côté gare SNCB).
21-22/10, bus 12 21 36 56 60 79 à MAELBEEK.
line_type: subway
line_color: F6A90B
line_text_color: FFFFFF
- next_passing_time: '2021-10-19T19:04:00+02:00'
next_passing_destination: ERASME
waiting_time: 8
line_number: '5'
line_name: ERASME - HERRMANN-DEBROUX
messages:
- >-
Sommet EU. Du 21/10 10h au 22/10, SCHUMAN ouvert (côté gare SNCB).
21-22/10, bus 12 21 36 56 60 79 à MAELBEEK.
line_type: subway
line_color: F6A90B
line_text_color: FFFFFF
friendly_name: DELTA line 5
icon: mdi:subway
device_class: timestamp
I like to create one sensor with the waiting_time
for the first passing metro and another one with the waiting_time
for the second passing metro.
I try with this template but it don’t works:
sensor:
- platform: template
sensors:
stib_line_5_delta_hdebroux_next:
friendly_name: 'Time Line 5 Delta direction H-Debroux'
value_template: "{{ state_attr('sensor.delta_line_5', 'waiting_time') }}"