Template error with reverse proxy

Adding this to the config:

template:
  - sensor:
    - name: 'Total power usage'
      device_class: energy
      unit_of_measurement: 'W'
      state: > {{ (states('sensor.powermeter_power_0')|float(0) + states('sensor.powermeter_power_1')|float(0) + states('sensor.powermeter_power_2')|float(0))}}

gives the following error:

homeassistant | 2022-07-11 21:27:02 ERROR (MainThread) [homeassistant.components.http.forwarded] A request from a reverse proxy was received from 172.18.0.4, but your HTTP integration is not set-up for reverse proxies

Homeassistant ist running on Docker behind Traefik without that template config without a problem.

This there anything wrong with my template code?

Well first off,

template:
  - sensor:
    - name: 'Total power usage'
      device_class: energy
      unit_of_measurement: 'W'
      state: > 
           {{ (states('sensor.powermeter_power_0')|float(0) + states('sensor.powermeter_power_1')|float(0) + states('sensor.powermeter_power_2')|float(0))}}

The part after the ‘>’ should be on a new line and indented…

and I don’t think that error is related to your template.

Hi Rob,
you are right, indeed it wasn’t the template code causing the error. It was another part that somehow worked without the template code, but malfunctioning with the template code present. Thanks for confirming the template was configured right.