Summary
The Min/Max (Sum) helper currently lacks the ability to handle different scales of the same physical dimension (e.g., mixing Wh/kWh, or g/kg) and offers no way to define the output unit or precision directly in the UI.
The Problem
Currently, the Min/Max helper is very strict. If a user tries to combine entities that share the same device_class but use different scales/units, the helper fails.
- Example: Mixing a sensor providing
Whwith one providingkWhleads to anERRstate orUnknown. - Example: Combining weight sensors in
gandkgresults in a calculation error.
Users are currently forced to create “Template Sensors” for every single source just to align units before they can use the helper. This adds significant overhead and complexity (“Bastelei”) for a task that the system could handle natively.
Proposed Feature
I propose making the Min/Max helper “Unit-Aware”:
- Automatic Unit Scaling: If all entities in a group share the same
device_class, the helper should automatically convert them to a common scale (preferably the unit of the first entity) instead of failing. - Target Unit Selection: Add a dropdown in the helper configuration to explicitly define the output unit (e.g., “Always output in kWh” or “Always output in °C”).
- Display Precision: Include a setting to control the number of decimal places directly within the helper configuration.
Benefit
This enhancement would make helpers much more powerful and user-friendly. It removes the need for manual “intermediate” template sensors and aligns the Min/Max helper with Home Assistant’s goal of being configurable via UI without requiring custom code for standard tasks.
Additional Context
This is especially critical for Energy management (mixing solar production data from different vendors) and environment monitoring.