mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-06 15:59:52 +03:00
newer CT200 temperatures, #2277
This commit is contained in:
@@ -133,6 +133,7 @@ Thermostat::Thermostat(uint8_t device_type, uint8_t device_id, uint8_t product_i
|
|||||||
monitor_typeids = {0x0A};
|
monitor_typeids = {0x0A};
|
||||||
set_typeids = {};
|
set_typeids = {};
|
||||||
register_telegram_type(monitor_typeids[0], "EasyMonitor", true, MAKE_PF_CB(process_EasyMonitor));
|
register_telegram_type(monitor_typeids[0], "EasyMonitor", true, MAKE_PF_CB(process_EasyMonitor));
|
||||||
|
register_telegram_type(0x02A5, "EasyMonitor", false, MAKE_PF_CB(process_EasyMonitor));
|
||||||
|
|
||||||
// CRF
|
// CRF
|
||||||
} else if (model == EMSdevice::EMS_DEVICE_FLAG_CRF) {
|
} else if (model == EMSdevice::EMS_DEVICE_FLAG_CRF) {
|
||||||
@@ -840,13 +841,30 @@ void Thermostat::process_RC20Monitor(std::shared_ptr<const Telegram> telegram) {
|
|||||||
|
|
||||||
// type 0x0A - data from the Nefit Easy/TC100 thermostat (0x18) - 31 bytes long
|
// type 0x0A - data from the Nefit Easy/TC100 thermostat (0x18) - 31 bytes long
|
||||||
void Thermostat::process_EasyMonitor(std::shared_ptr<const Telegram> telegram) {
|
void Thermostat::process_EasyMonitor(std::shared_ptr<const Telegram> telegram) {
|
||||||
|
monitor_typeids[0] = telegram->type_id;
|
||||||
auto hc = heating_circuit(telegram);
|
auto hc = heating_circuit(telegram);
|
||||||
if (hc == nullptr) {
|
if (hc == nullptr) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (telegram->type_id == 0x0A) {
|
||||||
|
int16_t temp = hc->roomTemp;
|
||||||
|
if (telegram->read_value(temp, 8) && temp != 0) {
|
||||||
has_update(telegram, hc->roomTemp, 8); // is * 100
|
has_update(telegram, hc->roomTemp, 8); // is * 100
|
||||||
has_update(telegram, hc->selTemp, 10); // is * 100
|
has_update(telegram, hc->selTemp, 10); // is * 100
|
||||||
|
toggle_fetch(0x0A, true);
|
||||||
|
}
|
||||||
|
} else if (telegram->type_id == 0x02A5) { // see #2277
|
||||||
|
int16_t temp = hc->roomTemp / 10;
|
||||||
|
if (telegram->read_value(temp, 0)) { // is * 10
|
||||||
|
has_update(hc->roomTemp, temp * 10); // * 100
|
||||||
|
toggle_fetch(0x0A, false);
|
||||||
|
}
|
||||||
|
int16_t sel = hc->selTemp / 50;
|
||||||
|
if (telegram->read_value(sel, 6, 1)) { // is * 2
|
||||||
|
has_update(hc->selTemp, sel * 50); // * 100
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
add_ha_climate(hc);
|
add_ha_climate(hc);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -174,6 +174,14 @@ class EMSdevice {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void has_update(int16_t & value, int16_t newvalue) {
|
||||||
|
if (value != newvalue) {
|
||||||
|
value = newvalue;
|
||||||
|
has_update_ = true;
|
||||||
|
publish_value((void *)&value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void has_update(uint32_t & value, uint32_t newvalue) {
|
void has_update(uint32_t & value, uint32_t newvalue) {
|
||||||
if (value != newvalue) {
|
if (value != newvalue) {
|
||||||
value = newvalue;
|
value = newvalue;
|
||||||
|
|||||||
Reference in New Issue
Block a user