diff --git a/oviapi_templated.yaml b/oviapi_templated.yaml new file mode 100644 index 0000000..a264a74 --- /dev/null +++ b/oviapi_templated.yaml @@ -0,0 +1,157 @@ +############################################ +## Public Transport ## +############################################ +###### SENSORS ----------------------------- +###### TRAM 23 ----------------------------- +sensor: + - platform: template + sensors: + tram_23_templated: + friendly_name: tram_23_templated + value_template: >- + {% if is_state('sensor.tram_23', 'unknown') %} + {% else %} + {{ states('sensor.tram_23') }} + {% endif %} + + - platform: template + sensors: + tram_23_future_1_templated: + friendly_name: tram_23_future_1_templated + value_template: >- + {% if is_state('sensor.tram_23_future_1', 'unknown') %} + {% else %} + {{ states('sensor.tram_23_future_1') }} + {% endif %} + + - platform: template + sensors: + tram_23_future_2_templated: + friendly_name: tram_23_future_2_templated + value_template: >- + {% if is_state('sensor.tram_23_future_2', 'unknown') %} + {% else %} + {{ states('sensor.tram_23_future_2') }} + {% endif %} + + - platform: template + sensors: + tram_23_future_3_templated: + friendly_name: tram_23_future_3_templated + value_template: >- + {% if is_state('sensor.tram_23_future_3', 'unknown') %} + {% else %} + {{ states('sensor.tram_23_future_3') }} + {% endif %} + + - platform: template + sensors: + tram_23_future_4_templated: + friendly_name: tram_23_future_4_templated + value_template: >- + {% if is_state('sensor.tram_23_future_4', 'unknown') %} + {% else %} + {{ states('sensor.tram_23_future_4') }} + {% endif %} + +###### BUS 140 ----------------------------- + - platform: template + sensors: + bus_140_templated: + friendly_name: bus_140_templated + value_template: >- + {% if is_state('sensor.bus_140', 'unknown') %} + {% else %} + {{ states('sensor.bus_140') }} + {% endif %} + + - platform: template + sensors: + bus_140_future_1_templated: + friendly_name: bus_140_future_1_templated + value_template: >- + {% if is_state('sensor.bus_140_future_1', 'unknown') %} + {% else %} + {{ states('sensor.bus_140_future_1') }} + {% endif %} + + - platform: template + sensors: + bus_140_future_2_templated: + friendly_name: bus_140_future_2_templated + value_template: >- + {% if is_state('sensor.bus_140_future_2', 'unknown') %} + {% else %} + {{ states('sensor.bus_140_future_2') }} + {% endif %} + + - platform: template + sensors: + bus_140_future_3_templated: + friendly_name: bus_140_future_3_templated + value_template: >- + {% if is_state('sensor.bus_140_future_3', 'unknown') %} + {% else %} + {{ states('sensor.bus_140_future_3') }} + {% endif %} + + - platform: template + sensors: + bus_140_future_4_templated: + friendly_name: bus_140_future_4_templated + value_template: >- + {% if is_state('sensor.bus_140_future_4', 'unknown') %} + {% else %} + {{ states('sensor.bus_140_future_4') }} + {% endif %} + +###### BUS 183 ----------------------------- + - platform: template + sensors: + bus_183_templated: + friendly_name: bus_183_templated + value_template: >- + {% if is_state('sensor.bus_183', 'unknown') %} + {% else %} + {{ states('sensor.bus_183') }} + {% endif %} + + - platform: template + sensors: + bus_183_future_1_templated: + friendly_name: bus_183_future_1_templated + value_template: >- + {% if is_state('sensor.bus_183_future_1', 'unknown') %} + {% else %} + {{ states('sensor.bus_183_future_1') }} + {% endif %} + + - platform: template + sensors: + bus_183_future_2_templated: + friendly_name: bus_183_future_2_templated + value_template: >- + {% if is_state('sensor.bus_183_future_2', 'unknown') %} + {% else %} + {{ states('sensor.bus_183_future_2') }} + {% endif %} + + - platform: template + sensors: + bus_183_future_3_templated: + friendly_name: bus_183_future_3_templated + value_template: >- + {% if is_state('sensor.bus_183_future_3', 'unknown') %} + {% else %} + {{ states('sensor.bus_183_future_3') }} + {% endif %} + + - platform: template + sensors: + bus_183_future_4_templated: + friendly_name: bus_183_future_4_templated + value_template: >- + {% if is_state('sensor.bus_183_future_4', 'unknown') %} + {% else %} + {{ states('sensor.bus_183_future_4') }} + {% endif %}