New weather forecast template

The configuration in Post #77 is for a Template sensor and should be placed wherever you have entities from the template integration configured. If you don’t have any Template integration entities, you can place it directly in configuration.yaml, just make sure to add the top-level key template above the sensor config.

If you don’t actually need the sensor for anything else, you can add the weather.get_forecasts service call to your existing automation.

...
action:
  - service: weather.get_forecasts
    data:
      type: twice_daily
    target:
      entity_id: weather.kclt_daynight
    response_variable: response
  - variables:
      set_conversation_response: >-
        {% set forecast    = response['weather.kclt_daynight'].forecast %}
        {% set current     = forecast[0].condition | replace('partlycloudy', 'partly cloudy') %}
        {% set fc_detail   = forecast[0].detailed_description | replace('mph', 'miles per hour') %}
        {% set temperature = states.sensor.cotech_367959_121_temperature_f.state | round | int  %}
        {% set humidity    = states.sensor.cotech_367959_121_humidity.state %}
        The weather is currently {{ current }}. Temperature is {{ temperature }}
        degrees and  humidity is {{ humidity }} percent.  
        The forecast is {{ fc_detail }}  
....
1 Like