Maybe someone came across this. I can’t add a second energy sensor, it gives an error
Invalid config for ‘integration’ from integration ‘sensor’ at configuration.yaml, line 65: Entity ID my_sensor_ac_in_watt_2 is an invalid entity ID for dictionary value ‘source’, got ‘my_sensor_ac_in_watt_2’
# Loads default set of integrations. Do not remove.
default_config:
# Load frontend themes from the themes folder
frontend:
themes: !include_dir_merge_named themes
automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml
panel_custom:
- name: server_state
sidebar_title: 'System'
sidebar_icon: mdi:server
js_url: /api/hassio/app/entrypoint.js
url_path: 'hassio/system'
embed_iframe: true
require_admin: true
config:
ingress: core_configurator
template:
- sensor:
- name: "my_sensor_ac_in_watt_2"
unit_of_measurement: 'W'
unique_id: 89789421231236541562416
device_class: energy
state: >
{% set calculated_value = states("sensor.solar2mqtt_ac_out_watt") | float(0) - states("sensor.solar2mqtt_pv_charging_power") | float(0) %}
{{ calculated_value if calculated_value > 0 else 0 }}
state_class: total_increasing
sensor:
- platform: integration
source: sensor.solar2mqtt_pv_charging_power
name: solar_energy_spent
unique_id: 45648974121654654dsd
unit_prefix: k
round: 2
- platform: integration
source: my_sensor_ac_in_watt_2
name: power_energy_spent
unique_id: 56465465465465654564
unit_prefix: k
round: 2