Skip to content

Commit

Permalink
fix for #828 - show thermostat hc1 and mixer wwc
Browse files Browse the repository at this point in the history
  • Loading branch information
proddy committed Dec 28, 2022
1 parent d41e634 commit 1f1422b
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 2 deletions.
5 changes: 5 additions & 0 deletions src/devices/thermostat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,11 @@ Thermostat::Thermostat(uint8_t device_type, uint8_t device_id, uint8_t product_i
EMSESP::send_read_request(EMS_TYPE_RCTime, device_id);
EMSESP::send_read_request(0x12, device_id); // read last error (only published on errors)
EMSESP::send_read_request(0xA2, device_id); // read errorCode (only published on errors)

#if defined(EMSESP_STANDALONE_DUMP)
// if we're just dumping out values, create a single dummy hc
register_device_values_hc(std::make_shared<emsesp::Thermostat::HeatingCircuit>(1, 0)); // hc=1, no flags
#endif
}

// returns the heating circuit object based on the hc number
Expand Down
4 changes: 4 additions & 0 deletions src/emsdevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1067,6 +1067,10 @@ void EMSdevice::getCustomEntities(std::vector<std::string> & entity_ids) {
// device name,device type,product_id,shortname,fullname,type [(enum values) | (min/max)],uom,writeable,discovery_entityid
void EMSdevice::dump_value_info() {
for (auto & dv : devicevalues_) {
if (dv.fullname == nullptr) {
break; // ignore entities that don't have a fullname, like the thermostat climate thingy
}

Serial.print(name_);
Serial.print(',');
Serial.print(device_type_name().c_str());
Expand Down
2 changes: 1 addition & 1 deletion src/emsdevicevalue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ DeviceValue::DeviceValue(uint8_t device_type,
// set the min/max
set_custom_minmax();

/*
/*
#ifdef EMSESP_STANDALONE
// only added for debugging
Serial.print(COLOR_BRIGHT_RED_BACKGROUND);
Expand Down
9 changes: 8 additions & 1 deletion src/emsesp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,14 @@ void EMSESP::dump_all_values(uuid::console::Shell & shell) {
// go through each device type so they are sorted
for (const auto & device : device_library_) {
if (device_class.first == device.device_type) {
emsdevices.push_back(EMSFactory::add(device.device_type, 0, device.product_id, "1.0", device.name, device.flags, EMSdevice::Brand::NO_BRAND));
uint8_t device_id = 0;
// Mixer class looks at device_id to determine type, so fixing to 0x28 which will give all the settings except flowSetTemp
if ((device.device_type == DeviceType::MIXER) && (device.flags == EMSdevice::EMS_DEVICE_FLAG_MMPLUS)) {
device_id = 0x28; // hard code
}

emsdevices.push_back(
EMSFactory::add(device.device_type, device_id, device.product_id, "1.0", device.name, device.flags, EMSdevice::Brand::NO_BRAND));
emsdevices.back()->dump_value_info(); // dump all the entity information
}
}
Expand Down

0 comments on commit 1f1422b

Please sign in to comment.