Advertisement
JLindvig

Rejseplan

Feb 7th, 2020
442
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 1.08 KB | None | 0 0
  1. sensor:
  2.   - platform: rejseplanen
  3.     name: Odense
  4.     stop_id: '430268500'
  5.     direction:
  6.      - 'Odense'
  7.  
  8.   - platform: rejseplanen
  9.     name: Faaborg
  10.     stop_id: '430268500'
  11.     direction:
  12.      - 'Faaborg'
  13.  
  14.   - platform: template
  15.     sensors:
  16.       bus_mod_faaborg:
  17.         friendly_name_template: >-
  18.           {{ state_attr('sensor.faaborg', 'route') }} mod {{ state_attr('sensor.faaborg', 'direction') }} om:
  19.         value_template: >-
  20.           {{ states('sensor.faaborg') }} minut{% if states('sensor.faaborg') | int > 1 %}ter{%- endif %} ({{ strptime(state_attr('sensor.faaborg', 'due_a
  21.   t'), '%d.%m.%y %H:%M').timestamp() | timestamp_custom('%R') }})
  22.  
  23.       bus_mod_odense:
  24.         friendly_name_template: >-
  25.           {{ state_attr('sensor.odense', 'route') }} mod {{ state_attr('sensor.odense', 'direction') }} om:
  26.         value_template: >-
  27.           {{ states('sensor.odense') }} minut{% if states('sensor.odense') | int > 1 %}ter{%- endif %} ({{ strptime(state_attr('sensor.odense', 'due_at')
  28.   , '%d.%m.%y %H:%M').timestamp() | timestamp_custom('%R') }})
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement