Hi,
i add different sensors in the configuration.yaml (using HA 2023 actual on Raspberry Pi) to set energy-values on state (devices without measurement function). The single values are OK and visible.
now I add a new sensor with the result of 4 sensors (which works as single).
When I try to add the total sensor I failed with “unavaiable”.
here my definitions:
sensor:
# Stromkalkulation für Apple Geräte
- platform: powercalc
name: "Apple TV Wohnzimmer"
entity_id: media_player.appletv
unique_id: "AppleTVWohnzimmerStromverbrauchPowercalc"
standby_power: 1.2
fixed:
states_power:
standby: 1.2
paused: 1.2
idle: 2.1
playing: 4.0
#Meross Steckdosen Wohnzimmer
- platform: powercalc
name: "Licht Erker"
entity_id: switch.smart_switch_wz_light_bay_outlet
unique_id: "LichtErkerStromverbrauchPowercalc"
standby_power: 0.6
fixed:
power: 8.2
- platform: powercalc
name: "Licht Sofa links"
entity_id: switch.smart_switch_seat_left_outlet
unique_id: "LichtSofaLinksStromverbrauchPowercalc"
standby_power: 0.6
fixed:
power: 4.2
- platform: powercalc
name: "Licht Sofa rechts"
entity_id: switch.smart_switch_seat_right_outlet
unique_id: "LichtSofaRechtsStromverbrauchPowercalc"
standby_power: 0.6
fixed:
power: 8.2
# Energie addieren Wohnzimmer
- platform: template
sensors:
wz_energy_total:
friendly_name: 'Wohnzimmer Total Energy'
entity_id: sensor.wz_total_energy
unique_id: "WohnzimmerTotalEnergy"
value_template: "{{ (states('sensor.licht_erker_energy')|float + states('sensor.licht_sofa_links_energy')|float + states('sensor.licht_sofa_rechts_energy')|float + + states('sensor.appe_tv_wohnzimmer_energy')|float)|round(3) }}"
unit_of_measurement: "kWh"
wz_power_total:
friendly_name: 'Wohnzimmer Total Power'
entity_id: sensor.wz_total_power
unique_id: "WohnzimmerTotalPower"
value_template: "{{ (states('sensor.licht_erker_power')|float + states('sensor.licht_sofa_links_power')|float + states('sensor.licht_sofa_rechts_power')|float + + states('sensor.apple_tv_wohnzimmer_power')|float)|round(3) }}"
unit_of_measurement: "W"
Where is my error, or what have I done wrong?