Configuration log error, config.py

I get the following error message in my log:
Logger: homeassistant.components.template.config
Source: components/template/config.py:379
integration: Template (documentation, issues)
First occurred: 10:12:07 AM (1 occurrence)
Last logged: 10:12:07 AM

The entity definition format under template: differs from the platform configuration format. See Template - Home Assistant

I wonder how to fix this. Is it something in my configuration.yaml?

This is my configuration.yaml:


# Loads default set of integrations. Do not remove.
default_config:

# Load frontend themes from the themes folder
frontend:
#  themes: !include_dir_merge_named themes
  themes: !include themes.yaml

automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml


template:
 - sensor:
      - name: "dayoftheweek"
        state: >
          {{ now().strftime("%A") }}
      - name: "month"
        state: >
          {{ now().strftime("%B") }}
      - name: "dayofthemonth"
        state: >
          {{ now().strftime('%-d') }}
         
# - platform: template
   sensors:
      nextsunrise:
        friendly_name: 'NextSunrise'
        value_template: >
          {{ as_timestamp(states.sun.sun.attributes.next_rising) | timestamp_custom(' %H:%M ') | replace(" 0", "") }}
        icon_template: mdi:weather-sunset-up
      nextsunset:
        friendly_name: 'NextSunset'
        value_template: >
          {{ as_timestamp(states.sun.sun.attributes.next_setting) | timestamp_custom(' %H:%M ') | replace(" 0", "") }}
        icon_template: mdi:weather-sunset-down
        

Everything below this line

is in the legacy template format, yet you have it in a location that expects the new format.

HA version 2025.12 depreciates the legacy format so you should convert them to the new format anyway. See: Deprecation of legacy template entities in 2025.12

Thank you o much for your reply. I looked at the link you sent but I do not see/understand how I should change the following to work with the new changes in Home Assistant:

template:
 - sensor:
      - name: "dayoftheweek"
        state: >
          {{ now().strftime("%A") }}
      - name: "month"
        state: >
          {{ now().strftime("%B") }}
      - name: "dayofthemonth"
        state: >
          {{ now().strftime('%-d') }}

Not above that line. That config is ok. This is the config you have to change:

Thank you for pointing me in the right direction. I am a beginner on this and am trying to understand how it should be changed but I’m not getting what the difference is in the new format. Is it the word template that needs to be changed somehow?

# Loads default set of integrations. Do not remove.
default_config:

# Load frontend themes from the themes folder
frontend:
#  themes: !include_dir_merge_named themes
  themes: !include themes.yaml

automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml

template:
  - sensor:
      - name: "dayoftheweek"
        state: >
          {{ now().strftime("%A") }}
      - name: "month"
        state: >
          {{ now().strftime("%B") }}
      - name: "dayofthemonth"
        state: >
          {{ now().strftime('%-d') }}
      - name: 'NextSunrise'
        state: >
          {{ as_timestamp(states.sun.sun.attributes.next_rising) | timestamp_custom(' %H:%M ') | replace(" 0", "") }}
        icon: mdi:weather-sunset-up
      - name: 'NextSunset'
        state: >
          {{ as_timestamp(states.sun.sun.attributes.next_setting) | timestamp_custom(' %H:%M ') | replace(" 0", "") }}
        icon: mdi:weather-sunset-down

Wow, I’ll look into the difference and try to understand it. Thank you so much!

1 Like