I’m new to HA and currently trying add my SolarEdge site into the UI. By default the unit is W or Wh but I’d like to have kW and kWh, the SolarEdge page on the HA site gives some indications but I believe the example is incorrect as copy pasting throws an error.
Anyway, here’s what I currently have, unfortunately the template sensor is not showing up, I’m not sure where to look if there’s any logging that could explain what is going wrong. (Config validation was OK).
Assuming this is a direct copy from your config, you can’t have multiple definitions/iterations of sensor:
You need to watch your indentations which are crucial in HA. There are a few indentation issues with your code
Either use '{{states("sensor.sensorname")}}' or '{{states.sensor.sensorname.state}}' with a preference for the first one which will handle when your sensor has an unknown state instead of throwing an error