mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-09 01:09:51 +03:00
Merge branch 'dev' of https://github.com/emsesp/EMS-ESP32 into dev2
This commit is contained in:
@@ -360,7 +360,7 @@ static void setup_commands(std::shared_ptr<Commands> & commands) {
|
||||
|
||||
commands->add_command(ShellContext::MAIN,
|
||||
CommandFlags::ADMIN,
|
||||
string_vector{F_(scan), F_(devices)},
|
||||
string_vector{F_(scan)},
|
||||
string_vector{F_(deep_optional)},
|
||||
[](Shell & shell, const std::vector<std::string> & arguments) {
|
||||
if (arguments.size() == 0) {
|
||||
@@ -368,29 +368,11 @@ static void setup_commands(std::shared_ptr<Commands> & commands) {
|
||||
} else {
|
||||
shell.printfln("Performing a deep scan...");
|
||||
to_app(shell).clear_all_devices();
|
||||
std::vector<uint8_t> Device_Ids;
|
||||
|
||||
Device_Ids.push_back(0x08); // Boilers - 0x08
|
||||
Device_Ids.push_back(0x38); // HeatPump - 0x38
|
||||
Device_Ids.push_back(0x30); // Solar Module - 0x30
|
||||
Device_Ids.push_back(0x09); // Controllers - 0x09
|
||||
Device_Ids.push_back(0x02); // Connect - 0x02
|
||||
Device_Ids.push_back(0x48); // Gateway - 0x48
|
||||
Device_Ids.push_back(0x20); // Mixer Devices - 0x20
|
||||
Device_Ids.push_back(0x21); // Mixer Devices - 0x21
|
||||
Device_Ids.push_back(0x22); // Mixer Devices - 0x22
|
||||
Device_Ids.push_back(0x23); // Mixer Devices - 0x23
|
||||
Device_Ids.push_back(0x28); // Mixer Devices WW- 0x28
|
||||
Device_Ids.push_back(0x29); // Mixer Devices WW- 0x29
|
||||
Device_Ids.push_back(0x10); // Thermostats - 0x10
|
||||
Device_Ids.push_back(0x17); // Thermostats - 0x17
|
||||
Device_Ids.push_back(0x18); // Thermostat remote - 0x18
|
||||
Device_Ids.push_back(0x19); // Thermostat remote - 0x19
|
||||
Device_Ids.push_back(0x1A); // Thermostat remote - 0x1A
|
||||
Device_Ids.push_back(0x1B); // Thermostat remote - 0x1B
|
||||
Device_Ids.push_back(0x11); // Switches - 0x11
|
||||
|
||||
// device IDs taken from device_library.h
|
||||
// send the read command with Version command
|
||||
const std::vector<uint8_t> Device_Ids = {0x02, 0x08, 0x09, 0x10, 0x11, 0x12, 0x15, 0x17, 0x18, 0x19, 0x1A,
|
||||
0x1B, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29,
|
||||
0x2A, 0x30, 0x38, 0x40, 0x41, 0x48, 0x50, 0x51, 0x60};
|
||||
for (const uint8_t device_id : Device_Ids) {
|
||||
to_app(shell).send_read_request(EMSdevice::EMS_TYPE_VERSION, device_id);
|
||||
}
|
||||
|
||||
@@ -101,7 +101,7 @@
|
||||
{215, DeviceType::THERMOSTAT, "Comfort RF", DeviceFlags::EMS_DEVICE_FLAG_CRF | DeviceFlags::EMS_DEVICE_FLAG_NO_WRITE}, // 0x18
|
||||
{216, DeviceType::THERMOSTAT, "CRF200S", DeviceFlags::EMS_DEVICE_FLAG_CRF | DeviceFlags::EMS_DEVICE_FLAG_NO_WRITE}, // 0x18
|
||||
{246, DeviceType::THERMOSTAT, "Comfort+2RF", DeviceFlags::EMS_DEVICE_FLAG_CRF | DeviceFlags::EMS_DEVICE_FLAG_NO_WRITE}, // 0x18
|
||||
{253, DeviceType::THERMOSTAT, "Rego 3000/UI800/BC400", DeviceFlags::EMS_DEVICE_FLAG_RC300}, // 0x10
|
||||
{253, DeviceType::THERMOSTAT, "Rego 3000/UI800/WSW196i/BC400", DeviceFlags::EMS_DEVICE_FLAG_RC300}, // 0x10
|
||||
|
||||
// Thermostat - Sieger - 0x10 / 0x17
|
||||
{ 66, DeviceType::THERMOSTAT, "ES72/RC20", DeviceFlags::EMS_DEVICE_FLAG_RC20_N}, // 0x17 or remote
|
||||
|
||||
@@ -102,8 +102,18 @@ Boiler::Boiler(uint8_t device_type, int8_t device_id, uint8_t product_id, const
|
||||
FL_(setReturnTemp),
|
||||
DeviceValueUOM::DEGREES,
|
||||
MAKE_CF_CB(set_returnTemp));
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &cwFlowRate_, DeviceValueType::USHORT, DeviceValueNumOp::DV_NUMOP_DIV10, FL_(cwFlowRate), DeviceValueUOM::LMIN);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &netFlowTemp_, DeviceValueType::USHORT, DeviceValueNumOp::DV_NUMOP_DIV10, FL_(netFlowTemp), DeviceValueUOM::DEGREES);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA,
|
||||
&cwFlowRate_,
|
||||
DeviceValueType::USHORT,
|
||||
DeviceValueNumOp::DV_NUMOP_DIV10,
|
||||
FL_(cwFlowRate),
|
||||
DeviceValueUOM::LMIN);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA,
|
||||
&netFlowTemp_,
|
||||
DeviceValueType::USHORT,
|
||||
DeviceValueNumOp::DV_NUMOP_DIV10,
|
||||
FL_(netFlowTemp),
|
||||
DeviceValueUOM::DEGREES);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -985,7 +995,7 @@ void Boiler::check_active() {
|
||||
static uint32_t lastSendHeatingOff = 0;
|
||||
if (forceHeatingOff_ == EMS_VALUE_BOOL_ON && (uuid::get_uptime_sec() - lastSendHeatingOff) >= 60) {
|
||||
lastSendHeatingOff = uuid::get_uptime_sec();
|
||||
uint8_t data[] = {0, 0, 0, 0};
|
||||
uint8_t data[] = {0, 0, 0, 0};
|
||||
write_command(EMS_TYPE_UBASetPoints, 0, data, sizeof(data), 0);
|
||||
}
|
||||
|
||||
|
||||
@@ -633,10 +633,12 @@ bool Mqtt::queue_message(const uint8_t operation, const std::string & topic, con
|
||||
packet_id = mqttClient_->unsubscribe(fulltopic);
|
||||
LOG_DEBUG("Unsubscribing to topic '%s', pid %d", fulltopic, packet_id);
|
||||
}
|
||||
#ifndef EMSESP_STANDALONE
|
||||
if (packet_id == 0) {
|
||||
LOG_WARNING("%s failed: %s", operation == Operation::PUBLISH ? "Publish" : operation == Operation::SUBSCRIBE ? "Subscribe" : "Unsubscribe", fulltopic);
|
||||
mqtt_publish_fails_++;
|
||||
}
|
||||
#endif
|
||||
return (packet_id != 0);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user