Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Wh #45

Open
janneho opened this issue Sep 9, 2024 · 1 comment
Open

Add support for Wh #45

janneho opened this issue Sep 9, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@janneho
Copy link

janneho commented Sep 9, 2024

Is your feature request related to a problem? Please describe.
I have a EV charger that reports energy in Wh.

Describe the solution you'd like
Use unit of measurement (kWh or Wh) in calculations. Now integration assumes that energy is in kWh.
Energy panel works fine with Wh.

@janneho janneho added the enhancement New feature or request label Sep 9, 2024
@martinarva
Copy link
Owner

I would recommend to make a Wh -> kWh template sensor
`template:

  • sensor:
    • name: "Energy Consumption kWh"
      unique_id: "energy_consumption_kwh"
      state: >-
      {% set wh = states('sensor.energy_consumption_wh') | float(0) %}
      {{ (wh / 1000) | round(2) }}
      unit_of_measurement: "kWh"
      state_class: measurement
      device_class: energy
      icon: mdi:lightning-bolt`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants