Advertisement
JLindvig

Combined Weather Package

Mar 6th, 2022
1,882
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 1.67 KB | None | 0 0
  1. weather_combined:
  2.   rest:
  3.     - resource: https://api.weather.com/v2/pws/observations/current?apiKey=e1f10a1e78da46f5b10a1e78da96f525&stationId=ICNARONA2&numericPrecision=decimal&format=json&units=m
  4.       sensor:
  5.         - name: Los Cristianos temperature
  6.           device_class: temperature
  7.           state_class: measurement
  8.           unit_of_measurement: "°C"
  9.           value_template: "{{ value_json.observations[0].metric.temp }}"
  10.           json_attributes_path: "$.observations[:1]"
  11.           json_attributes:
  12.            - humidity
  13.             - winddir
  14.             - metric.windSpeed
  15.  
  16.         - name: Los Cristianos attributes
  17.           state_class: measurement
  18.           value_template: "{{ value_json.observations[0].metric.temp }}"
  19.           json_attributes_path: "$.observations[:1].metric"
  20.           json_attributes:
  21.            - pressure
  22.             - windSpeed
  23.  
  24.   weather:
  25.     - platform: template
  26.       name: Playa de las Americas
  27.       unique_id: 9f0bc8ece58b46d389b598e9daa6552f
  28.       attribution_template: "Date from https://www.wunderground.com, forecast from met.no"
  29.       condition_template: "{{ states('weather.tigotan') }}"
  30.       temperature_template: "{{ states('sensor.los_cristianos_temperature') }}"
  31.       humidity_template: "{{ state_attr('sensor.los_cristianos_temperature', 'humidity') }}"
  32.       pressure_template: "{{ state_attr('sensor.los_cristianos_attributes', 'pressure') }}"
  33.       wind_speed_template: "{{ state_attr('sensor.los_cristianos_attributes', 'windSpeed') }}"
  34.       wind_bearing_template: "{{ state_attr('sensor.los_cristianos_temperature', 'winddir') }}"
  35.       forecast_template: "{{ state_attr('weather.tigotan', 'forecast') }}"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement