Skip to content

Commit 73afc07

Browse files
authored
Add option for gal/min rate for Home Assistant MQTT Autodiscovery (#3868)
Add gal/min as an option
1 parent c320e4c commit 73afc07

File tree

3 files changed

+14
-6
lines changed

3 files changed

+14
-6
lines changed

code/components/jomjol_flowcontroll/ClassFlowMQTT.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,9 @@ bool ClassFlowMQTT::ReadParameter(FILE* pfile, string& aktparamgraph)
161161
else if (toUpper(splitted[1]) == "WATER_GAL") {
162162
mqttServer_setMeterType("water", "gal", "h", "gal/h");
163163
}
164+
else if (toUpper(splitted[1]) == "WATER_GAL_MIN") {
165+
mqttServer_setMeterType("water", "gal", "min", "gal/min"); // min = Minutes
166+
}
164167
else if (toUpper(splitted[1]) == "GAS_M3") {
165168
mqttServer_setMeterType("gas", "", "h", "m³/h");
166169
}

param-docs/parameter-pages/MQTT/MeterType.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,22 @@ List of supported options:
1111

1212
- `other`
1313
- `water_m3` (uses `m^3/h` as rate)
14-
- `water_l` (uses `l/h` as rate, not officially supported by Homeassistant!)
15-
- `water_gal` (uses `gal/h` as rate, not officially supported by Homeassistant!)
14+
- `water_l` (uses `l/h` as rate) **⚠️ Not supported by Homeassistant 2025.7 and later! ⚠️**
15+
- `water_gal` (uses `gal/h` as rate) **⚠️ Not supported by Homeassistant 2025.7 and later! ⚠️**
16+
- `water_gal_min` (uses `gal/min` as rate)
1617
- `water_ft3` (uses `ft^3/min` as rate)
1718
- `gas_m3` (uses `m^3/h` as rate)
1819
- `gas_ft3` (uses `ft^3/min` as rate)
1920
- `energy_wh` (uses `W` as rate)
2021
- `energy_kwh` (uses `KW` as rate)
2122
- `energy_mwh` (uses `MW` as rate)
22-
- `energy_gj` (uses `GJ/h` as rate, not officially supported by Homeassistant!)
23+
- `energy_gj` (uses `GJ/h` as rate) **⚠️ Not supported by Homeassistant 2025.7 and later! ⚠️**
2324
- `temperature_c` (uses `+C/min` as rate)
2425
- `temperature_f` (uses `°F/min` as rate)
2526
- `temperature_k` (uses `K/min` as rate)
2627

2728
!!! Note
2829
Not all options are supported by Homeassistant, see `SensorDeviceClass.VOLUME_FLOW_RATE` in [https://developers.home-assistant.io/docs/core/entity/sensor/#available-device-classes](https://developers.home-assistant.io/docs/core/entity/sensor/#available-device-classes)!
30+
31+
!!! Warning
32+
Since Homeassistant 2025.7, the unsupported options will no longer work, see change in Homeassistant: [Ensure MQTT sensor has a valid native unit of measurement](https://github.com/home-assistant/core/pull/146722).

sd-card/html/edit_config_template.html

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1183,15 +1183,16 @@ <h4>
11831183
<select class="select_large" id="MQTT_MeterType_value1"> <!-- See https://developers.home-assistant.io/docs/core/entity/sensor/#available-device-classes -->
11841184
<option value="other" selected>Other (no Units)</option>
11851185
<option value="water_m3">Watermeter (Value: m³, Rate: m³/h)</option>
1186-
<option value="water_l">Watermeter (Value: l, Rate: l/h) *Not officially supported by Homeassistant!*</option>
1187-
<option value="water_gal">Watermeter (Value: gal, Rate: gal/h) *Not officially supported by Homeassistant!*</option>
1186+
<option value="water_l">Watermeter (Value: l, Rate: l/h) ⚠️ Not supported by Homeassistant 2025.7 and later! ⚠️</option>
1187+
<option value="water_gal">Watermeter (Value: gal, Rate: gal/h) ⚠️ Not supported by Homeassistant 2025.7 and later! ⚠️</option>
1188+
<option value="water_gal_min">Watermeter (Value: gal, Rate: gal/min)</option>
11881189
<option value="water_ft3">Watermeter (Value: ft³, Rate: ft³/min)</option>
11891190
<option value="gas_m3">Gasmeter (Value: m³, Rate: m³/h)</option>
11901191
<option value="gas_ft3">Gasmeter (Value: ft³, Rate: ft³/min)</option>
11911192
<option value="energy_wh">Energymeter (Value: Wh, Rate: W)</option>
11921193
<option value="energy_kwh">Energymeter (Value: kWh, Rate: kW)</option>
11931194
<option value="energy_mwh">Energymeter (Value: MWh, Rate: MW)</option>
1194-
<option value="energy_gj">Energymeter (Value: GJ, Rate: GJ/h) *Not officially supported by Homeassistant!*</option>
1195+
<option value="energy_gj">Energymeter (Value: GJ, Rate: GJ/h) ⚠️ Not supported by Homeassistant 2025.7 and later! ⚠️</option>
11951196
<option value="temperature_c">Thermometer (Value: °C, Rate: °C/min)</option>
11961197
<option value="temperature_c">Thermometer (Value: °F, Rate: °F/min)</option>
11971198
<option value="temperature_c">Thermometer (Value: K, Rate: K/min)</option>

0 commit comments

Comments
 (0)