Weather Entity that combines weather forecasts and local sensors

Retired - see below :frowning:

I wanted to use weather cards that show local sensor data along with forecast data from my favorite provider. As this seems to be only possible with a custom integration, welcome “My Weather” available on HACS!

You specify a weather entity, along with optional sensors and will receive a new weather entity that combines both. This way it is possible to use the weather entity as any other but you know the values are from your trusted sensors.

Check it out and let me know what you think!

(search for “my weather” in HACS or use the repo below)

GitHub - DOliana/ha-my-weather: My Weather integration for home assistant · GitHub

You can also do it with a Template Weather entity.

I wasn’t aware - thanks. Nonetheless, I tried and cannot get the forecast to work - local sensor data does work. The example in the docs does not seem to be complete (only shows daily forecast usage, not hourly). I am using openweathermap as provider but it shouldn’t matter imho.

This is the yaml I am using in my config:

  - triggers:
      - trigger: state
        entity_id:
          - weather.forecast_home
          - sensor.weatherman_temperatur
          - sensor.weatherman_feuchte_rel
          - sensor.weatherman_barometer
    weather:
      - name: "Custom Weather Station"
        unique_id: custom_weather_station
        # condition from OpenWeatherMap, overridden to 'rainy' if local rain sensor is on
        condition: >-
          {% if is_state('sensor.weatherman_regenmelder', '1') %}
            rainy
          {% else %}
            {{ states('weather.forecast_home') }}
          {% endif %}
        temperature: "{{ states('sensor.aussen_temperatur') | float }}"
        humidity: "{{ states('sensor.weatherman_feuchte_rel') | float }}"
        forecast_daily: "{{ state_attr('weather.forecast_home', 'forecast_data') }}"
        # forecast_hourly: "{{ state_attr('weather.forecast_home', 'forecast_hourly') }}"

That’s not a real attribute ID…

Forecasts were removed from the state object of weather entities 3 years ago. In order to get them into your Template Weather, you will need to use the weather.get_forecasts action. That can be done by adding triggers directly to the Template weather config, or by creating a separate trigger-based Template sensor to store the forecast. I would recommend the latter, it’s significantly less complicated.

If you look at the configuration variables schema, you will see that daily, hourly, and twice daily forecast types are all supported.

If you are going to set it up to be trigger-based you may want to include all the sensors as triggers. As it stands neither sensor.weatherman_regenmelder nor sensor.aussen_temperatur are accounted for…

Never mind. After finding a separate thread with a good explanation I was able to set up a template ( Weather Template and Forecast - Configuration - Home Assistant Community).
I still think it’s all but straight forward and that the documentation should contain a full example (or at least information on the missing parts), but that’s probably just me.

Thanks! I will retire my first integration :disappointed_relieved: