From 339b8a0b961c25a235afa64b9a1a80263fe30719 Mon Sep 17 00:00:00 2001 From: Frederik <5511687+fightforlife@users.noreply.github.com> Date: Thu, 24 Nov 2022 18:19:12 +0100 Subject: [PATCH 1/2] fix hassmode, idle no longer supported --- .../xdrv_85_esp32_ble_eq3_trv.ino | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/tasmota/tasmota_xdrv_driver/xdrv_85_esp32_ble_eq3_trv.ino b/tasmota/tasmota_xdrv_driver/xdrv_85_esp32_ble_eq3_trv.ino index 67103ce35..f9bb90a94 100644 --- a/tasmota/tasmota_xdrv_driver/xdrv_85_esp32_ble_eq3_trv.ino +++ b/tasmota/tasmota_xdrv_driver/xdrv_85_esp32_ble_eq3_trv.ino @@ -480,16 +480,18 @@ int EQ3ParseOp(BLE_ESP32::generic_sensor_t *op, bool success, int retries){ ResponseAppend_P(PSTR(",\"hassmode\":")); do { + //HASS allowed modes [“auto”, “off”, “cool”, “heat”, “dry”, “fan_only”] //0201283B042A - // its in auto + // If its in auto or holiday, set to auto if ((stat & 3) == 0) { ResponseAppend_P(PSTR("\"auto\"")); break; } - // it's set to 'OFF' + // If its in manual and 4.5°C, set to off if (((stat & 3) == 1) && (status[5] == 9)) { ResponseAppend_P(PSTR("\"off\"")); break; } - // it's actively heating (valve open) + // If its in manual above 4.5°C and valve is open, set to heat if (((stat & 3) == 1) && (status[5] > 9) && (status[3] > 0)) { ResponseAppend_P(PSTR("\"heat\"")); break; } - // it's achieved temp (valve closed) - if (((stat & 3) == 1) && (status[5] > 9)) { ResponseAppend_P(PSTR("\"idle\"")); break; } - ResponseAppend_P(PSTR("\"idle\"")); + // If its in manual above 4.5°C and valve is closed, set to off + if (((stat & 3) == 1) && (status[5] > 9) && (status[3] > 0)) { ResponseAppend_P(PSTR("\"off\"")); break; } + //Fallback off + ResponseAppend_P(PSTR("\"off\"")); break; } while (0); @@ -1271,16 +1273,16 @@ int EQ3Send(const uint8_t* addr, const char *cmd, char* param, char* param2, int if (!strcmp(param, "auto")){ d[1] = 0x00; } - if (!strcmp(param, "manual")){ + if (!strcmp(param, "manual") || !strcmp(param, "heat" )){ d[1] = 0x40; } - if (!strcmp(param, "on") || !strcmp(param, "heat")) { + if (!strcmp(param, "on")) { int res = EQ3Send(addr, "manual", nullptr, nullptr, useAlias); char tmp[] = "30"; int res2 = EQ3Send(addr, "settemp", tmp, nullptr, useAlias); return res2; } - if (!strcmp(param, "off") || !strcmp(param, "cool")) { + if (!strcmp(param, "off") || !strcmp(param, "cool") || !strcmp(param, "fan_only")) { int res = EQ3Send(addr, "manual", nullptr, nullptr, useAlias); char tmp[] = "4.5"; int res2 = EQ3Send(addr, "settemp", tmp, nullptr, useAlias); From 075140e3b75cb147f5eae9c68523a8323f186d19 Mon Sep 17 00:00:00 2001 From: Frederik <5511687+fightforlife@users.noreply.github.com> Date: Thu, 24 Nov 2022 18:33:13 +0100 Subject: [PATCH 2/2] fix valve is closed condition --- tasmota/tasmota_xdrv_driver/xdrv_85_esp32_ble_eq3_trv.ino | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasmota/tasmota_xdrv_driver/xdrv_85_esp32_ble_eq3_trv.ino b/tasmota/tasmota_xdrv_driver/xdrv_85_esp32_ble_eq3_trv.ino index f9bb90a94..fe2e81b0d 100644 --- a/tasmota/tasmota_xdrv_driver/xdrv_85_esp32_ble_eq3_trv.ino +++ b/tasmota/tasmota_xdrv_driver/xdrv_85_esp32_ble_eq3_trv.ino @@ -489,7 +489,7 @@ int EQ3ParseOp(BLE_ESP32::generic_sensor_t *op, bool success, int retries){ // If its in manual above 4.5°C and valve is open, set to heat if (((stat & 3) == 1) && (status[5] > 9) && (status[3] > 0)) { ResponseAppend_P(PSTR("\"heat\"")); break; } // If its in manual above 4.5°C and valve is closed, set to off - if (((stat & 3) == 1) && (status[5] > 9) && (status[3] > 0)) { ResponseAppend_P(PSTR("\"off\"")); break; } + if (((stat & 3) == 1) && (status[5] > 9)) { ResponseAppend_P(PSTR("\"off\"")); break; } //Fallback off ResponseAppend_P(PSTR("\"off\"")); break;