Skip to content

Have separate sensors for battery charge/discharge #543

Answered by slipx06
pameruoso asked this question in Q&A
Discussion options

You must be logged in to vote

Hi. Quick fix is to just create a template sensor.

template:
  - sensor:
      - name: "Battery Power"
        unique_id: battery_power
        device_class: "power"
        unit_of_measurement: "W" 
        icon: mdi:battery
        state_class: measurement
        state: >
          {% set charge = states('sensor.battery_charge') | float %}
          {% set discharge = states('sensor.battery_discharge') | float %}
          {{ (discharge - charge) |float(0)|round(0) }}

Replies: 6 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Answer selected by slipx06
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@Grosi001
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
type/feature A minor change
3 participants
Converted from issue

This discussion was converted from issue #517 on October 28, 2024 17:42.