Skip to content

Instantly share code, notes, and snippets.

@cliffordwhansen
Created December 3, 2018 13:16
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save cliffordwhansen/4a4468d83e995511f464f54536248c53 to your computer and use it in GitHub Desktop.
Save cliffordwhansen/4a4468d83e995511f464f54536248c53 to your computer and use it in GitHub Desktop.
Homeassistant sensor.rest for Capetown Cable car status
- 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