Unknown error when validating config for sensor from integration template - argument of type 'int' is not a container or iterable

Dear All,

I have an error message in my HA after restart or by checking config, but I cannot see in which sensor or helper or whatever.
Can anybody give me a hint, what to do please?

Thanks for your working to HA and helping.

Best regards
Hannes

Here is the message:

Protokolldetails (FEHLER)
Logger: homeassistant.config
Quelle: config.py:1101
Erstmals aufgetreten: 09:43:46 (1 Vorkommnis)
Zuletzt protokolliert: 09:43:46

Unknown error when validating config for sensor from integration template - argument of type ‘int’ is not a container or iterable
Traceback (most recent call last):
File “/usr/src/homeassistant/homeassistant/config.py”, line 1101, in _async_load_and_validate_platform_integration
return platform.PLATFORM_SCHEMA(p_integration.config) # type: ignore[no-any-return]
~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^
File “/usr/local/lib/python3.14/site-packages/voluptuous/schema_builder.py”, line 205, in call
return self._compiled(, data)
~~~~~~~~~~~~~~^^^^^^^^^^
File “/usr/local/lib/python3.14/site-packages/voluptuous/schema_builder.py”, line 549, in validate_dict
return base_validate(path, data.items(), out)
File “/usr/local/lib/python3.14/site-packages/voluptuous/schema_builder.py”, line 330, in validate_mapping
cval = cvalue(key_path, value)
File “/usr/local/lib/python3.14/site-packages/voluptuous/schema_builder.py”, line 779, in validate_callable
return schema(data)
File “/usr/src/homeassistant/homeassistant/helpers/config_validation.py”, line 683, in verify
return cast(dict, schema(value))
~~~~~~^^^^^^^
File “/usr/local/lib/python3.14/site-packages/voluptuous/schema_builder.py”, line 205, in call
return self._compiled(, data)
~~~~~~~~~~~~~~^^^^^^^^^^
File “/usr/local/lib/python3.14/site-packages/voluptuous/schema_builder.py”, line 549, in validate_dict
return base_validate(path, data.items(), out)
File “/usr/local/lib/python3.14/site-packages/voluptuous/schema_builder.py”, line 330, in validate_mapping
cval = cvalue(key_path, value)
File “/usr/local/lib/python3.14/site-packages/voluptuous/validators.py”, line 256, in _run
return self._exec(self._compiled, value, path)
~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/local/lib/python3.14/site-packages/voluptuous/validators.py”, line 384, in _exec
v = func(path, v)
File “/usr/local/lib/python3.14/site-packages/voluptuous/schema_builder.py”, line 779, in validate_callable
return schema(data)
File “/usr/src/homeassistant/homeassistant/helpers/config_validation.py”, line 976, in validator
if key in config:
^^^^^^^^^^^^^
TypeError: argument of type ‘int’ is not a container or iterable

Post your template config

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

# Example configuration.yaml entry
my:

# Load frontend themes from the themes folder
frontend:
  themes: !include_dir_merge_named themes

# Text to speech
tts:
  - platform: google_translate

api:

rest_command:

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

######################### R E C O R D E R 
recorder:
  # db_url: mysql://homeassistant:homeassistant@core-mariadb/homeassistant?charset=utf8mb4
  db_url: !secret mariadb_url
  purge_keep_days: 90
  commit_interval: 20
  include: #Include domain
    domains:
      - sensor
      - binary_sensor
      - automation.*
      - switch.mystrom_switch
    entity_globs:
      - sensor.*_power
      - sensor.*consumption
      - sensor.*mystrom*
      - sensor.sh3*
      - sensor.sh1*
      - sensor.shht*
      - sensor.weather*
      - weather.zuhause*
      - switch.*
      - sensor.energy_import*
      - sensor.energy_export*
      - sensor.impge*
    entities:
      - sensor.power_export
      - sensor.power_import
      - sensor.power_consumption
      - sensor.energy_consumption_daily
      - sensor.energy_export_daily
      - sensor.energy_import_daily
      - sensor.energy_consumption_monthly
      - sensor.energy_export_monthly
      - sensor.energy_import_monthly
      - sensor.energy_consumption_sum
      - sensor.energy_export_sum
      - sensor.energy_import_sum
      - input_number.strompreis
      - weather.zuhause
  exclude: #Exclude entities
    entities:
      - zone.home
      - sensor.wr_leistungsfaktor
      - binary_sensor.netzbezug
      - binary_sensor.pvueberschuss
      - binary_sensor.mytemp
      - switch.mystrom_switch
      - sensor.mystrom_relay
      - switch.tmsw18
      - switch.entfeuchter_1b3d_pump
    entity_globs:
      - sensor.sun*

#history:
#  exclude:
#    domains:
#      - automation
#      - updater
#    entities:
#      - sensor.last_boot
#      - sensor.date
#    entity_globs:
#      - binary_sensor.*_occupancy

######################### L o g b o o k ###########################
logbook:
  include:
    domains:
      - alarm_control_panel
    entity_globs:
      - binary_sensor.*_occupancy

  exclude:
    entities:
      - sensor.dtu_uptime_extended
      - switch.mystrom_switch
      - switch.tmsw18
      - switch.entfeuchter_1b3d_bump
      - sensor.windrichtung
    entity_globs:
      - sensor.ltsw*_daily
      - sensor.tmsw*_daily
      - sensor.tmsw*_ssid
      - sensor.tmsw*_count
      - sensor.tmsw*_period
      - sensor.tmsw*_totalstarttime
      - sensor.mystrom*
      - sensor.wr*
      - sensor.wetterstatt1*
      - sensor.module*
      - sensor.dtu*
      - sensor.samba_back*
      - sensor.tmsw*
      - switch.tmsw*
      - sensor.tmhz*
      - switch.tmhz*

######################### L o g g e r ###########################
logger:
  default: error
  logs:
#    custom_components.localtuya: debug
#    custom_components.localtuya.pytuya: debug


######################### S e n s o r e n ###########################
####################### Platform: Integration #######################

sensor:
  ### MyStrom Integration
  - platform: integration
    source: sensor.mystrom_energy
    name: myStrom energy consumption
    method: left
    round: 2
  - platform: integration
    source: sensor.mystrom_bk_leistung
    name: myStrom power consumption
    method: left
    round: 2

  # ### Steckdosen und -summe Integration
  # - platform: integration
  # source: sensor.summe_switche_power
  # name: summe switche power consumption
  # method: left
  # round: 2

  ## Bezogener Strom vom Ewerk

  ### Tasmota
  - platform: integration
    source: sensor.tmsw1_energy_power
    name: summe tmsw1 power consumption
    method: left
    round: 2
  - platform: integration
    source: sensor.tmsw2_energy_power
    name: summe tmsw2 power consumption
    method: left
    round: 2
  - platform: integration
    source: sensor.tmsw3_energy_power
    name: summe tmsw3 power consumption
    method: left
    round: 2
  - platform: integration
    source: sensor.tmsw4_energy_power
    name: summe tmsw4 power consumption
    method: left
    round: 2
  - platform: integration
    source: sensor.tmsw5_energy_power
    name: summe tmsw5 power consumption
    method: left
    round: 2
  - platform: integration
    source: sensor.tmsw6_energy_power
    name: summe tmsw6 power consumption
    method: left
    round: 2
  - platform: integration
    source: sensor.tmsw7_energy_power
    name: summe tmsw7 power consumption
    method: left
    round: 2
  - platform: integration
    source: sensor.tmsw8_energy_power
    name: summe tmsw8 power consumption
    method: left
    round: 2
  - platform: integration
    source: sensor.tmsw9_energy_power
    name: summe tmsw9 power consumption
    method: left
    round: 2
  - platform: integration
    source: sensor.tmsw10_energy_power
    name: summe tmsw10 power consumption
    method: left
    round: 2
  - platform: integration
    source: sensor.tmsw11_energy_power
    name: summe tmsw11 power consumption
    method: left
    round: 2
  - platform: integration
    source: sensor.tmsw12_energy_power
    name: summe tmsw12 power consumption
    method: left
    round: 2
  - platform: integration
    source: sensor.tmsw13_kava_energy_power
    name: summe tmsw13 power consumption
    method: left
    round: 2
  - platform: integration
    source: sensor.tmsw14_energy_power
    name: summe tmsw14 power consumption
    method: left
    round: 2
  - platform: integration
    source: sensor.tmsw15_energy_power
    name: summe tmsw15 power consumption
    method: left
    round: 2
  - platform: integration
    source: sensor.tmsw16_energy_power
    name: summe tmsw16 power consumption
    method: left
    round: 2
  - platform: integration
    source: sensor.tmsw16_energy_power_2
    name: summe tmsw16 power consumption 2
    method: left
    round: 2
  - platform: integration
    source: sensor.tmsw17_energy_power
    name: summe tmsw17 power consumption
    method: left
    round: 2
  #########################################################

  # Sensor for Riemann sum of energy import (W -> Wh)
  - platform: integration
    source: sensor.power_import
    name: energy_import_sum
    unit_prefix: k
    round: 2
    method: left

  # Sensor for Riemann sum of energy export (W -> Wh)
  - platform: integration
    source: sensor.power_export
    name: energy_export_sum
    unit_prefix: k
    round: 2
    method: left

  # Sensor for Riemann sum of energy consumption (W -> Wh)
  - platform: integration
    source: sensor.power_consumption
    name: energy_consumption_sum
    unit_prefix: k
    round: 2
    method: left

  # Sensor for Riemann sum of energy import (W -> Wh)
  - platform: integration
    source: sensor.power_import_hz
    name: energy_import_sum_hz
    unit_prefix: k
    round: 2
    method: left

  # Sensor for Riemann sum of energy export (W -> Wh)
  - platform: integration
    source: sensor.power_export_hz
    name: energy_export_sum_hz
    unit_prefix: k
    round: 2
    method: left

  # Sensor for Riemann sum of energy consumption (W -> Wh)
  - platform: integration
    source: sensor.power_consumption_hz
    name: energy_consumption_sum_hz
    # unit_prefix: k
    round: 2
    method: left

  # Sensor for Riemann sum of energy import (W -> Wh)
  #  - platform: integration
  #    source: sensor.sh3hz_energy_import
  #    name: sh3hz_energy_import_sum
  #    unit_prefix: k
  #    round: 2
  #    method: left

  ###  Bodenheizung
  - platform: integration
    source: sensor.sh1pm_bh_switch_0_power
    name: summe sh1pm bh power consumption
    method: left
    round: 2

  #### Heizungsumme Integration
  - platform: integration
    source: sensor.summe_heizung_power
    name: summe heizung power consumption
    method: left
    round: 2

  ### Tasmota Heizung
  - platform: integration
    source: sensor.tmhz1_energy_power
    name: summe tmhz1 power consumption
    method: left
    round: 2
  - platform: integration
    source: sensor.tmhz2_energy_power
    name: summe tmhz2 power consumption
    method: left
    round: 2
  - platform: integration
    source: sensor.tmhz3_energy_power
    name: summe tmhz3 power consumption
    method: left
    round: 2
  - platform: integration
    source: sensor.tmhz4_energy_power
    name: summe tmhz4 power consumption
    method: left
    round: 2

  ###  Zimmer Markus
  # Sensor for Riemann sum of energy shhz5 (W -> Wh)
  - platform: integration
    source: sensor.shhz5_switch_0_energy
    name: summe_shhz5_energy_consumption
    unit_prefix: k
    round: 2
    method: left

    # Sensor for Riemann sum of power shhz5 (W -> Wh)
  - platform: integration
    source: sensor.shhz5_switch_0_power
    name: summe_shhz5_power_consumption
    method: left
    round: 2

  # Sensor for Riemann sum of energy import (W -> Wh)
  - platform: integration
    source: sensor.power_import_bo
    name: energy_import_sum_bo
    unit_prefix: k
    round: 2
    method: left

  # Sensor for Riemann sum of energy export (W -> Wh)
  - platform: integration
    source: sensor.power_export_bo
    name: energy_export_sum_bo
    unit_prefix: k
    round: 2
    method: left

  # Sensor for Riemann sum of energy consumption (W -> Wh)
  - platform: integration
    source: sensor.power_consumption_bo
    name: energy_consumption_sum_bo
    #  unit_prefix: k
    round: 2
    method: left

  # Sensor for Riemann sum of energy import (W -> Wh)
  - platform: integration
    source: sensor.sh3boiler_energy_import
    name: sh3boiler_energy_import_sum
    unit_prefix: k
    round: 2
    method: left
  - platform: template
    sensors:
      name: "boiler_daily"
      unit_of_measurement: "kWh"
      unit_prefix: k
      device_class: energy
      state_class: measurement
      round: 2

######################### S e n s o r e n  Platform: Template   Neue Template Schreibweise #######

template:
  #################### Haushalt ####################

  ### sh3em_energy_import von Shelly Haushalt ###
  - sensor:
      - unit_of_measurement: kW
        default_entity_id: sensor.sh3em_energy_import
        availability:
          "{{ [ states('sensor.sh3em_channel_a_energy'), states('sensor.sh3em_channel_b_energy'),
          states('sensor.sh3em_channel_c_energy') ] | map('is_number') | min }}"
        name: SH3EM Energy Import
        state:
          "{% if (states('sensor.sh3em_channel_a_energy')|float(0) + states('sensor.sh3em_channel_b_energy')|float(0)
          + states('sensor.sh3em_channel_c_energy')|float(0)) > 0 %}\n  {{ states('sensor.sh3em_channel_a_energy')|float(0)
          + states('sensor.sh3em_channel_b_energy')|float(0) + states('sensor.sh3em_channel_c_energy')|float(0)
          }}\n{% else %}\n  {{ 0 }}\n{% endif %}"

  ### Power Current Haushalt ###
  - sensor:
      - unit_of_measurement: W
        default_entity_id: sensor.power_current
        availability:
          "{{ [ states('sensor.sh3em_channel_a_power'), states('sensor.sh3em_channel_b_power'),
          states('sensor.sh3em_channel_c_power') ] | map('is_number') | min }}"
        name: Power Current
        state:
          "{{ states('sensor.sh3em_channel_a_power')|float + states('sensor.sh3em_channel_b_power')|float
          + states('sensor.sh3em_channel_c_power')|float }}"

  ### Power Import Haushalt ###
  - sensor:
      - unit_of_measurement: W
        default_entity_id: sensor.power_import
        availability:
          "{{ [ states('sensor.sh3em_channel_a_power'), states('sensor.sh3em_channel_b_power'),
          states('sensor.sh3em_channel_c_power') ] | map('is_number') | min }}"
        name: Power Import
        state:
          "{% if (states('sensor.sh3em_channel_a_power')|float + states('sensor.sh3em_channel_b_power')|float
          + states('sensor.sh3em_channel_c_power')|float) > 0 %}\n  {{ states('sensor.sh3em_channel_a_power')|float
          + states('sensor.sh3em_channel_b_power')|float + states('sensor.sh3em_channel_c_power')|float
          }}\n{% else %}\n  {{ 0 }}\n{% endif %}"

  ### Power Consumption Haushalt ###
  - sensor:
      - unit_of_measurement: W
        default_entity_id: sensor.power_consumption
        name: Power Consumption
        state:
          "{% if (states('sensor.power_export')|float(0)) > 0 and (states('sensor.power_solargen')|float(0)
          - states('sensor.power_export')|float(0)) < 0 %} {% elif (states('sensor.power_export')|float(0))
          > 0 and (states('sensor.power_solargen')|float(0) - states('sensor.power_export')|float(0))
          > 0 %}\n  {{ (states('sensor.power_solargen')|float(0)) - states('sensor.power_export')|float(0)
          }}    \n{% else %}\n  {{ states('sensor.power_import')|float(0) + states('sensor.power_solargen')|float(0)
          }}\n{% endif %}"

  ### Power Export Haushalt ###
  - sensor:
      - unit_of_measurement: W
        default_entity_id: sensor.power_export
        availability:
          "{{ [ states('sensor.sh3em_channel_a_power'), states('sensor.sh3em_channel_b_power'),
          states('sensor.sh3em_channel_c_power') ] | map('is_number') | min }}"
        name: Power Export
        state:
          "{% if (states('sensor.sh3em_channel_a_power')|float + states('sensor.sh3em_channel_b_power')|float
          + states('sensor.sh3em_channel_c_power')|float) < 0 %}\n  {{ (states('sensor.sh3em_channel_a_power')|float
          + states('sensor.sh3em_channel_b_power')|float + states('sensor.sh3em_channel_c_power')|float)
          * -1 }}\n{% else %}\n  {{ 0 }}\n{% endif %}"

  ### Power Solargen Haushalt ###
  - sensor:
      - unit_of_measurement: W
        default_entity_id: sensor.power_solargen
        name: Power Solar Generation
        state:
          "{% if (states('sensor.wr_ac_leistung')|float(0)) > 0 %}\n  {{ (states('sensor.wr_ac_leistung')|float(0)
          -3 ) }}\n{% else %}\n  {{ 0 }}\n{% endif %}"

  ### Solar Plus Haushalt ###
  - sensor:
      - unit_of_measurement: W
        default_entity_id: sensor.solar_plus
        name: Solar Plus
        state:
          "{{ states('sensor.power_solargen')|float(0) - states('sensor.power_consumption')|float(0)
          }}"

  ### Solar Minus Haushalt ###
  - sensor:
      - unit_of_measurement: W
        default_entity_id: sensor.solar_minus
        name: Solar Minus
        state:
          "{{ states('sensor.power_consumption')|float(0) - states('sensor.power_solargen')|float(0)
          }}"

  #################### Heizung ####################

  ### sh3hz_energy_import von Shelly Heizung ###
  - sensor:
      - unit_of_measurement: kW
        default_entity_id: sensor.sh3hz_energy_import
        availability:
          "{{ [ states('sensor.sh3hz_channel_a_energy'), states('sensor.sh3hz_channel_b_energy'),
          states('sensor.sh3hz_channel_c_energy') ] | map('is_number') | min }}"
        name: sh3hz Energy Import
        state:
          "{% if (states('sensor.sh3hz_channel_a_energy')|float(0) + states('sensor.sh3hz_channel_b_energy')|float(0)
          + states('sensor.sh3hz_channel_c_energy')|float(0)) > 0 %}\n  {{ states('sensor.sh3hz_channel_a_energy')|float(0)
          + states('sensor.sh3hz_channel_b_energy')|float(0) + states('sensor.sh3hz_channel_c_energy')|float(0)
          }}\n{% else %}\n  {{ 0 }}\n{% endif %}"

  ### Power Current Heizung ###
  - sensor:
      - unit_of_measurement: W
        default_entity_id: sensor.power_current_hz
        availability:
          "{{ [ states('sensor.sh3hz_channel_a_power'), states('sensor.sh3hz_channel_b_power'),
          states('sensor.sh3hz_channel_c_power') ] | map('is_number') | min }}"
        name: Power Current HZ
        state:
          "{{ states('sensor.sh3hz_channel_a_power')|float + states('sensor.sh3hz_channel_b_power')|float
          + states('sensor.sh3hz_channel_c_power')|float }}"

  ### Power Import Heizung ###
  - sensor:
      - unit_of_measurement: W
        default_entity_id: sensor.power_import_hz
        availability:
          "{{ [ states('sensor.sh3hz_channel_a_power'), states('sensor.sh3hz_channel_b_power'),
          states('sensor.sh3hz_channel_c_power') ] | map('is_number') | min }}"
        name: Power Import HZ
        state:
          "{% if (states('sensor.sh3hz_channel_a_power')|float + states('sensor.sh3hz_channel_b_power')|float
          + states('sensor.sh3hz_channel_c_power')|float) > 0 %}\n  {{ states('sensor.sh3hz_channel_a_power')|float
          + states('sensor.sh3hz_channel_b_power')|float + states('sensor.sh3hz_channel_c_power')|float
          }}\n{% else %}\n  {{ 0 }}\n{% endif %}"

  ### Power Consumption Heizung ###
  - sensor:
      - unit_of_measurement: W
        default_entity_id: sensor.power_consumption_hz
        name: Power Consumption HZ
        state:
          "{% if (states('sensor.power_export_hz')|float(0)) > 0 and (states('sensor.power_solargen_hz')|float(0)
          - states('sensor.power_export_hz')|float(0)) < 0 %} {% elif (states('sensor.power_export_hz')|float(0))
          > 0 and (states('sensor.power_solargen_hz')|float(0) - states('sensor.power_export_hz')|float(0))
          > 0 %}\n  {{ (states('sensor.power_solargen_hz')|float(0)) - states('sensor.power_export_hz')|float(0)
          }}    \n{% elif (states('sensor.power_export_hz')|float(0)) < 0 and (states('sensor.power_solargen_hz')|float(0)
          - states('sensor.power_export_hz')|float(0)) < 0 %}\n  {{ states('sensor.power_import_hz')|float(0)
          }}\n{% else %}\n  {{ states('sensor.power_import_hz')|float(0) + states('sensor.power_solargen_hz')|float(0)
          }}\n{% endif %}"

  ### Power Export Heizung ###
  - sensor:
      - unit_of_measurement: W
        default_entity_id: sensor.power_export_hz
        availability:
          "{{ [ states('sensor.sh3hz_channel_a_power'), states('sensor.sh3hz_channel_b_power'),
          states('sensor.sh3hz_channel_c_power') ] | map('is_number') | min }}"
        name: Power Export HZ
        state:
          "{% if (states('sensor.sh3hz_channel_a_power')|float + states('sensor.sh3hz_channel_b_power')|float
          + states('sensor.sh3hz_channel_c_power')|float) < 0 %}\n  {{ (states('sensor.sh3hz_channel_a_power')|float
          + states('sensor.sh3hz_channel_b_power')|float + states('sensor.sh3hz_channel_c_power')|float)
          * -1 }}\n{% else %}\n  {{ 0 }}\n{% endif %}"

  ### Solar Plus Heizungt ###
  - sensor:
      - unit_of_measurement: W
        default_entity_id: sensor.solar_plus_hz
        name: Solar Plus HZ
        state:
          "{{ states('sensor.power_solargen_hz')|float(0) - states('sensor.power_consumption_hz')|float(0)
          }}"

  ### Solar Minus Heizungt ###
  - sensor:
      - unit_of_measurement: W
        default_entity_id: sensor.solar_minus_hz
        name: Solar Minus HZ
        state:
          "{{ states('sensor.power_consumption_hz')|float(0) - states('sensor.power_solargen_hz')|float(0)
          }}"

  ### Heizung Steckdosen Power ###
  - sensor:
      - unique_id: Heizung_Switche_Power
        unit_of_measurement: W
        default_entity_id: sensor.heizung_switche_power
        name: Heizung Switche Power
        state:
          "{% set ns = namespace(states=[]) %} {% for s in states.sensor %}\n  {%
          if s.object_id.startswith('tmhz') and s.object_id.endswith('_power') %}\n    {%
          set ns.states = ns.states + [ s.state | float(0) ] %}\n  {% endif %}\n{% endfor
          %}     {{ ns.states | sum | round(2) }}"

  ### Heizung Geräte Summe Power (Steckdosen und BH) ###
  - sensor:
      - unit_of_measurement: W
        default_entity_id: sensor.summe_heizung_power
        icon: mdi:speedometer
        name: Summe Heizung Power
        state:
          "{{ (states('sensor.heizung_switche_power')) | float(0) + states('sensor.sh1pm_bh_switch_0_power')
          | float(0) | round(2) }}"


  #################### Boiler ####################

  ### sh3boiler Energy Import von Shelly Boiler ###
  - sensor:
      - unit_of_measurement: kW
        default_entity_id: sensor.sh3boiler_energy_import
        availability:
          "{{ [ states('sensor.sh3boiler_channel_a_energy') ] | map('is_number')
          | min }}"
        name: sh3boiler Energy Import
        state:
          "{% if (states('sensor.sh3boiler_channel_a_energy')|float(0)) > 0 %}\n
          \ {{ states('sensor.sh3boiler_channel_a_energy')|float(0) }}\n{% else %}\n  {{
          0 }}\n{% endif %}"

  ### Power Current Boiler ###
  - sensor:
      - unit_of_measurement: W
        default_entity_id: sensor.power_current_bo
        availability:
          "{{ [ states('sensor.sh3boiler_channel_a_power') ] | map('is_number')
          | min }}"
        name: Power Current_BO
        state: "{{ states('sensor.sh3boiler_channel_a_power')|float }}"

  ### Power Import Boiler ###
  - sensor:
      - unit_of_measurement: W
        default_entity_id: sensor.power_import_bo
        availability:
          "{{ [ states('sensor.sh3boiler_channel_a_power') ] | map('is_number')
          | min }}"
        name: Power Import_BO
        state:
          "{% if (states('sensor.sh3boiler_channel_a_power'))|float > 0 %}\n  {{
          states('sensor.sh3boiler_channel_a_power')|float }}\n{% else %}\n  {{ 0 }}\n{%
          endif %}"

  ### Power Consumption  Boiler ###
  - sensor:
      - unit_of_measurement: W
        default_entity_id: sensor.power_consumption_bo
        name: Power Consumption_BO
        state:
          "{% if (states('sensor.power_import_bo')|float(0)) > 0 %}\n  {{ states('sensor.power_import_bo')|float(0)
          * 1.05 }}\n{% else %}\n  {{ 0 }}\n{% endif %}"

######################### C u s t o m i z e 
homeassistant:
  customize:
    sensor.mystrom_energy_consumption:
      unit_of_measurement: "Wh"
      device_class: energy
    sensor.mystrom_power_consumption:
      unit_of_measurement: "Wh"
      device_class: energy
    sensor.mystrom_power:
      unit_of_measurement: "W"
      device_class: energy

    sensor.summe_switche_power_consumption:
      unit_of_measurement: "Wh"
      device_class: energy
    sensor.summe_switche_power:
      unit_of_measurement: "W"
      device_class: energy
    ##
    # sensor.summe_vom_ewerk_consumption:
    # unit_of_measurement: "Wh"
    # device_class: energy
    # state_class: total
    ##
    sensor.summe_input_vom_ewerk_consumption:
      unit_of_measurement: "Wh"
      device_class: energy
      state_class: measurement
    ##
    sensor.power_consumption:
      unit_of_measurement: "W"
      device_class: energy

    sensor.summe_tmsw1_power_consumption:
      unit_of_measurement: "Wh"
      device_class: energy
    sensor.summe_tmsw2_power_consumption:
      unit_of_measurement: "Wh"
      device_class: energy
    sensor.summe_tmsw3_power_consumption:
      unit_of_measurement: "Wh"
      device_class: energy
    sensor.summe_tmsw4_power_consumption:
      unit_of_measurement: "Wh"
      device_class: energy
    sensor.summe_tmsw5_power_consumption:
      unit_of_measurement: "Wh"
      device_class: energy
    sensor.summe_tmsw6_power_consumption:
      unit_of_measurement: "Wh"
      device_class: energy
    sensor.summe_tmsw7_power_consumption:
      unit_of_measurement: "Wh"
      device_class: energy
    sensor.summe_tmsw8_power_consumption:
      unit_of_measurement: "Wh"
      device_class: energy
    sensor.summe_tmsw9_power_consumption:
      unit_of_measurement: "Wh"
      device_class: energy
    sensor.summe_tmsw10_power_consumption:
      unit_of_measurement: "Wh"
      device_class: energy
    sensor.summe_tmsw11_power_consumption:
      unit_of_measurement: "Wh"
      device_class: energy
    sensor.summe_tmsw12_power_consumption:
      unit_of_measurement: "Wh"
      device_class: energy
    sensor.summe_tmsw13_power_consumption:
      unit_of_measurement: "Wh"
      device_class: energy
    sensor.summe_tmsw14_power_consumption:
      unit_of_measurement: "Wh"
      device_class: energy
    sensor.summe_tmsw15_power_consumption:
      unit_of_measurement: "Wh"
      device_class: energy
    sensor.summe_tmsw16_power_consumption:
      unit_of_measurement: "Wh"
      device_class: energy
    sensor.summe_tmsw16_power_consumption_2:
      unit_of_measurement: "Wh"
      device_class: energy
    sensor.summe_tmsw17_power_consumption:
      unit_of_measurement: "Wh"
      device_class: energy
    sensor.energy_export_daily:
      unit_of_measurement: kWh
      device_class: energy
    sensor.sh3em_energy_import_summe:
      unit_of_measurement: kWh
      evice_class: energy

    ###  Heizung 
    sensor.summe_switche_heizung_consumption:
      unit_of_measurement: "Wh"
      device_class: energy
    sensor.summe_heizung_power:
      unit_of_measurement: "W"
      device_class: energy

    sensor.summe_heizung_power_consumtion:
      unit_of_measurement: "Wh"
      device_class: energy

    sensor.summe_tmhz1_power_consumption:
      unit_of_measurement: "Wh"
      device_class: energy
    sensor.summe_tmhz2_power_consumption:
      unit_of_measurement: "Wh"
      device_class: energy
    sensor.summe_tmhz3_power_consumption:
      unit_of_measurement: "Wh"
      device_class: energy
    sensor.summe_tmhz4_power_consumption:
      unit_of_measurement: "Wh"
      device_class: energy

    sensor.sh1pm_bh_switch_0_power:
      unit_of_measurement: "W"
      device_class: energy

    sensor.summe_sh1pm_bh_power_consumption:
      unit_of_measurement: "Wh"
      device_class: energy

    sensor.summe_shhz5_energy_consumption:
      unit_of_measurement: "Wh"
      device_class: energy

    sensor.summe_shhz5_power_consumption:
      unit_of_measurement: "Wh"
      device_class: energy

    ###  Boiler 

    sensor.energy_import_sum_bo:
      unit_of_measurement: "kWh"
      device_class: energy

    sensor.power_consumption_bo:
      unit_of_measurement: "W"
      device_class: energy

    #### Wetterstation ###
    sensor.wetterstat1_hourly_rain_rate:
      unit_of_measurement: "mm"
      state_class: total_increasing

    sensor.wetterstat1_daily_rain_rate:
      unit_of_measurement: "mm"
      state_class: total_increasing

    sensor.wetterstat1_weekly_rain_rate:
      unit_of_measurement: "mm"
      state_class: total_increasing

    sensor.wetterstat1_monthly_rain_rate:
      unit_of_measurement: "mm"
      state_class: total_increasing

    sensor.wetterstat1_yearly_rain_rate:
      unit_of_measurement: "mm"
      state_class: total_increasing

    sensor.wetterstat1_event_rain_rate:
      unit_of_measurement: "mm"
      state_class: total_increasing

######################### U t i l i t y - M e t e r 
utility_meter:
  energy_daily:
    source: sensor.mystrom_power_consumption
    cycle: daily
  energy_monthly:
    source: sensor.mystrom_power_consumption
    cycle: monthly
  energy_yearly:
    source: sensor.mystrom_power_consumption
    cycle: yearly

  tmsw1_energiy_daily:
    source: sensor.summe_tmsw1_power_consumption
    cycle: daily
  tmsw2_energy_daily:
    source: sensor.summe_tmsw2_power_consumption
    cycle: daily
  tmsw3_energy_daily:
    source: sensor.summe_tmsw3_power_consumption
    cycle: daily
  tmsw4_energy_daily:
    source: sensor.summe_tmsw4_power_consumption
    cycle: daily
  tmsw5_energiy_daily:
    source: sensor.summe_tmsw5_power_consumption
    cycle: daily
  tmsw6_energy_daily:
    source: sensor.summe_tmsw6_power_consumption
    cycle: daily
  tmsw7_energy_daily:
    source: sensor.summe_tmsw7_power_consumption
    cycle: daily
  tmsw8_energy_daily:
    source: sensor.summe_tmsw8_power_consumption
    cycle: daily
  tmsw9_energiy_daily:
    source: sensor.summe_tmsw9_power_consumption
    cycle: daily
  tmsw10_energy_daily:
    source: sensor.summe_tmsw10_power_consumption
    cycle: daily
  tmsw11_energy_daily:
    source: sensor.summe_tmsw11_power_consumption
    cycle: daily
  tmsw12_energy_daily:
    source: sensor.summe_tmsw12_power_consumption
    cycle: daily
  tmsw13_energy_daily:
    source: sensor.summe_tmsw13_power_consumption
    cycle: daily
  tmsw14_energy_daily:
    source: sensor.summe_tmsw14_power_consumption
    cycle: daily
  tmsw15_energy_daily:
    source: sensor.summe_tmsw15_power_consumption
    cycle: daily
  tmsw16_energy_daily:
    source: sensor.summe_tmsw16_power_consumption
    cycle: daily
  tmsw16_energy_daily_2:
    source: sensor.summe_tmsw16_power_consumption_2
    cycle: daily
  tmsw17_energy_daily:
    source: sensor.summe_tmsw17_power_consumption
    cycle: daily

  #   vom_ewerk_daily:
  #     source: sensor.summe_vom_ewerk_consumption
  #     cycle: daily

  #  summe_switche_daily:
  #    source: sensor.summe_switche_power_consumption
  #    cycle: daily

  
  #### Heizung 

  tmhz1_energiy_daily:
    source: sensor.summe_tmhz1_power_consumption
    cycle: daily
  tmhz2_energy_daily:
    source: sensor.summe_tmhz2_power_consumption
    cycle: daily
  tmhz3_energy_daily:
    source: sensor.summe_tmhz3_power_consumption
    cycle: daily
  tmhz4_energy_daily:
    source: sensor.summe_tmhz4_power_consumption
    cycle: daily
  # tmhz5_energiy_daily:
  # source: sensor.summe_tmhz5_power_consumption
  # cycle: daily

  summe_heizung_daily:
    source: sensor.summe_heizung_power_consumption
    cycle: daily

  summe_sh1_bh_power_daily:
    source: sensor.summe_sh1pm_bh_power_consumption
    cycle: daily

  summe_shhz5_energy_daily:
    source: sensor.summe_shhz5_energy_consumption
    cycle: daily

  summe_shhz5_power_daily:
    source: sensor.summe_shhz5_power_consumption
    cycle: daily


  energy_import_daily:
    source: sensor.energy_import_sum
    name: Energy Import Daily
    cycle: daily
  energy_import_monthly:
    source: sensor.energy_import_sum
    name: Energy Import Monthly
    cycle: monthly
  energy_export_daily:
    source: sensor.energy_export_sum
    name: Energy Export Daily
    cycle: daily
  energy_export_monthly:
    source: sensor.energy_export_sum
    name: Energy Export Monthly
    cycle: monthly
  energy_consumption_daily:
    source: sensor.energy_consumption_sum
    name: Energy Consumption Daily
    cycle: daily
  energy_consumption_monthly:
    source: sensor.energy_consumption_sum
    name: Energy Consumption Monthly
    cycle: monthly

  shem3_energy_consumption_daily:
    source: sensor.sh3em_energy_import_summe
    name: SH3EM Energy Consumption Daily
    cycle: daily

  sh3em_energy_import_daily:
    source: sensor.sh3em_energy_import_summe
    name: SH3EM Energy Import Daily
    cycle: daily
  

  ######## Heizung ############

  energy_import_daily_hz:
    source: sensor.energy_import_sum_hz
    name: Energy Import Daily HZ
    cycle: daily
  energy_import_monthly_hz:
    source: sensor.energy_import_sum_hz
    name: Energy Import Monthly HZ
    cycle: monthly
  energy_export_daily_hz:
    source: sensor.energy_export_sum_hz
    name: Energy Export Daily HZ
    cycle: daily
  energy_export_monthly_hz:
    source: sensor.energy_export_sum_hz
    name: Energy Export Monthly HZ
    cycle: monthly
  energy_consumption_daily_hz:
    source: sensor.energy_consumption_sum_hz
    name: Energy Consumption Daily HZ
    cycle: daily
  energy_consumption_monthly_hz:
    source: sensor.energy_consumption_sum_hz
    name: Energy Consumption Monthly HZ
    cycle: monthly

  ###  Boiler 

  energy_import_daily_bo:
    source: sensor.energy_import_sum_bo
    name: Energy Import Daily BO
    cycle: daily
  energy_import_monthly_bo:
    source: sensor.energy_import_sum_bo
    name: Energy Import Monthly BO
    cycle: monthly

  energy_consumption_daily_bo:
    source: sensor.energy_consumption_sum_bo
    name: Energy Consumption Daily BO
    cycle: daily
  energy_consumption_monthly_bo:
    source: sensor.energy_consumption_sum_bo
    name: Energy Consumption Monthly BO
    cycle: monthly

The only thing I notice immediately is that you have a return before each template inside each template entity. You have single line templates and should not have that return.

Sorry, do not now what you mean.
Can you tell me this on one sensor from my code?

You migrated template entities recently, correct?

Yes, but thiis error was before too.
All the sensors work correct, so I do not now, what this error mean

Way, way down under your sensor list
sensor:
most of which are
- platform: integration

you have a platform template (sensor) that looks as if it should be platform integration

I’m going to have a guess that the error means that

sensor:
  - platform: template
    sensors:
      name: "boiler_daily"
      unit_of_measurement: "kWh"
      unit_prefix: k
      device_class: energy
      state_class: measurement
      round: 2

cannot be parsed correctly, if at all?

Thank you so much!

That was exactly the problem.
I must have overlooked it during the template change.

And I don’t even know why I created that “boiler_daily” sensor in the first place.
I’ve commented out that section, and now the error no longer occurs.
I need to think about what I was actually trying to achieve with it…

BR
Hannes

  - platform: template
    sensors:
      name: "boiler_daily"
      unit_of_measurement: "kWh"
      unit_prefix: k
      device_class: energy
      state_class: measurement
      round: 2