Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- sensor:
- - platform: rest
- name: tazerface_weather
- device_class: temperature
- state_class: measurement
- unit_of_measurement: '°C'
- headers:
- Accept: 'application/json'
- scan_interval: 900
- resource_template: >
- {% set lat = state_attr('person.tazerface', 'latitude') | float(0) %}
- {% set lon = state_attr('person.tazerface', 'longitude') | float(0) %}
- {{ 'https://api.met.no/weatherapi/locationforecast/2.0/compact?lat={}&lon={}'.format(lat, lon) }}
- value_template: "{{ value_json.properties.timeseries[0].data.instant.details.air_temperature }}"
- json_attributes_path: "$.properties.timeseries[0].data.instant.details"
- json_attributes:
- - relative_humidity
- - air_pressure_at_sea_level
- - wind_from_direction
- - wind_speed
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement