Units for energy consumption by distance #1163
-
Home Assistant currently has no units for measuring energy consumption by distance (e.g., kWh/100km or mi/kWh). Energy consumption per time unit , e.g. kWh/h is usually written as kW so that is already covered. Energy consumed by electric cars is typically measured in kWh/100km in Europe and in mi/kWh in US/Canada. This is similar to fuel consumption with l/10km in Europe and miles/gallon in US/Canada. I have a draft PR introducing energy distance units supporting all these units and conversion between them. ProposalAdd an
Preliminary code available at home-assistant/core@dev...jschlyter:home-assistant:energy_distance_units with conversion between any of the three units above. Integrations which can benefit from the proposalIntegrations that can benefit are primarily for electric vehicles.
Other workTo be consistent one can also consider a Pull Requests |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 8 replies
-
Hi there @jschlyter 👋 Thanks for opening an arch discussion. The proposal makes sense in a way. However, we only want to add support for things like this. There are multiple integrations available in our current core codebase that can leverage this. Which ones would those be? ../Frenck |
Beta Was this translation helpful? Give feedback.
-
I suggest we add a more generic support for inverse units while doing this. There's some sample code in https://github.com/jschlyter/home-assistant/blob/9ef4b3c766e2c05596a88b6bc4744926a02614f9/homeassistant/util/unit_conversion.py#L248 and similar for |
Beta Was this translation helpful? Give feedback.
-
Any updates on this issue? Is there anything I can do to move things ahead? |
Beta Was this translation helpful? Give feedback.
-
@jschlyter we discussed the proposal, while we're positive it's too vague to make a decision on. Please update it so it's clear:
This proposal is a good reference: #1124 |
Beta Was this translation helpful? Give feedback.
-
The proposal has been approved in the core architectural meeting, but excluding |
Beta Was this translation helpful? Give feedback.
The proposal has been approved in the core architectural meeting, but excluding
kWh/100mi
, since that does not seem common. Do we have examples ofkWh/100mi
being used? If not, lets remove it from the proposal so we can move forward.