Skip to content

Commit

Permalink
Create oviapi_templated.yaml
Browse files Browse the repository at this point in the history
You can use this file to hide the unknown sensors whenever the value of the sensor is unknown.
  • Loading branch information
IIIdefconIII authored May 2, 2019
1 parent 3c07e2c commit 29324cc
Showing 1 changed file with 157 additions and 0 deletions.
157 changes: 157 additions & 0 deletions oviapi_templated.yaml
Original file line number Diff line number Diff line change
@@ -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 %}

0 comments on commit 29324cc

Please sign in to comment.