Compare commits

..

5 Commits

Author SHA1 Message Date
SybexXx
f3e3ce504e setup_fix (#3906)
* Update edit_config_template.html

* Update edit_config_template.html
2025-09-07 17:47:40 +02:00
SybexXx
ba03a7dc38 Migration fix (#3900)
* Update main.cpp

During migration, the messages was issued as errors, although this should be information/should serve for information.

* Update main.cpp

* Update Helper.cpp
2025-09-02 22:06:07 +02:00
Rick Auch
73afc07652 Add option for gal/min rate for Home Assistant MQTT Autodiscovery (#3868)
Add gal/min as an option
2025-08-17 15:27:21 +02:00
Bruns8234
c320e4c921 Update SDCard Manufacturer List (#3730)
Update 1 and added 5 entries
2025-05-05 23:55:10 +02:00
CaCO3
43b29f3408 clarify the parameter prefix (#3717)
Co-authored-by: CaCO3 <caco@ruinelli.ch>
2025-04-23 00:01:37 +02:00
5 changed files with 65 additions and 15 deletions

View File

@@ -161,6 +161,9 @@ bool ClassFlowMQTT::ReadParameter(FILE* pfile, string& aktparamgraph)
else if (toUpper(splitted[1]) == "WATER_GAL") {
mqttServer_setMeterType("water", "gal", "h", "gal/h");
}
else if (toUpper(splitted[1]) == "WATER_GAL_MIN") {
mqttServer_setMeterType("water", "gal", "min", "gal/min"); // min = Minutes
}
else if (toUpper(splitted[1]) == "GAS_M3") {
mqttServer_setMeterType("gas", "", "h", "m³/h");
}

View File

@@ -806,11 +806,21 @@ struct SDCard_Manufacturer_database sd_database[] = {
.id = 0x03,
.manufacturer = "SanDisk",
},
{
.type = "sd",
.id = 0x05,
.manufacturer = "Lenovo",
},
{
.type = "sd",
.id = 0x08,
.manufacturer = "Silicon Power",
},
{
.type = "sd",
.id = 0x09,
.manufacturer = "ATP",
},
{
.type = "sd",
.id = 0x18,
@@ -894,7 +904,27 @@ struct SDCard_Manufacturer_database sd_database[] = {
{
.type = "sd",
.id = 0x89,
.manufacturer = "Unknown",
.manufacturer = "Netac",
},
{
.type = "sd",
.id = 0x9f,
.manufacturer = "Kingston/Kodak/Silicon Power",
},
{
.type = "sd",
.id = 0xad,
.manufacturer = "Amazon Basics/Lexar/OV",
},
{
.type = "sd",
.id = 0xdf,
.manufacturer = "Lenovo",
},
{
.type = "sd",
.id = 0xfe,
.manufacturer = "Bekit/Cloudisk/HP/Reletech",
},
};
@@ -1218,7 +1248,7 @@ bool replaceString(std::string &s, std::string const &toReplace, std::string con
if (logIt)
{
LogFile.WriteToFile(ESP_LOG_ERROR, TAG, "Migrated Configfile line '" + old + "' to '" + s + "'");
LogFile.WriteToFile(ESP_LOG_INFO, TAG, "Migrated Configfile line '" + old + "' to '" + s + "'");
}
return true;

View File

@@ -635,7 +635,7 @@ void migrateConfiguration(void) {
CamZoom_value = false;
}
else {
ESP_LOGE(TAG, "splitted[1]: %s", splitted[1].c_str());
// ESP_LOGI(TAG, "splitted[1]: %s", splitted[1].c_str());
CamZoom_value = alphanumericToBoolean(splitted[1]);
}
CamZoom_found = true;
@@ -858,22 +858,22 @@ void migrateConfiguration(void) {
else {
configLines[CamZoom_lines] = ("CamZoom = false");
}
LogFile.WriteToFile(ESP_LOG_ERROR, TAG, "Migrated Configfile line 'Zoom' to 'CamZoom'");
LogFile.WriteToFile(ESP_LOG_INFO, TAG, "Migrated Configfile line 'Zoom' to 'CamZoom'");
migrated = true;
}
if (CamZoomSize_lines > 0) {
configLines[CamZoomSize_lines] = ("CamZoomSize = " + std::to_string(CamZoomSize_value));
LogFile.WriteToFile(ESP_LOG_ERROR, TAG, "Migrated Configfile line 'ZoomMode' to 'CamZoomSize'");
LogFile.WriteToFile(ESP_LOG_INFO, TAG, "Migrated Configfile line 'ZoomMode' to 'CamZoomSize'");
migrated = true;
}
if (CamZoomOffsetX_lines > 0) {
configLines[CamZoomOffsetX_lines] = ("CamZoomOffsetX = " + std::to_string(CamZoomOffsetX_value));
LogFile.WriteToFile(ESP_LOG_ERROR, TAG, "Migrated Configfile line 'ZoomOffsetX' to 'CamZoomOffsetX'");
LogFile.WriteToFile(ESP_LOG_INFO, TAG, "Migrated Configfile line 'ZoomOffsetX' to 'CamZoomOffsetX'");
migrated = true;
}
if (CamZoomOffsetY_lines > 0) {
configLines[CamZoomOffsetY_lines] = ("CamZoomOffsetY = " + std::to_string(CamZoomOffsetY_value));
LogFile.WriteToFile(ESP_LOG_ERROR, TAG, "Migrated Configfile line 'ZoomOffsetY' to 'CamZoomOffsetY'");
LogFile.WriteToFile(ESP_LOG_INFO, TAG, "Migrated Configfile line 'ZoomOffsetY' to 'CamZoomOffsetY'");
migrated = true;
}
}

View File

@@ -11,18 +11,22 @@ List of supported options:
- `other`
- `water_m3` (uses `m^3/h` as rate)
- `water_l` (uses `l/h` as rate, not officially supported by Homeassistant!)
- `water_gal` (uses `gal/h` as rate, not officially supported by Homeassistant!)
- `water_l` (uses `l/h` as rate) **⚠️ Not supported by Homeassistant 2025.7 and later! ⚠️**
- `water_gal` (uses `gal/h` as rate) **⚠️ Not supported by Homeassistant 2025.7 and later! ⚠️**
- `water_gal_min` (uses `gal/min` as rate)
- `water_ft3` (uses `ft^3/min` as rate)
- `gas_m3` (uses `m^3/h` as rate)
- `gas_ft3` (uses `ft^3/min` as rate)
- `energy_wh` (uses `W` as rate)
- `energy_kwh` (uses `KW` as rate)
- `energy_mwh` (uses `MW` as rate)
- `energy_gj` (uses `GJ/h` as rate, not officially supported by Homeassistant!)
- `energy_gj` (uses `GJ/h` as rate) **⚠️ Not supported by Homeassistant 2025.7 and later! ⚠️**
- `temperature_c` (uses `+C/min` as rate)
- `temperature_f` (uses `°F/min` as rate)
- `temperature_k` (uses `K/min` as rate)
!!! Note
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)!
!!! Warning
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).

View File

@@ -1183,15 +1183,16 @@
<select class="select_large" id="MQTT_MeterType_value1"> <!-- See https://developers.home-assistant.io/docs/core/entity/sensor/#available-device-classes -->
<option value="other" selected>Other (no Units)</option>
<option value="water_m3">Watermeter (Value: m³, Rate: m³/h)</option>
<option value="water_l">Watermeter (Value: l, Rate: l/h) *Not officially supported by Homeassistant!*</option>
<option value="water_gal">Watermeter (Value: gal, Rate: gal/h) *Not officially supported by Homeassistant!*</option>
<option value="water_l">Watermeter (Value: l, Rate: l/h) ⚠️ Not supported by Homeassistant 2025.7 and later! ⚠️</option>
<option value="water_gal">Watermeter (Value: gal, Rate: gal/h) ⚠️ Not supported by Homeassistant 2025.7 and later! ⚠️</option>
<option value="water_gal_min">Watermeter (Value: gal, Rate: gal/min)</option>
<option value="water_ft3">Watermeter (Value: ft³, Rate: ft³/min)</option>
<option value="gas_m3">Gasmeter (Value: m³, Rate: m³/h)</option>
<option value="gas_ft3">Gasmeter (Value: ft³, Rate: ft³/min)</option>
<option value="energy_wh">Energymeter (Value: Wh, Rate: W)</option>
<option value="energy_kwh">Energymeter (Value: kWh, Rate: kW)</option>
<option value="energy_mwh">Energymeter (Value: MWh, Rate: MW)</option>
<option value="energy_gj">Energymeter (Value: GJ, Rate: GJ/h) *Not officially supported by Homeassistant!*</option>
<option value="energy_gj">Energymeter (Value: GJ, Rate: GJ/h) ⚠️ Not supported by Homeassistant 2025.7 and later! ⚠️</option>
<option value="temperature_c">Thermometer (Value: °C, Rate: °C/min)</option>
<option value="temperature_c">Thermometer (Value: °F, Rate: °F/min)</option>
<option value="temperature_c">Thermometer (Value: K, Rate: K/min)</option>
@@ -2676,7 +2677,19 @@ function saveTextAsFile() {
WriteConfigININew();
SaveConfigToServer(domainname);
firework.launch('Configuration saved. It will get applied after the next reboot!<br><br>\n<a id="reboot_button" onclick="doReboot()">reboot now</a>', 'success', 5000);
if(window.location.hash) {
var hash = window.location.hash.substring(1); //Puts hash in variable, and removes the # character
if(hash == 'description') {
firework.launch('Configuration saved.', 'success', 2000);
}
else {
firework.launch('Configuration saved. It will get applied after the next reboot!<br><br>\n<a id="reboot_button" onclick="doReboot()">reboot now</a>', 'success', 5000);
}
}
else {
firework.launch('Configuration saved. It will get applied after the next reboot!<br><br>\n<a id="reboot_button" onclick="doReboot()">reboot now</a>', 'success', 5000);
}
if (changeCamValue == 1) {
camSettingsSet();
@@ -3331,7 +3344,7 @@ function openDescription() {
if(hash == 'description') {
document.getElementById("desc_details").open = true;
document.getElementById("reboot").style.display = "none";
// document.getElementById("reboot").style.display = "none";
document.getElementById("reboot_text").style.display = "none";
}
}