mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-06 07:49:52 +03:00
Merge pull request #2298 from MichaelDvP/dev
update for #2294 and #2295
This commit is contained in:
@@ -13,6 +13,7 @@ For more details go to [docs.emsesp.org](https://docs.emsesp.org/).
|
||||
- Mask bits for bool custom entities
|
||||
- thermostat `reduce threshold` [#2288](https://github.com/emsesp/EMS-ESP32/issues/2288)
|
||||
- thermostat `absent` [#1957](https://github.com/emsesp/EMS-ESP32/issues/1957)
|
||||
- CR11 thermostat [#2295](https://github.com/emsesp/EMS-ESP32/issues/2295)
|
||||
|
||||
## Fixed
|
||||
|
||||
@@ -20,6 +21,7 @@ For more details go to [docs.emsesp.org](https://docs.emsesp.org/).
|
||||
- modbus command path to `api/` [#2276](https://github.com/emsesp/EMS-ESP32/issues/2276)
|
||||
- info command for devices without entity-commands [#2274](https://github.com/emsesp/EMS-ESP32/issues/2274)
|
||||
- CW100 settings telegram 0x241 [#2290](https://github.com/emsesp/EMS-ESP32/issues/2290)
|
||||
- modbus signed 8bit values [#2294](https://github.com/emsesp/EMS-ESP32/issues/2294)
|
||||
|
||||
## Changed
|
||||
|
||||
|
||||
@@ -82,6 +82,7 @@
|
||||
|
||||
// Thermostat - Buderus/Nefit/Bosch specific - 0x17 / 0x10 / 0x18 / 0x19-0x1B for hc2-4 / 0x38
|
||||
{ 4, DeviceType::THERMOSTAT, "UI800, BC400", DeviceFlags::EMS_DEVICE_FLAG_BC400}, // 0x10
|
||||
{ 10, DeviceType::THERMOSTAT, "CR11", DeviceFlags::EMS_DEVICE_FLAG_RC100}, // 0x18
|
||||
{ 65, DeviceType::THERMOSTAT, "RC10", DeviceFlags::EMS_DEVICE_FLAG_RC20_N},// 0x17
|
||||
{ 67, DeviceType::THERMOSTAT, "RC30", DeviceFlags::EMS_DEVICE_FLAG_RC30_N},// 0x10 - based on RC35
|
||||
{ 77, DeviceType::THERMOSTAT, "RC20, Moduline 300", DeviceFlags::EMS_DEVICE_FLAG_RC20},// 0x17
|
||||
|
||||
@@ -1112,6 +1112,9 @@ void Thermostat::process_RC300Set(std::shared_ptr<const Telegram> telegram) {
|
||||
// set mode for CR120, BC400, https://github.com/emsesp/EMS-ESP32/discussions/1779
|
||||
has_update(telegram, hc->mode_new, 21); // for BC400, CR120
|
||||
has_bitupdate(telegram, hc->mode, 0, 0); // RC300, RC100
|
||||
if (hc->mode == EMS_VALUE_UINT8_NOTSET) {
|
||||
has_update(hc->mode, 0); // set manual for CR11
|
||||
}
|
||||
has_update(telegram, hc->daytemp, 2); // is * 2
|
||||
has_update(telegram, hc->nighttemp, 4); // is * 2
|
||||
|
||||
@@ -4643,6 +4646,7 @@ void Thermostat::register_device_values_hc(std::shared_ptr<Thermostat::HeatingCi
|
||||
} else {
|
||||
register_device_value(tag, &hc->control, DeviceValueType::ENUM, FL_(enum_control1), FL_(control), DeviceValueUOM::NONE, MAKE_CF_CB(set_control));
|
||||
}
|
||||
if (model != EMSdevice::EMS_DEVICE_FLAG_RC100 && model != EMSdevice::EMS_DEVICE_FLAG_CR120) {
|
||||
register_device_value(tag,
|
||||
&hc->remotetemp,
|
||||
DeviceValueType::CMD,
|
||||
@@ -4653,6 +4657,7 @@ void Thermostat::register_device_values_hc(std::shared_ptr<Thermostat::HeatingCi
|
||||
-1,
|
||||
101);
|
||||
register_device_value(tag, &hc->remotehum, DeviceValueType::CMD, FL_(remotehum), DeviceValueUOM::PERCENT, MAKE_CF_CB(set_remotehum), -1, 101);
|
||||
}
|
||||
register_device_value(tag, &hc->heatondelay, DeviceValueType::UINT8, FL_(heatondelay), DeviceValueUOM::HOURS, MAKE_CF_CB(set_heatondelay), 1, 48);
|
||||
register_device_value(tag, &hc->heatoffdelay, DeviceValueType::UINT8, FL_(heatoffdelay), DeviceValueUOM::HOURS, MAKE_CF_CB(set_heatoffdelay), 1, 48);
|
||||
register_device_value(tag, &hc->instantstart, DeviceValueType::UINT8, FL_(instantstart), DeviceValueUOM::K, MAKE_CF_CB(set_instantstart), 1, 10);
|
||||
@@ -4669,7 +4674,13 @@ void Thermostat::register_device_values_hc(std::shared_ptr<Thermostat::HeatingCi
|
||||
DeviceValueUOM::NONE,
|
||||
MAKE_CF_CB(set_switchProgMode));
|
||||
|
||||
register_device_value(tag, &hc->redThreshold, DeviceValueType::INT8, DeviceValueNumOp::DV_NUMOP_DIV2, FL_(redthreshold), DeviceValueUOM::DEGREES, MAKE_CF_CB(set_redthreshold));
|
||||
register_device_value(tag,
|
||||
&hc->redThreshold,
|
||||
DeviceValueType::INT8,
|
||||
DeviceValueNumOp::DV_NUMOP_DIV2,
|
||||
FL_(redthreshold),
|
||||
DeviceValueUOM::DEGREES,
|
||||
MAKE_CF_CB(set_redthreshold));
|
||||
break;
|
||||
case EMSdevice::EMS_DEVICE_FLAG_CRF:
|
||||
register_device_value(tag, &hc->mode, DeviceValueType::ENUM, FL_(enum_mode5), FL_(mode), DeviceValueUOM::NONE);
|
||||
|
||||
@@ -2063,7 +2063,7 @@ int EMSdevice::get_modbus_value(uint8_t tag, const std::string & shortname, std:
|
||||
else if (dv.type == DeviceValueType::INT8) {
|
||||
if (result.size() != 1)
|
||||
return -8;
|
||||
result[0] = (uint16_t)(uint8_t)(*(int8_t *)(dv.value_p));
|
||||
result[0] = (uint16_t)(int16_t)(*(int8_t *)(dv.value_p));
|
||||
} else if (dv.type == DeviceValueType::UINT8) {
|
||||
if (result.size() != 1)
|
||||
return -9;
|
||||
@@ -2136,7 +2136,12 @@ int EMSdevice::modbus_value_to_json(uint8_t tag, const std::string & shortname,
|
||||
return -4;
|
||||
}
|
||||
|
||||
if (dv.type == DeviceValueType::INT8 || dv.type == DeviceValueType::INT16) { // handle signed
|
||||
jsonValue["value"] =
|
||||
Helpers::numericoperator2scalefactor(dv.numeric_operator) * (float)(int16_t)((uint16_t)modbus_data[0] << 8 | (uint16_t)modbus_data[1]);
|
||||
} else {
|
||||
jsonValue["value"] = Helpers::numericoperator2scalefactor(dv.numeric_operator) * (float)((uint16_t)modbus_data[0] << 8 | (uint16_t)modbus_data[1]);
|
||||
}
|
||||
} else if (dv.type == DeviceValueType::UINT24 || dv.type == DeviceValueType::UINT32 || dv.type == DeviceValueType::TIME) {
|
||||
// these data types are 2 16 bit register
|
||||
if (modbus_data.size() != 4) {
|
||||
|
||||
@@ -310,8 +310,11 @@ ModbusMessage Modbus::handleRead(const ModbusMessage & request) {
|
||||
}
|
||||
}
|
||||
if (error_code) {
|
||||
if (uuid::get_uptime_sec() > 60 || error_code < -2) { // suppress not found messages for the first minute
|
||||
LOG_ERROR("Unable to read raw device value %s for tag=%d - error_code = %d", modbusInfo->short_name, (int)tag, error_code);
|
||||
}
|
||||
response.setError(request.getServerID(), request.getFunctionCode(), SERVER_DEVICE_FAILURE);
|
||||
return response;
|
||||
}
|
||||
|
||||
response.add(request.getServerID());
|
||||
|
||||
@@ -1 +1 @@
|
||||
#define EMSESP_APP_VERSION "3.7.2-dev.5"
|
||||
#define EMSESP_APP_VERSION "3.7.2-dev.6"
|
||||
Reference in New Issue
Block a user