Hi guys, can someone help here please?
I have the following code working in Developer tools template but when i enter it into my sensor.yaml i get the following
bad indentation of a mapping entry (82:16)
You are missing a space after friendly_name: and before 'Total Solar'
There are other issues.
This has not been a valid option for quite some time. Remove it.
In fact you should not be using that old sensor format for new template sensors. Use the new format:
configuration.yaml (not sensors.yaml)
template:
- sensor:
- name: 'Total Solar'
unit_of_measurement: "kWh"
device_class: energy
state_class: total_increasing # or just "total" if this can decrease
state: "{{ (states('sensor.solar1_daily')|float + states('sensor.solar2_daily')|float)|round(3) }}"
availability: "{{ has_value('sensor.solar1_daily') and has_value('sensor.solar2_daily') }}"