Created
December 3, 2018 13:16
-
-
Save cliffordwhansen/4a4468d83e995511f464f54536248c53 to your computer and use it in GitHub Desktop.
Homeassistant sensor.rest for Capetown Cable car status
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- platform: rest | |
name: Capetown CableCar | |
json_attributes: | |
- conditions | |
- conditions_stripped | |
- entry_date | |
- visibility | |
- wind_strength | |
- estimated_waiting_time | |
- estimated_waiting_time_top | |
- using_cache | |
- temperature | |
- summary | |
- day_one | |
- day_two | |
- day_three | |
- icon_one | |
- icon_two | |
- icon_three | |
- temp_one | |
- temp_two | |
- temp_three | |
resource: https://www.tablemountain.net/cableway_status.php | |
value_template: '{{ value_json.cableway_status }}' | |
- platform: template | |
sensors: | |
capetown_cablecar_estimated_waiting_time: | |
friendly_name: 'Capetown CableCar Waiting Time (up)' | |
value_template: >- | |
{% if is_state('sensor.capetown_cablecar', 'Open') %} | |
{{ states.sensor.capetown_cablecar.attributes["estimated_waiting_time"] }} | |
{% else %} | |
Closed | |
{% endif %} | |
capetown_cablecar_estimated_waiting_time_top: | |
friendly_name: 'Capetown CableCar Waiting Time (down)' | |
value_template: >- | |
{% if is_state('sensor.capetown_cablecar', 'Open') %} | |
{{ states.sensor.capetown_cablecar.attributes["estimated_waiting_time_top"] }} | |
{% else %} | |
Closed | |
{% endif %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment