Eugeniusz-Gienek / kodi_weather_ha

GNU General Public License v3.0
7 stars 0 forks source link

Why not "forecast" attribute only #3

Open andreid1303 opened 1 month ago

andreid1303 commented 1 month ago

I think it will be more user friendly creating just "forecast" attribute in HA and parse it in Kodi. Also using current data and units from weather entity as attributes.

    sensor:
      - name: "DailyWeather"
        unique_id: weather_daily_all_in_one
        state: "{{ states('weather.openweathermap_daily') }}"
        attributes:
          temperature: "{{ state_attr('weather.openweathermap_daily', 'temperature') }}"
          dew_point: "{{ state_attr('weather.openweathermap_daily', 'dew_point') }}"
          temperature_unit: "{{ state_attr('weather.openweathermap_daily', 'temperature_unit') }}"
          humidity: "{{ state_attr('weather.openweathermap_daily', 'humidity') }}"
          cloud_coverage: "{{ state_attr('weather.openweathermap_daily', 'cloud_coverage') }}"
          pressure: "{{ state_attr('weather.openweathermap_daily', 'pressure') }}"
          pressure_unit: "{{ state_attr('weather.openweathermap_daily', 'pressure_unit') }}"
          wind_bearing: "{{ state_attr('weather.openweathermap_daily', 'wind_bearing') }}"
          wind_speed: "{{ state_attr('weather.openweathermap_daily', 'wind_speed') }}"
          wind_speed_unit: "{{ state_attr('weather.openweathermap_daily', 'wind_speed_unit') }}"
          visibility_unit: "{{ state_attr('weather.openweathermap_daily', 'visibility_unit') }}"
          precipitation_unit: "{{ state_attr('weather.openweathermap_daily', 'precipitation_unit') }}"
          forecast: "{{ daily['weather.openweathermap_daily'].forecast }}"
Eugeniusz-Gienek commented 1 month ago

Great idea, thanks for sharing - I will take a look at how can it be implemented