I have studied this Energy dashboard and Solax grid and battery integration
in trying to resolve my problem with setting up the Battery integration in the Energy Dashboard.
I have tried countless ways of configuring the sensor entities and thought I understood how it works but cannot get the battery discharge entity to show as valid in the battery integration when I try to add the battery system.
Here is my relevant code:
sensor:
- platform: template
battry_ch_rate:
friendly_name: "Battery Charge Rate"
value_template: >-
{% if (states.sensor.solaxBatt.attributes['data'][0]['batList'][0]['dataDict'][2].value | float ) > 0 %}
{{ (states.sensor.solaxBatt.attributes['data'][0]['batList'][0]['dataDict'][2].value | float | abs) }}
{% else %}
0
{% endif %}
device_class: power
unit_of_measurement: 'W'
battry_disch_rate:
friendly_name: "Battery Discharge Rate"
value_template: >-
{% if (states.sensor.solaxBatt.attributes['data'][0]['batList'][0]['dataDict'][2].value | float ) < 0 %}
{{ (states.sensor.solaxBatt.attributes['data'][0]['batList'][0]['dataDict'][2].value | float | abs) }}
{% else %}
0
{% endif %}
device_class: power
unit_of_measurement: 'W'
- platform: integration
name: Battery Ch Energy
source: sensor.battry_ch_rate
unit_prefix: k
unit_time: h
round: 2
method: left
- platform: integration
name: Battery Disch Energy
source: sensor.battry_disch_rate
unit_prefix: k
unit_time: h
round: 2
method: left
utility_meter:
# battery_ch_energy:
# source: sensor.battry_ch_rate
# cycle: daily
# battery_disch_energy:
# source: sensor.battry_disch_rate
# cycle: daily
****customize.yaml ****
sensor.battery_ch_energy:
#friendly_name: Battery Charge Energy
device_class: energy
state_class: total_increasing
unit_of_measurement: kWh
last_reset: '1970-01-01T00:00:00+00:00'
sensor.battery_disch_energy:
#friendly_name: Battery Discharge Energy
device_class: energy
state_class: total_increasing
unit_of_measurement: kWh
last_reset: '1970-01-01T00:00:00+00:00'
The entities look correct:
sensor.battery_ch_energy
Battery Ch Energy
2320.26 state_class: total
source: sensor.battry_ch_rate
unit_of_measurement: kWh
device_class: energy
friendly_name: Battery Ch Energy
last_reset: 1970-01-01T00:00:00+00:00
sensor.battery_disch_energy
Battery Disch Energy
2414.34 state_class: total
source: sensor.battry_disch_rate
unit_of_measurement: kWh
device_class: energy
friendly_name: Battery Disch Energy
last_reset: 1970-01-01T00:00:00+00:00
as do the source entities:
sensor.battry_ch_rate
Battery Charge Rate
513.0 unit_of_measurement: W
device_class: power
friendly_name: Battery Charge Rate
sensor.battry_disch_rate
Battery Discharge Rate
0 unit_of_measurement: W
device_class: power
friendly_name: Battery Discharge Rate
Any help in resolving this would be much appreciated.