BMS_BLE-HA icon indicating copy to clipboard operation
BMS_BLE-HA copied to clipboard

Energy Dashboard

Open ThomasCr opened this issue 1 year ago • 3 comments

Checklist

  • [X] I need support with using the integration.
  • [X] My issue is not a feature request
  • [X] I'm not avoiding to fill out the bug report form.

Describe the issue

Hi, can anybody give a hint, how to integrate the battery into the Energy Dashboard?

https://www.home-assistant.io/docs/energy/battery/

I mean, do I really need a extra energy sensor to measure In and Out values? Or can anybody give a hint how to create a template?

Regards, Thomas

ThomasCr avatar Sep 19 '24 19:09 ThomasCr

You can use for power out a template sensor: {{ [states("sensor.smartbat_..._power") | float(0) *-1, 0] | max}} and for power in: {{ [states("sensor.smartbat_..._power") | float(0), 0] | max}} both with Unit of measurement W Device class power State class measurement Then create via the helpers an integration sensor for each of the above template sensors. You can then add the template sensors as in/out to the energy dashboard in the category battery.

patman15 avatar Sep 20 '24 16:09 patman15

ok, Step 1 looks like this:

  - sensor:

    - name: "DWCE00531J-029 Leistung Rein"
      unique_id: "dwce00531j_029_leistung_in"
      state: '{{ [states("sensor.dwce00531j_029_leistung") | float(0) *-1, 0] | max}}'
      unit_of_measurement: "W"
      device_class: "power"
      state_class: "measurement"

    - name: "DWCE00531J-029 Leistung Raus"
      unique_id: "dwce00531j_029_leistung_out"
      state: ' {{ [states("sensor.dwce00531j_029_leistung") | float(0), 0] | max}}'
      unit_of_measurement: "W"
      device_class: "power"
      state_class: "measurement"

But how I should do the helper with the integral sensor?

And should the Items not be of unit_of_measurement: (K)Wh and state_class: total_increasing?

ThomasCr avatar Sep 21 '24 10:09 ThomasCr

Ok, schaut gut aus. :+1:

You could have done it using the GUI, but YAML works as well. Next is to generate one integration sensor for each, or via YAML. This will then result in (k)Wh so you can add to the energy dashboard.

patman15 avatar Sep 21 '24 12:09 patman15

This issue is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 15 days.

github-actions[bot] avatar Nov 06 '24 02:11 github-actions[bot]

This issue was closed because it has been stalled for 15 days with no activity.

github-actions[bot] avatar Nov 21 '24 02:11 github-actions[bot]