Skip to content

Battery with a different sensor for charge and discharge #333

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

You must be logged in to vote

Hi. You need to create a template sensor that does this. I think it may have been asked here before but if not you can also find examples on the HA forum. Something like the below

sensor:
  - platform: template
    sensors:
      battery_power_combined:
        friendly_name: "Battery Power Combined"
        unit_of_measurement: "W"
        device_class: "Power"
        value_template: >-
          {% set charge_power = states('sensor.battery_charge_power') | float %}
          {% set discharge_power = states('sensor.battery_discharge_power') | float %}
          {% if charge_power > 0 %}
            {{ -charge_power }}
          {% elif discharge_power > 0 %}
            {{ discharge_pow…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@SNAPE15
Comment options

@slipx06
Comment options

@SNAPE15
Comment options

Answer selected by SNAPE15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants