1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
| - platform: rest name: hko_tko_humdity resource: https://data.weather.gov.hk/weatherAPI/hko_data/regional-weather/latest_1min_humidity.csv value_template: "{{ value | regex_findall_index(find='Tseung Kwan O,(.*)') | float | round(0) }}" device_class: "humidity" unit_of_measurement: "%" scan_interval: 600 - platform: rest name: hko_tko_temperature resource: https://data.weather.gov.hk/weatherAPI/hko_data/regional-weather/latest_1min_temperature.csv value_template: "{{ value | regex_findall_index(find='Tseung Kwan O,(.*)') | float | round(1) }}" device_class: "temperature" unit_of_measurement: "°C" scan_interval: 600 - platform: rest name: hk_tko_wind resource: https://data.weather.gov.hk/weatherAPI/hko_data/regional-weather/latest_10min_wind.csv value_template: "{{ value | regex_findall_index(find='Tseung Kwan O,(.*)') }}" scan_interval: 600 - platform: template sensors: tko_wind_direction: friendly_name: "TKO 10-minute wind direction" value_template: "{{ states('sensor.hk_tko_wind') | regex_findall_index(find='([^,]+),') }} " icon_template: "hass:compass" tko_wind_speed: friendly_name: "TKO 10-minute mean speed" value_template: "{{ states('sensor.hk_tko_wind') | regex_findall_index(find='[^,]+,([^,]+),') }} " unit_of_measurement: "km/hour" icon_template: "hass:tailwind" tko_wind_gust: friendly_name: "TKO 10-minute max gust" value_template: "{{ states('sensor.hk_tko_wind') | regex_findall_index(find='[^,]+,[^,]+,([^,]+)') }} " unit_of_measurement: "km/hour" icon_template: "hass:weather-windy"
|