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

[BUG] Some battery sensors are missing the unit of measurement #386

Open
hapklaar opened this issue Jan 12, 2025 · 2 comments
Open

[BUG] Some battery sensors are missing the unit of measurement #386

hapklaar opened this issue Jan 12, 2025 · 2 comments
Labels
bug Something isn't working

Comments

@hapklaar
Copy link

Go Hass Agent Version
v11.1.2

Describe the bug
Both the `Battery Energy' and 'Battery Voltage' entities are missing their unit of measurement
For me these are the following entities:
sensor.clockworkpi_axp20x_battery_battery_energy
sensor.clockworkpi_axp20x_battery_battery_voltage

To Reproduce

  1. Register sensors
  2. Energy and Voltage entities have no unit of measurement, resulting in the history showing a history bar instead of graph

Expected behaviour
Entities to have a unit of measurement

Screenshots
image

Additional context
I assume this is enough info, if not please let me know!

@hapklaar hapklaar added the bug Something isn't working label Jan 12, 2025
@joshuar
Copy link
Owner

joshuar commented Jan 20, 2025

Hey thanks for reporting this issue and trying out Go hass Agent.

Hmm, this might be a kind of regression. I hadn't intended to expose sensors for battery voltage or energy, these should be attributes of the energy rate (power) sensor (if available). I can't understand from my own code how they managed to leak out as their own sensors...

Having said that, would it be useful to see these as individual sensors? I was originally following what the Home Assistant Android app does for batteries, which is to just show expose power and level sensors, with voltage and energy being attributes of the former. Is having them as a separate sensor adding value? Note that as attributes, you could still plot them in a dashboard.

I don't have a strong opinion on this, but I'd probably side with sticking with what the Android app does (fix/leave them as attributes).

@hapklaar
Copy link
Author

Hi. Yes these sensors are actually very useful to me, especially the voltage sensor. Haven't tried using the attribute value, but if I'm not mistaken I would have to create a special sensor to be able to graph the value. I very much like at least voltage to be a separate sensor.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants