Improvements to remote temp, auto clear time for MiElHVAC (#22379)

* Add prohibit function for MiElHVAC

Add Prohibit functions:
* Power
* Temperature
* Mode
 and all combinations of this functions
Updated VaneV names for better identify

* Fixed Compressor and Operation for MiElHVAC

Changed Widevane position name from ISEE to AUTO sam as in MELCLoud

* Revert "Fixed Compressor and Operation for MiElHVAC"

This reverts commit f0973c84d4.

* New feature for MiElHVAC

* Added Compressor map
* Added Operation Power in Watts
* Added Operation Energy in kWh
* Changed Widevane position name from ISEE to AUTO, displays sam as in
* Changed all map value to lover case MELCloud

* New feature for MiElHVAC

* Add device operation time in minutes

* New feature Outdoor Temperature for MiElHVAC

* Add Outdoor Temperature

* New feature Compressor Frequency for MiElHVAC

* Added Outdoor Temperature
* Renamed internal properties due typo operating and oprating to operation

* New feature Auto Clear Remote Temp for MiElHVAC

* This PR add auto clear remote temperature function
* This funcion is call on first run and after 10 sec the remote temperature stop refresh its value
* Send manually Clear command is also available

* change function name, small corrections

* added auto clear time configurable using cmnd

* Improvements to remote temp, auto clear time for MiElHVAC

* Added min = 1000ms and max 600000ms limit to remotetemp auto clear time function
* Changed function name to use sam format as other
* Added RemoteTemperatureSensor to the sensor

* more improvements to auto clear time

* Changed RemoteTemperatureSensor to RemoteTemperatureSensorState
* Added RemoteTemperatureSensorAutoClearTime to the sensor output
This commit is contained in:
Grzegorz 2024-10-29 08:25:44 +01:00 committed by GitHub
parent fc0dc5dfec
commit 18bfda50ab
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 13 additions and 5 deletions

View File

@ -949,7 +949,7 @@ miel_hvac_remotetemp_degc2old(long degc)
}
static void
miel_hvac_auto_clear_remotetemp(void)
miel_hvac_remotetemp_auto_clear(void)
{
struct miel_hvac_softc *sc = miel_hvac_sc;
struct miel_hvac_msg_remotetemp *rt = &sc->sc_remotetemp;
@ -972,7 +972,7 @@ miel_hvac_cmnd_remotetemp_auto_clear_time(void)
return;
unsigned long clear_time = strtoul(XdrvMailbox.data, nullptr, 10);
if (clear_time == 0) {
if (clear_time < 1000 || clear_time > 600000) {
miel_hvac_respond_unsupported();
return;
}
@ -997,7 +997,6 @@ miel_hvac_cmnd_remotetemp(void)
degc = 0;
ResponseCmndChar_P("clear");
remotetemp_clear = false;
remotetemp_last_call_time = 0;
} else {
degc = strtol(XdrvMailbox.data, nullptr, 0);
@ -1009,7 +1008,6 @@ miel_hvac_cmnd_remotetemp(void)
degc = MIEL_HVAC_REMOTETEMP_MAX;
ResponseCmndNumber(degc);
remotetemp_clear = true;
remotetemp_last_call_time = millis();
}
@ -1027,6 +1025,8 @@ miel_hvac_cmnd_remotetemp(void)
rt->temp_old = miel_hvac_remotetemp_degc2old(degc);
rt->temp = (degc + MIEL_HVAC_REMOTETEMP_OFFSET) *
MIEL_HVAC_REMOTETEMP_OLD_FACTOR;
remotetemp_clear = control == MIEL_HVAC_REMOTETEMP_SET ? true : false;
}
#ifdef MIEL_HVAC_DEBUG
@ -1406,6 +1406,14 @@ miel_hvac_sensor(struct miel_hvac_softc *sc)
ResponseAppend_P(PSTR(",\"Temperature\":\"%s\""),
room_temp);
ResponseAppend_P(PSTR(",\"RemoteTemperatureSensorState\":\"%s\""),
remotetemp_clear ? "ON" : "OFF");
char remotetempautocleartime[33];
ultoa(remotetemp_auto_clear_time, remotetempautocleartime, 10);
ResponseAppend_P(PSTR(",\"RemoteTemperatureSensorAutoClearTime\":\"%s\""),
remotetempautocleartime);
if(rt->outdoortemp > 1) {
char outdoor_temp[33];
float temp = miel_hvac_outdoortemp2deg(rt->outdoortemp);
@ -1636,7 +1644,7 @@ bool Xdrv44(uint32_t function) {
case FUNC_EVERY_200_MSECOND:
case FUNC_EVERY_SECOND:
if (remotetemp_clear && ((millis() - remotetemp_last_call_time) > remotetemp_auto_clear_time || remotetemp_last_call_time == 0)) {
miel_hvac_auto_clear_remotetemp();
miel_hvac_remotetemp_auto_clear();
}
break;