mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-10 09:49:54 +03:00
#632 - still experimental
This commit is contained in:
@@ -26,11 +26,11 @@ uuid::log::Logger Boiler::logger_{F_(boiler), uuid::log::Facility::CONSOLE};
|
||||
|
||||
Boiler::Boiler(uint8_t device_type, int8_t device_id, uint8_t product_id, const std::string & version, const std::string & name, uint8_t flags, uint8_t brand)
|
||||
: EMSdevice(device_type, device_id, product_id, version, name, flags, brand) {
|
||||
reserve_mem(20); // reserve some space for the telegram registries, to avoid memory fragmentation
|
||||
|
||||
LOG_DEBUG(F("Adding new Boiler with device ID 0x%02X"), device_id);
|
||||
|
||||
System::show_mem("starting boiler regs"); // TODO remove debug
|
||||
reserve_telgram_functions(25); // reserve some space for the telegram registries, to avoid memory fragmentation
|
||||
|
||||
System::show_mem("starting boiler regs");
|
||||
|
||||
// the telegram handlers...
|
||||
register_telegram_type(0x10, F("UBAErrorMessage1"), false, [&](std::shared_ptr<const Telegram> t) { process_UBAErrorMessage(t); });
|
||||
@@ -60,7 +60,7 @@ Boiler::Boiler(uint8_t device_type, int8_t device_id, uint8_t product_id, const
|
||||
EMSESP::send_read_request(0x11, device_id); // read last errorcode on start (only published on errors)
|
||||
EMSESP::send_read_request(0x15, device_id); // read maintenace data on start (only published on change)
|
||||
|
||||
System::show_mem("after telegram type reg"); // TODO remove debug
|
||||
System::show_mem("after telegram type reg");
|
||||
|
||||
// MQTT commands for boiler topic
|
||||
register_mqtt_cmd(F("comfort"), [&](const char * value, const int8_t id) { return set_warmwater_mode(value, id); });
|
||||
@@ -80,407 +80,438 @@ Boiler::Boiler(uint8_t device_type, int8_t device_id, uint8_t product_id, const
|
||||
register_mqtt_cmd(F("boilhystoff"), [&](const char * value, const int8_t id) { return set_hyst_off(value, id); });
|
||||
register_mqtt_cmd(F("burnperiod"), [&](const char * value, const int8_t id) { return set_burn_period(value, id); });
|
||||
register_mqtt_cmd(F("pumpdelay"), [&](const char * value, const int8_t id) { return set_pump_delay(value, id); });
|
||||
// register_mqtt_cmd(F("reset"), [&](const char * value, const int8_t id) { return set_reset(value, id); });
|
||||
register_mqtt_cmd(F("maintenance"), [&](const char * value, const int8_t id) { return set_maintenance(value, id); });
|
||||
register_mqtt_cmd(F("pumpmodmax"), [&](const char * value, const int8_t id) { return set_max_pump(value, id); });
|
||||
register_mqtt_cmd(F("pumpmodmin"), [&](const char * value, const int8_t id) { return set_min_pump(value, id); });
|
||||
// register_mqtt_cmd(F("reset"), [&](const char * value, const int8_t id) { return set_reset(value, id); });
|
||||
|
||||
System::show_mem("after mqtt cmd reg"); // TODO remove debug
|
||||
System::show_mem("after mqtt cmd reg");
|
||||
|
||||
// add values
|
||||
|
||||
// init_devicevalues(30); // TODO reserve mem
|
||||
reserve_device_values(50);
|
||||
|
||||
// main - boiler_data topic
|
||||
register_device_value(DeviceValueTAG::TAG_BOILER_DATA, &heatingActive_, DeviceValueType::BOOL, {}, F("heatingActive"), F("Heating active"), DeviceValueUOM::NONE);
|
||||
register_device_value(
|
||||
DeviceValueTAG::TAG_BOILER_DATA, &tapwaterActive_, DeviceValueType::BOOL, {}, F("tapwaterActive"), F("Warm water/DHW active"), DeviceValueUOM::NONE);
|
||||
register_device_value(
|
||||
DeviceValueTAG::TAG_BOILER_DATA, &selFlowTemp_, DeviceValueType::UINT, {}, F("selFlowTemp"), F("Selected flow temperature"), DeviceValueUOM::DEGREES);
|
||||
register_device_value(
|
||||
DeviceValueTAG::TAG_BOILER_DATA, &selBurnPow_, DeviceValueType::UINT, {}, F("selBurnPow"), F("Burner selected max power"), DeviceValueUOM::PERCENT);
|
||||
register_device_value(DeviceValueTAG::TAG_BOILER_DATA, &pumpMod_, DeviceValueType::UINT, {}, F("pumpMod"), F("Pump modulation"), DeviceValueUOM::PERCENT);
|
||||
register_device_value(DeviceValueTAG::TAG_BOILER_DATA, &pumpMod2_, DeviceValueType::UINT, {}, F("pumpMod2"), F("Heat pump modulation"), DeviceValueUOM::PERCENT);
|
||||
|
||||
register_device_value(TAG_BOILER_DATA,
|
||||
&outdoorTemp_,
|
||||
DeviceValueType::SHORT,
|
||||
flash_string_vector{F("10")},
|
||||
F("outdoorTemp"),
|
||||
F("Outside temperature"),
|
||||
DeviceValueTAG::TAG_BOILER_DATA, &heatingActive_, DeviceValueType::BOOL, nullptr, F("heatingActive"), F("Heating active"), DeviceValueUOM::NONE);
|
||||
register_device_value(DeviceValueTAG::TAG_BOILER_DATA,
|
||||
&tapwaterActive_,
|
||||
DeviceValueType::BOOL,
|
||||
nullptr,
|
||||
F("tapwaterActive"),
|
||||
F("Warm water/DHW active"),
|
||||
DeviceValueUOM::NONE);
|
||||
register_device_value(DeviceValueTAG::TAG_BOILER_DATA,
|
||||
&selFlowTemp_,
|
||||
DeviceValueType::UINT,
|
||||
nullptr,
|
||||
F("selFlowTemp"),
|
||||
F("Selected flow temperature"),
|
||||
DeviceValueUOM::DEGREES);
|
||||
register_device_value(DeviceValueTAG::TAG_BOILER_DATA,
|
||||
&selBurnPow_,
|
||||
DeviceValueType::UINT,
|
||||
nullptr,
|
||||
F("selBurnPow"),
|
||||
F("Burner selected max power"),
|
||||
DeviceValueUOM::PERCENT);
|
||||
register_device_value(DeviceValueTAG::TAG_BOILER_DATA, &pumpMod_, DeviceValueType::UINT, nullptr, F("pumpMod"), F("Pump modulation"), DeviceValueUOM::PERCENT);
|
||||
register_device_value(
|
||||
DeviceValueTAG::TAG_BOILER_DATA, &pumpMod2_, DeviceValueType::UINT, nullptr, F("pumpMod2"), F("Heat pump modulation"), DeviceValueUOM::PERCENT);
|
||||
|
||||
register_device_value(TAG_BOILER_DATA, &outdoorTemp_, DeviceValueType::SHORT, FL_(div10), F("outdoorTemp"), F("Outside temperature"), DeviceValueUOM::DEGREES);
|
||||
register_device_value(DeviceValueTAG::TAG_BOILER_DATA,
|
||||
&curFlowTemp_,
|
||||
DeviceValueType::USHORT,
|
||||
flash_string_vector{F("10")},
|
||||
FL_(div10),
|
||||
F("curFlowTemp"),
|
||||
F("Current flow temperature"),
|
||||
DeviceValueUOM::DEGREES);
|
||||
register_device_value(DeviceValueTAG::TAG_BOILER_DATA,
|
||||
&retTemp_,
|
||||
DeviceValueType::USHORT,
|
||||
flash_string_vector{F("10")},
|
||||
F("retTemp"),
|
||||
F("Return temperature"),
|
||||
DeviceValueUOM::DEGREES);
|
||||
register_device_value(
|
||||
DeviceValueTAG::TAG_BOILER_DATA, &retTemp_, DeviceValueType::USHORT, FL_(div10), F("retTemp"), F("Return temperature"), DeviceValueUOM::DEGREES);
|
||||
register_device_value(DeviceValueTAG::TAG_BOILER_DATA,
|
||||
&switchTemp_,
|
||||
DeviceValueType::USHORT,
|
||||
flash_string_vector{F("10")},
|
||||
FL_(div10),
|
||||
F("switchTemp"),
|
||||
F("Mixing switch temperature"),
|
||||
DeviceValueUOM::DEGREES);
|
||||
register_device_value(DeviceValueTAG::TAG_BOILER_DATA,
|
||||
&sysPress_,
|
||||
DeviceValueType::UINT,
|
||||
flash_string_vector{F("10")},
|
||||
F("sysPress"),
|
||||
F("System pressure"),
|
||||
DeviceValueUOM::BAR);
|
||||
register_device_value(TAG_BOILER_DATA,
|
||||
&boilTemp_,
|
||||
DeviceValueType::USHORT,
|
||||
flash_string_vector{F("10")},
|
||||
F("boilTemp"),
|
||||
F("Max boiler temperature"),
|
||||
DeviceValueUOM::DEGREES);
|
||||
register_device_value(TAG_BOILER_DATA,
|
||||
&exhaustTemp_,
|
||||
DeviceValueType::USHORT,
|
||||
flash_string_vector{F("10")},
|
||||
F("exhaustTemp"),
|
||||
F("Exhaust temperature"),
|
||||
DeviceValueUOM::DEGREES);
|
||||
register_device_value(DeviceValueTAG::TAG_BOILER_DATA, &sysPress_, DeviceValueType::UINT, FL_(div10), F("sysPress"), F("System pressure"), DeviceValueUOM::BAR);
|
||||
register_device_value(TAG_BOILER_DATA, &boilTemp_, DeviceValueType::USHORT, FL_(div10), F("boilTemp"), F("Max boiler temperature"), DeviceValueUOM::DEGREES);
|
||||
register_device_value(TAG_BOILER_DATA, &exhaustTemp_, DeviceValueType::USHORT, FL_(div10), F("exhaustTemp"), F("Exhaust temperature"), DeviceValueUOM::DEGREES);
|
||||
|
||||
register_device_value(DeviceValueTAG::TAG_BOILER_DATA, &burnGas_, DeviceValueType::BOOL, {}, F("burnGas"), F("Gas"), DeviceValueUOM::NONE);
|
||||
register_device_value(DeviceValueTAG::TAG_BOILER_DATA, &flameCurr_, DeviceValueType::USHORT, {F("10")}, F("flameCurr"), F("Flame current"), DeviceValueUOM::UA);
|
||||
register_device_value(DeviceValueTAG::TAG_BOILER_DATA, &heatPump_, DeviceValueType::BOOL, {}, F("heatPump"), F("Heat pump"), DeviceValueUOM::NONE);
|
||||
register_device_value(DeviceValueTAG::TAG_BOILER_DATA, &fanWork_, DeviceValueType::BOOL, {}, F("fanWork"), F("Fan"), DeviceValueUOM::NONE);
|
||||
register_device_value(DeviceValueTAG::TAG_BOILER_DATA, &ignWork_, DeviceValueType::BOOL, {}, F("ignWork"), F("Ignition"), DeviceValueUOM::NONE);
|
||||
register_device_value(DeviceValueTAG::TAG_BOILER_DATA, &burnGas_, DeviceValueType::BOOL, nullptr, F("burnGas"), F("Gas"), DeviceValueUOM::NONE);
|
||||
register_device_value(DeviceValueTAG::TAG_BOILER_DATA, &flameCurr_, DeviceValueType::USHORT, FL_(div10), F("flameCurr"), F("Flame current"), DeviceValueUOM::UA);
|
||||
register_device_value(DeviceValueTAG::TAG_BOILER_DATA, &heatPump_, DeviceValueType::BOOL, nullptr, F("heatPump"), F("Heat pump"), DeviceValueUOM::NONE);
|
||||
register_device_value(DeviceValueTAG::TAG_BOILER_DATA, &fanWork_, DeviceValueType::BOOL, nullptr, F("fanWork"), F("Fan"), DeviceValueUOM::NONE);
|
||||
register_device_value(DeviceValueTAG::TAG_BOILER_DATA, &ignWork_, DeviceValueType::BOOL, nullptr, F("ignWork"), F("Ignition"), DeviceValueUOM::NONE);
|
||||
register_device_value(DeviceValueTAG::TAG_BOILER_DATA,
|
||||
&heatingActivated_,
|
||||
DeviceValueType::BOOL,
|
||||
nullptr,
|
||||
F("heatingActivated"),
|
||||
F("Heating activated"),
|
||||
DeviceValueUOM::NONE);
|
||||
register_device_value(
|
||||
DeviceValueTAG::TAG_BOILER_DATA, &heatingActivated_, DeviceValueType::BOOL, {}, F("heatingActivated"), F("Heating activated"), DeviceValueUOM::NONE);
|
||||
DeviceValueTAG::TAG_BOILER_DATA, &heatingTemp_, DeviceValueType::UINT, nullptr, F("heatingTemp"), F("Heating temperature"), DeviceValueUOM::DEGREES);
|
||||
register_device_value(
|
||||
DeviceValueTAG::TAG_BOILER_DATA, &heatingTemp_, DeviceValueType::UINT, {}, F("heatingTemp"), F("Heating temperature"), DeviceValueUOM::DEGREES);
|
||||
DeviceValueTAG::TAG_BOILER_DATA, &pumpModMax_, DeviceValueType::UINT, nullptr, F("pumpModMax"), F("Burner pump max power"), DeviceValueUOM::PERCENT);
|
||||
register_device_value(
|
||||
DeviceValueTAG::TAG_BOILER_DATA, &pumpModMax_, DeviceValueType::UINT, {}, F("pumpModMax"), F("Burner pump max power"), DeviceValueUOM::PERCENT);
|
||||
DeviceValueTAG::TAG_BOILER_DATA, &pumpModMin_, DeviceValueType::UINT, nullptr, F("pumpModMin"), F("Burner pump min power"), DeviceValueUOM::PERCENT);
|
||||
register_device_value(DeviceValueTAG::TAG_BOILER_DATA, &pumpDelay_, DeviceValueType::UINT, nullptr, F("pumpDelay"), F("Pump delay"), DeviceValueUOM::MINUTES);
|
||||
register_device_value(
|
||||
DeviceValueTAG::TAG_BOILER_DATA, &pumpModMin_, DeviceValueType::UINT, {}, F("pumpModMin"), F("Burner pump min power"), DeviceValueUOM::PERCENT);
|
||||
register_device_value(DeviceValueTAG::TAG_BOILER_DATA, &pumpDelay_, DeviceValueType::UINT, {}, F("pumpDelay"), F("Pump delay"), DeviceValueUOM::MINUTES);
|
||||
DeviceValueTAG::TAG_BOILER_DATA, &burnMinPeriod_, DeviceValueType::UINT, nullptr, F("burnMinPeriod"), F("Burner min period"), DeviceValueUOM::MINUTES);
|
||||
register_device_value(
|
||||
DeviceValueTAG::TAG_BOILER_DATA, &burnMinPeriod_, DeviceValueType::UINT, {}, F("burnMinPeriod"), F("Burner min period"), DeviceValueUOM::MINUTES);
|
||||
register_device_value(DeviceValueTAG::TAG_BOILER_DATA, &burnMinPower_, DeviceValueType::UINT, {}, F("burnMinPower"), F("Burner min power"), DeviceValueUOM::PERCENT);
|
||||
register_device_value(DeviceValueTAG::TAG_BOILER_DATA, &burnMaxPower_, DeviceValueType::UINT, {}, F("burnMaxPower"), F("Burner max power"), DeviceValueUOM::PERCENT);
|
||||
DeviceValueTAG::TAG_BOILER_DATA, &burnMinPower_, DeviceValueType::UINT, nullptr, F("burnMinPower"), F("Burner min power"), DeviceValueUOM::PERCENT);
|
||||
register_device_value(
|
||||
DeviceValueTAG::TAG_BOILER_DATA, &boilHystOn_, DeviceValueType::INT, {}, F("boilHystOn"), F("Hysteresis on temperature"), DeviceValueUOM::DEGREES);
|
||||
DeviceValueTAG::TAG_BOILER_DATA, &burnMaxPower_, DeviceValueType::UINT, nullptr, F("burnMaxPower"), F("Burner max power"), DeviceValueUOM::PERCENT);
|
||||
register_device_value(
|
||||
DeviceValueTAG::TAG_BOILER_DATA, &boilHystOff_, DeviceValueType::INT, {}, F("boilHystOff"), F("Hysteresis off temperature"), DeviceValueUOM::DEGREES);
|
||||
DeviceValueTAG::TAG_BOILER_DATA, &boilHystOn_, DeviceValueType::INT, nullptr, F("boilHystOn"), F("Hysteresis on temperature"), DeviceValueUOM::DEGREES);
|
||||
register_device_value(DeviceValueTAG::TAG_BOILER_DATA,
|
||||
&boilHystOff_,
|
||||
DeviceValueType::INT,
|
||||
nullptr,
|
||||
F("boilHystOff"),
|
||||
F("Hysteresis off temperature"),
|
||||
DeviceValueUOM::DEGREES);
|
||||
register_device_value(
|
||||
DeviceValueTAG::TAG_BOILER_DATA, &setFlowTemp_, DeviceValueType::UINT, {}, F("setFlowTemp"), F("Set flow temperature"), DeviceValueUOM::DEGREES);
|
||||
register_device_value(DeviceValueTAG::TAG_BOILER_DATA, &setBurnPow_, DeviceValueType::UINT, {}, F("setBurnPow"), F("Burner set power"), DeviceValueUOM::PERCENT);
|
||||
register_device_value(DeviceValueTAG::TAG_BOILER_DATA, &curBurnPow_, DeviceValueType::UINT, {}, F("curBurnPow"), F("Burner current power"), DeviceValueUOM::PERCENT);
|
||||
register_device_value(DeviceValueTAG::TAG_BOILER_DATA, &burnStarts_, DeviceValueType::ULONG, {}, F("burnStarts"), F("Burner # starts"), DeviceValueUOM::NONE);
|
||||
DeviceValueTAG::TAG_BOILER_DATA, &setFlowTemp_, DeviceValueType::UINT, nullptr, F("setFlowTemp"), F("Set flow temperature"), DeviceValueUOM::DEGREES);
|
||||
register_device_value(
|
||||
DeviceValueTAG::TAG_BOILER_DATA, &burnWorkMin_, DeviceValueType::TIME, {}, F("burnWorkMin"), F("Total burner operating time"), DeviceValueUOM::MINUTES);
|
||||
DeviceValueTAG::TAG_BOILER_DATA, &setBurnPow_, DeviceValueType::UINT, nullptr, F("setBurnPow"), F("Burner set power"), DeviceValueUOM::PERCENT);
|
||||
register_device_value(
|
||||
DeviceValueTAG::TAG_BOILER_DATA, &heatWorkMin_, DeviceValueType::TIME, {}, F("heatWorkMin"), F("Total heat operating time"), DeviceValueUOM::MINUTES);
|
||||
DeviceValueTAG::TAG_BOILER_DATA, &curBurnPow_, DeviceValueType::UINT, nullptr, F("curBurnPow"), F("Burner current power"), DeviceValueUOM::PERCENT);
|
||||
register_device_value(DeviceValueTAG::TAG_BOILER_DATA, &burnStarts_, DeviceValueType::ULONG, nullptr, F("burnStarts"), F("Burner # starts"), DeviceValueUOM::NONE);
|
||||
register_device_value(DeviceValueTAG::TAG_BOILER_DATA,
|
||||
&burnWorkMin_,
|
||||
DeviceValueType::TIME,
|
||||
nullptr,
|
||||
F("burnWorkMin"),
|
||||
F("Total burner operating time"),
|
||||
DeviceValueUOM::MINUTES);
|
||||
register_device_value(DeviceValueTAG::TAG_BOILER_DATA,
|
||||
&heatWorkMin_,
|
||||
DeviceValueType::TIME,
|
||||
nullptr,
|
||||
F("heatWorkMin"),
|
||||
F("Total heat operating time"),
|
||||
DeviceValueUOM::MINUTES);
|
||||
register_device_value(
|
||||
DeviceValueTAG::TAG_BOILER_DATA, &UBAuptime_, DeviceValueType::TIME, {}, F("UBAuptime"), F("Total UBA operating time"), DeviceValueUOM::MINUTES);
|
||||
register_device_value(DeviceValueTAG::TAG_BOILER_DATA, &lastCode_, DeviceValueType::TEXT, {}, F("lastCode"), F("Last error code"), DeviceValueUOM::NONE);
|
||||
register_device_value(DeviceValueTAG::TAG_BOILER_DATA, &serviceCode_, DeviceValueType::TEXT, {}, F("serviceCode"), F("Service code"), DeviceValueUOM::NONE);
|
||||
DeviceValueTAG::TAG_BOILER_DATA, &UBAuptime_, DeviceValueType::TIME, nullptr, F("UBAuptime"), F("Total UBA operating time"), DeviceValueUOM::MINUTES);
|
||||
register_device_value(DeviceValueTAG::TAG_BOILER_DATA, &lastCode_, DeviceValueType::TEXT, nullptr, F("lastCode"), F("Last error code"), DeviceValueUOM::NONE);
|
||||
register_device_value(DeviceValueTAG::TAG_BOILER_DATA, &serviceCode_, DeviceValueType::TEXT, nullptr, F("serviceCode"), F("Service code"), DeviceValueUOM::NONE);
|
||||
register_device_value(DeviceValueTAG::TAG_BOILER_DATA,
|
||||
&serviceCodeNumber_,
|
||||
DeviceValueType::USHORT,
|
||||
{},
|
||||
nullptr,
|
||||
F("serviceCodeNumber"),
|
||||
F("Service code number"),
|
||||
DeviceValueUOM::NONE);
|
||||
|
||||
System::show_mem("after device value reg"); // TODO remove debug
|
||||
System::show_mem("after device value reg");
|
||||
|
||||
#ifdef EMSESP_FORCE_SERIAL
|
||||
return; // TODO remove early exit
|
||||
#endif
|
||||
return; // TODO early exit for memory profiling on ESP8266
|
||||
|
||||
// ww - boiler_data_ww topic
|
||||
register_device_value(DeviceValueTAG::TAG_BOILER_DATA_WW,
|
||||
&wWSelTemp_,
|
||||
DeviceValueType::UINT,
|
||||
{},
|
||||
nullptr,
|
||||
F("wWSelTemp"),
|
||||
F("Warm Water selected temperature"),
|
||||
DeviceValueUOM::DEGREES);
|
||||
register_device_value(
|
||||
DeviceValueTAG::TAG_BOILER_DATA_WW, &wWSetTemp_, DeviceValueType::UINT, {}, F("wWSetTemp"), F("Warm water set temperature"), DeviceValueUOM::DEGREES);
|
||||
register_device_value(DeviceValueTAG::TAG_BOILER_DATA_WW,
|
||||
&wWType_,
|
||||
DeviceValueType::ENUM,
|
||||
flash_string_vector{F("off"), F("flow"), F("buffered flow"), F("buffer"), F("layered buffer")},
|
||||
F("wWType"),
|
||||
F("Warm water type"),
|
||||
DeviceValueUOM::NONE);
|
||||
&wWSetTemp_,
|
||||
DeviceValueType::UINT,
|
||||
nullptr,
|
||||
F("wWSetTemp"),
|
||||
F("Warm water set temperature"),
|
||||
DeviceValueUOM::DEGREES);
|
||||
register_device_value(DeviceValueTAG::TAG_BOILER_DATA_WW, &wWType_, DeviceValueType::ENUM, FL_(enum_flow), F("wWType"), F("Warm water type"), DeviceValueUOM::NONE);
|
||||
register_device_value(DeviceValueTAG::TAG_BOILER_DATA_WW,
|
||||
&wWComfort_,
|
||||
DeviceValueType::ENUM,
|
||||
flash_string_vector{F("hot"), F("eco"), F("intelligent")},
|
||||
FL_(enum_comfort),
|
||||
F("wWComfort"),
|
||||
F("Warm water comfort"),
|
||||
DeviceValueUOM::NONE);
|
||||
register_device_value(DeviceValueTAG::TAG_BOILER_DATA_WW,
|
||||
&wWCircPump_,
|
||||
DeviceValueType::BOOL,
|
||||
{},
|
||||
nullptr,
|
||||
F("wWCircPump"),
|
||||
F("Warm water circulation pump available"),
|
||||
DeviceValueUOM::NONE);
|
||||
register_device_value(DeviceValueTAG::TAG_BOILER_DATA_WW,
|
||||
&wWChargeType_,
|
||||
DeviceValueType::BOOL,
|
||||
flash_string_vector{F("3-way valve"), F("charge pump")},
|
||||
FL_(enum_charge),
|
||||
F("wWChargeType"),
|
||||
F("Warm Water charging type"),
|
||||
DeviceValueUOM::NONE);
|
||||
register_device_value(DeviceValueTAG::TAG_BOILER_DATA_WW,
|
||||
&wWDisinfectionTemp_,
|
||||
DeviceValueType::UINT,
|
||||
{},
|
||||
nullptr,
|
||||
F("wWDisinfectionTemp"),
|
||||
F("Warm Water disinfection temperature"),
|
||||
DeviceValueUOM::DEGREES);
|
||||
register_device_value(DeviceValueTAG::TAG_BOILER_DATA_WW,
|
||||
&wWCircPumpMode_,
|
||||
DeviceValueType::ENUM,
|
||||
flash_string_vector{F("off"), F("1x3min"), F("2x3min"), F("3x3min"), F("4x3min"), F("5x3min"), F("6x3min"), F("continuos")},
|
||||
FL_(enum_freq),
|
||||
F("wWCircPumpMode"),
|
||||
F("Warm water circulation pump freq"),
|
||||
DeviceValueUOM::NONE);
|
||||
register_device_value(
|
||||
DeviceValueTAG::TAG_BOILER_DATA_WW, &wWCirc_, DeviceValueType::BOOL, {}, F("wWCirc"), F("Warm Water circulation active"), DeviceValueUOM::NONE);
|
||||
DeviceValueTAG::TAG_BOILER_DATA_WW, &wWCirc_, DeviceValueType::BOOL, nullptr, F("wWCirc"), F("Warm Water circulation active"), DeviceValueUOM::NONE);
|
||||
register_device_value(DeviceValueTAG::TAG_BOILER_DATA_WW,
|
||||
&wWCurTemp_,
|
||||
DeviceValueType::USHORT,
|
||||
{F("10")},
|
||||
FL_(div10),
|
||||
F("wWCurTemp"),
|
||||
F("Warm Water current temperature (intern)"),
|
||||
DeviceValueUOM::DEGREES);
|
||||
register_device_value(DeviceValueTAG::TAG_BOILER_DATA_WW,
|
||||
&wWCurTemp2_,
|
||||
DeviceValueType::USHORT,
|
||||
flash_string_vector{F("10")},
|
||||
FL_(div10),
|
||||
F("wWCurTemp2"),
|
||||
F("Warm Water current temperature (extern)"),
|
||||
DeviceValueUOM::DEGREES);
|
||||
register_device_value(DeviceValueTAG::TAG_BOILER_DATA_WW,
|
||||
&wWCurFlow_,
|
||||
DeviceValueType::UINT,
|
||||
{F("10")},
|
||||
FL_(div10),
|
||||
F("wWCurFlow"),
|
||||
F("Warm Water current tap water flow"),
|
||||
DeviceValueUOM::LMIN);
|
||||
register_device_value(DeviceValueTAG::TAG_BOILER_DATA_WW,
|
||||
&wwStorageTemp1_,
|
||||
DeviceValueType::USHORT,
|
||||
flash_string_vector{F("10")},
|
||||
FL_(div10),
|
||||
F("wwStorageTemp1"),
|
||||
F("Warm water storage temperature (intern)"),
|
||||
DeviceValueUOM::DEGREES);
|
||||
register_device_value(DeviceValueTAG::TAG_BOILER_DATA_WW,
|
||||
&wwStorageTemp2_,
|
||||
DeviceValueType::USHORT,
|
||||
flash_string_vector{F("10")},
|
||||
FL_(div10),
|
||||
F("wwStorageTemp2"),
|
||||
F("Warm water storage temperature (extern)"),
|
||||
DeviceValueUOM::DEGREES);
|
||||
register_device_value(
|
||||
DeviceValueTAG::TAG_BOILER_DATA_WW, &wWActivated_, DeviceValueType::BOOL, {}, F("wWActivated"), F("Warm Water activated"), DeviceValueUOM::NONE);
|
||||
register_device_value(
|
||||
DeviceValueTAG::TAG_BOILER_DATA_WW, &wWOneTime_, DeviceValueType::BOOL, {}, F("wWOneTime"), F("Warm Water one time charging"), DeviceValueUOM::NONE);
|
||||
DeviceValueTAG::TAG_BOILER_DATA_WW, &wWActivated_, DeviceValueType::BOOL, nullptr, F("wWActivated"), F("Warm Water activated"), DeviceValueUOM::NONE);
|
||||
register_device_value(DeviceValueTAG::TAG_BOILER_DATA_WW,
|
||||
&wWOneTime_,
|
||||
DeviceValueType::BOOL,
|
||||
nullptr,
|
||||
F("wWOneTime"),
|
||||
F("Warm Water one time charging"),
|
||||
DeviceValueUOM::NONE);
|
||||
register_device_value(DeviceValueTAG::TAG_BOILER_DATA_WW,
|
||||
&wWDisinfecting_,
|
||||
DeviceValueType::BOOL,
|
||||
{},
|
||||
nullptr,
|
||||
F("wWDisinfecting"),
|
||||
F("Warm Water disinfecting"),
|
||||
DeviceValueUOM::NONE);
|
||||
register_device_value(DeviceValueTAG::TAG_BOILER_DATA_WW, &wWCharging_, DeviceValueType::BOOL, {}, F("wWCharging"), F("Warm Water charging"), DeviceValueUOM::NONE);
|
||||
register_device_value(
|
||||
DeviceValueTAG::TAG_BOILER_DATA_WW, &wWRecharging_, DeviceValueType::BOOL, {}, F("wWRecharging"), F("Warm Water recharging"), DeviceValueUOM::NONE);
|
||||
DeviceValueTAG::TAG_BOILER_DATA_WW, &wWCharging_, DeviceValueType::BOOL, nullptr, F("wWCharging"), F("Warm Water charging"), DeviceValueUOM::NONE);
|
||||
register_device_value(DeviceValueTAG::TAG_BOILER_DATA_WW,
|
||||
&wWRecharging_,
|
||||
DeviceValueType::BOOL,
|
||||
nullptr,
|
||||
F("wWRecharging"),
|
||||
F("Warm Water recharging"),
|
||||
DeviceValueUOM::NONE);
|
||||
register_device_value(
|
||||
DeviceValueTAG::TAG_BOILER_DATA_WW, &wWTempOK_, DeviceValueType::BOOL, {}, F("wWTempOK"), F("Warm Water temperature ok"), DeviceValueUOM::NONE);
|
||||
register_device_value(DeviceValueTAG::TAG_BOILER_DATA_WW, &wWActive_, DeviceValueType::BOOL, {}, F("wWActive"), F("Warm Water active"), DeviceValueUOM::NONE);
|
||||
register_device_value(DeviceValueTAG::TAG_BOILER_DATA_WW, &wWHeat_, DeviceValueType::BOOL, {}, F("wWHeat"), F("Warm Water heating"), DeviceValueUOM::NONE);
|
||||
DeviceValueTAG::TAG_BOILER_DATA_WW, &wWTempOK_, DeviceValueType::BOOL, nullptr, F("wWTempOK"), F("Warm Water temperature ok"), DeviceValueUOM::NONE);
|
||||
register_device_value(DeviceValueTAG::TAG_BOILER_DATA_WW, &wWActive_, DeviceValueType::BOOL, nullptr, F("wWActive"), F("Warm Water active"), DeviceValueUOM::NONE);
|
||||
register_device_value(DeviceValueTAG::TAG_BOILER_DATA_WW, &wWHeat_, DeviceValueType::BOOL, nullptr, F("wWHeat"), F("Warm Water heating"), DeviceValueUOM::NONE);
|
||||
register_device_value(DeviceValueTAG::TAG_BOILER_DATA_WW,
|
||||
&wWSetPumpPower_,
|
||||
DeviceValueType::UINT,
|
||||
{},
|
||||
nullptr,
|
||||
F("wWSetPumpPower"),
|
||||
F("Warm Water pump set power"),
|
||||
DeviceValueUOM::PERCENT);
|
||||
register_device_value(DeviceValueTAG::TAG_BOILER_DATA_WW,
|
||||
&wwMixTemperature_,
|
||||
DeviceValueType::USHORT,
|
||||
{},
|
||||
nullptr,
|
||||
F("wwMixTemperature"),
|
||||
F("Warm Water mix temperature"),
|
||||
DeviceValueUOM::DEGREES);
|
||||
register_device_value(DeviceValueTAG::TAG_BOILER_DATA_WW,
|
||||
&wwBufferTemperature_,
|
||||
DeviceValueType::USHORT,
|
||||
{},
|
||||
nullptr,
|
||||
F("wwBufferTemperature"),
|
||||
F("Warm Water buffer boiler temperature"),
|
||||
DeviceValueUOM::DEGREES);
|
||||
register_device_value(DeviceValueTAG::TAG_BOILER_DATA_WW, &wWStarts_, DeviceValueType::ULONG, {}, F("wWStarts"), F("Warm Water # starts"), DeviceValueUOM::NONE);
|
||||
register_device_value(
|
||||
DeviceValueTAG::TAG_BOILER_DATA_WW, &wWStarts2_, DeviceValueType::ULONG, {}, F("wWStarts2"), F("Warm Water # starts (control)"), DeviceValueUOM::NONE);
|
||||
register_device_value(DeviceValueTAG::TAG_BOILER_DATA_WW, &wWWorkM_, DeviceValueType::TIME, {}, F("wWWorkM"), F("Warm Water active time"), DeviceValueUOM::MINUTES);
|
||||
DeviceValueTAG::TAG_BOILER_DATA_WW, &wWStarts_, DeviceValueType::ULONG, nullptr, F("wWStarts"), F("Warm Water # starts"), DeviceValueUOM::NONE);
|
||||
register_device_value(DeviceValueTAG::TAG_BOILER_DATA_WW,
|
||||
&wWStarts2_,
|
||||
DeviceValueType::ULONG,
|
||||
nullptr,
|
||||
F("wWStarts2"),
|
||||
F("Warm Water # starts (control)"),
|
||||
DeviceValueUOM::NONE);
|
||||
register_device_value(
|
||||
DeviceValueTAG::TAG_BOILER_DATA_WW, &wWWorkM_, DeviceValueType::TIME, nullptr, F("wWWorkM"), F("Warm Water active time"), DeviceValueUOM::MINUTES);
|
||||
|
||||
// info - boiler_data_info topic
|
||||
register_device_value(DeviceValueTAG::TAG_BOILER_DATA_INFO,
|
||||
&upTimeControl_,
|
||||
DeviceValueType::TIME,
|
||||
flash_string_vector{F("60")},
|
||||
FL_(div60),
|
||||
F("upTimeControl"),
|
||||
F("Operating time total heat"),
|
||||
DeviceValueUOM::MINUTES);
|
||||
register_device_value(DeviceValueTAG::TAG_BOILER_DATA_INFO,
|
||||
&upTimeCompHeating_,
|
||||
DeviceValueType::TIME,
|
||||
flash_string_vector{F("60")},
|
||||
FL_(div60),
|
||||
F("upTimeCompHeating"),
|
||||
F("Operating time compressor heating"),
|
||||
DeviceValueUOM::MINUTES);
|
||||
register_device_value(DeviceValueTAG::TAG_BOILER_DATA_INFO,
|
||||
&upTimeCompCooling_,
|
||||
DeviceValueType::TIME,
|
||||
flash_string_vector{F("60")},
|
||||
FL_(div60),
|
||||
F("upTimeCompCooling"),
|
||||
F("Operating time compressor cooling"),
|
||||
DeviceValueUOM::MINUTES);
|
||||
register_device_value(DeviceValueTAG::TAG_BOILER_DATA_INFO,
|
||||
&upTimeCompWw_,
|
||||
DeviceValueType::TIME,
|
||||
flash_string_vector{F("60")},
|
||||
FL_(div60),
|
||||
F("upTimeCompWw"),
|
||||
F("Operating time compressor warm water"),
|
||||
DeviceValueUOM::MINUTES);
|
||||
register_device_value(DeviceValueTAG::TAG_BOILER_DATA_INFO,
|
||||
&heatingStarts_,
|
||||
DeviceValueType::ULONG,
|
||||
{},
|
||||
nullptr,
|
||||
F("heatingStarts"),
|
||||
F("# heating starts (control)"),
|
||||
DeviceValueUOM::NONE);
|
||||
register_device_value(DeviceValueTAG::TAG_BOILER_DATA_INFO,
|
||||
&coolingStarts_,
|
||||
DeviceValueType::ULONG,
|
||||
{},
|
||||
nullptr,
|
||||
F("coolingStarts"),
|
||||
F("# cooling starts (control)"),
|
||||
DeviceValueUOM::NONE);
|
||||
register_device_value(DeviceValueTAG::TAG_BOILER_DATA_INFO,
|
||||
&nrgConsTotal_,
|
||||
DeviceValueType::ULONG,
|
||||
{},
|
||||
nullptr,
|
||||
F("nrgConsTotal"),
|
||||
F("Total energy consumption"),
|
||||
DeviceValueUOM::NONE);
|
||||
register_device_value(DeviceValueTAG::TAG_BOILER_DATA_INFO,
|
||||
&nrgConsCompTotal_,
|
||||
DeviceValueType::ULONG,
|
||||
{},
|
||||
nullptr,
|
||||
F("nrgConsCompTotal"),
|
||||
F("Energy consumption compressor total"),
|
||||
DeviceValueUOM::NONE);
|
||||
register_device_value(DeviceValueTAG::TAG_BOILER_DATA_INFO,
|
||||
&nrgConsCompHeating_,
|
||||
DeviceValueType::ULONG,
|
||||
{},
|
||||
nullptr,
|
||||
F("nrgConsCompHeating"),
|
||||
F("Energy consumption compressor heating"),
|
||||
DeviceValueUOM::NONE);
|
||||
register_device_value(DeviceValueTAG::TAG_BOILER_DATA_INFO,
|
||||
&nrgConsCompWw_,
|
||||
DeviceValueType::ULONG,
|
||||
{},
|
||||
nullptr,
|
||||
F("nrgConsCompWw"),
|
||||
F("Energy consumption compressor warm water"),
|
||||
DeviceValueUOM::NONE);
|
||||
register_device_value(DeviceValueTAG::TAG_BOILER_DATA_INFO,
|
||||
&nrgConsCompCooling_,
|
||||
DeviceValueType::ULONG,
|
||||
{},
|
||||
nullptr,
|
||||
F("nrgConsCompCooling"),
|
||||
F("Energy consumption compressor cooling"),
|
||||
DeviceValueUOM::NONE);
|
||||
register_device_value(
|
||||
DeviceValueTAG::TAG_BOILER_DATA_INFO, &nrgSuppTotal_, DeviceValueType::ULONG, {}, F("nrgSuppTotal"), F("Total energy supplied"), DeviceValueUOM::NONE);
|
||||
register_device_value(DeviceValueTAG::TAG_BOILER_DATA_INFO,
|
||||
&nrgSuppTotal_,
|
||||
DeviceValueType::ULONG,
|
||||
nullptr,
|
||||
F("nrgSuppTotal"),
|
||||
F("Total energy supplied"),
|
||||
DeviceValueUOM::NONE);
|
||||
register_device_value(DeviceValueTAG::TAG_BOILER_DATA_INFO,
|
||||
&nrgSuppHeating_,
|
||||
DeviceValueType::ULONG,
|
||||
{},
|
||||
nullptr,
|
||||
F("nrgSuppHeating"),
|
||||
F("Total energy supplied heating"),
|
||||
DeviceValueUOM::NONE);
|
||||
register_device_value(DeviceValueTAG::TAG_BOILER_DATA_INFO,
|
||||
&nrgSuppWw_,
|
||||
DeviceValueType::ULONG,
|
||||
{},
|
||||
nullptr,
|
||||
F("nrgSuppWw"),
|
||||
F("Total energy warm supplied warm water"),
|
||||
DeviceValueUOM::NONE);
|
||||
register_device_value(DeviceValueTAG::TAG_BOILER_DATA_INFO,
|
||||
&nrgSuppCooling_,
|
||||
DeviceValueType::ULONG,
|
||||
{},
|
||||
nullptr,
|
||||
F("nrgSuppCooling"),
|
||||
F("Total energy supplied cooling"),
|
||||
DeviceValueUOM::NONE);
|
||||
register_device_value(DeviceValueTAG::TAG_BOILER_DATA_INFO,
|
||||
&auxElecHeatNrgConsTotal_,
|
||||
DeviceValueType::ULONG,
|
||||
{},
|
||||
nullptr,
|
||||
F("auxElecHeatNrgConsTotal"),
|
||||
F("Auxiliary electrical heater energy consumption total"),
|
||||
DeviceValueUOM::NONE);
|
||||
register_device_value(DeviceValueTAG::TAG_BOILER_DATA_INFO,
|
||||
&auxElecHeatNrgConsHeating_,
|
||||
DeviceValueType::ULONG,
|
||||
{},
|
||||
nullptr,
|
||||
F("auxElecHeatNrgConsHeating"),
|
||||
F("Auxiliary electrical heater energy consumption heating"),
|
||||
DeviceValueUOM::NONE);
|
||||
register_device_value(DeviceValueTAG::TAG_BOILER_DATA_INFO,
|
||||
&auxElecHeatNrgConsDHW_,
|
||||
DeviceValueType::ULONG,
|
||||
{},
|
||||
nullptr,
|
||||
F("auxElecHeatNrgConsDHW"),
|
||||
F("Auxiliary electrical heater energy consumption DHW"),
|
||||
DeviceValueUOM::NONE);
|
||||
register_device_value(DeviceValueTAG::TAG_BOILER_DATA_INFO,
|
||||
&maintenanceMessage_,
|
||||
DeviceValueType::TEXT,
|
||||
{},
|
||||
nullptr,
|
||||
F("maintenanceMessage"),
|
||||
F("Maintenance message"),
|
||||
DeviceValueUOM::NONE);
|
||||
register_device_value(DeviceValueTAG::TAG_BOILER_DATA_INFO,
|
||||
&maintenanceDate_,
|
||||
DeviceValueType::TEXT,
|
||||
{},
|
||||
nullptr,
|
||||
F("maintenanceDate"),
|
||||
F("Maintenance set date"),
|
||||
DeviceValueUOM::NONE);
|
||||
register_device_value(DeviceValueTAG::TAG_BOILER_DATA_INFO,
|
||||
&maintenanceType_,
|
||||
DeviceValueType::ENUM,
|
||||
flash_string_vector{F("off"), F("time"), F("date")},
|
||||
FL_(enum_off_time_date),
|
||||
F("maintenanceType"),
|
||||
F("Scheduled maintenance"),
|
||||
DeviceValueUOM::NONE);
|
||||
register_device_value(DeviceValueTAG::TAG_BOILER_DATA_INFO,
|
||||
&maintenanceTime_,
|
||||
DeviceValueType::UINT,
|
||||
{},
|
||||
nullptr,
|
||||
F("maintenanceTime"),
|
||||
F("Maintenance set time"),
|
||||
DeviceValueUOM::NONE);
|
||||
@@ -680,11 +711,12 @@ void Boiler::process_UBAMonitorFastPlus(std::shared_ptr<const Telegram> telegram
|
||||
has_update(telegram->read_value(serviceCodeNumber_, 4));
|
||||
|
||||
// at this point do a quick check to see if the hot water or heating is active
|
||||
uint8_t state = 0;
|
||||
telegram->read_value(state, 11);
|
||||
boilerState_ = state & 0x01 ? 0x08 : 0;
|
||||
boilerState_ |= state & 0x02 ? 0x01 : 0;
|
||||
boilerState_ |= state & 0x04 ? 0x02 : 0;
|
||||
uint8_t state = EMS_VALUE_UINT_NOTSET;
|
||||
if (telegram->read_value(state, 11)) {
|
||||
boilerState_ = state & 0x01 ? 0x08 : 0;
|
||||
boilerState_ |= state & 0x02 ? 0x01 : 0;
|
||||
boilerState_ |= state & 0x04 ? 0x02 : 0;
|
||||
}
|
||||
|
||||
check_active(); // do a quick check to see if the hot water or heating is active
|
||||
}
|
||||
@@ -870,6 +902,9 @@ void Boiler::process_UBAMaintenanceStatus(std::shared_ptr<const Telegram> telegr
|
||||
|
||||
// 0x10, 0x11
|
||||
void Boiler::process_UBAErrorMessage(std::shared_ptr<const Telegram> telegram) {
|
||||
if (telegram->offset > 0 || telegram->message_length < 9) {
|
||||
return;
|
||||
}
|
||||
// data: displaycode(2), errornumber(2), year, month, hour, day, minute, duration(2), src-addr
|
||||
if (telegram->message_data[4] & 0x80) { // valid date
|
||||
|
||||
@@ -896,6 +931,9 @@ void Boiler::process_UBAErrorMessage(std::shared_ptr<const Telegram> telegram) {
|
||||
|
||||
// 0x15
|
||||
void Boiler::process_UBAMaintenanceData(std::shared_ptr<const Telegram> telegram) {
|
||||
if (telegram->offset > 0 || telegram->message_length < 5) {
|
||||
return;
|
||||
}
|
||||
// first byte: Maintenance messages (0 = none, 1 = by operating hours, 2 = by date)
|
||||
|
||||
telegram->read_value(maintenanceType_, 0);
|
||||
|
||||
@@ -19,18 +19,7 @@
|
||||
#ifndef EMSESP_BOILER_H
|
||||
#define EMSESP_BOILER_H
|
||||
|
||||
#include <Arduino.h>
|
||||
#include <ArduinoJson.h>
|
||||
|
||||
#include <uuid/log.h>
|
||||
|
||||
#include <string>
|
||||
|
||||
#include "emsdevice.h"
|
||||
#include "telegram.h"
|
||||
#include "emsesp.h"
|
||||
#include "helpers.h"
|
||||
#include "mqtt.h"
|
||||
|
||||
namespace emsesp {
|
||||
|
||||
|
||||
@@ -19,15 +19,7 @@
|
||||
#ifndef EMSESP_CONNECT_H
|
||||
#define EMSESP_CONNECT_H
|
||||
|
||||
#include <Arduino.h>
|
||||
#include <ArduinoJson.h>
|
||||
|
||||
#include <uuid/log.h>
|
||||
|
||||
#include "emsdevice.h"
|
||||
#include "telegram.h"
|
||||
#include "helpers.h"
|
||||
#include "mqtt.h"
|
||||
#include "emsesp.h"
|
||||
|
||||
namespace emsesp {
|
||||
|
||||
|
||||
@@ -19,15 +19,7 @@
|
||||
#ifndef EMSESP_CONTROLLER_H
|
||||
#define EMSESP_CONTROLLER_H
|
||||
|
||||
#include <Arduino.h>
|
||||
#include <ArduinoJson.h>
|
||||
|
||||
#include <uuid/log.h>
|
||||
|
||||
#include "emsdevice.h"
|
||||
#include "telegram.h"
|
||||
#include "helpers.h"
|
||||
#include "mqtt.h"
|
||||
#include "emsesp.h"
|
||||
|
||||
namespace emsesp {
|
||||
|
||||
|
||||
@@ -19,15 +19,7 @@
|
||||
#ifndef EMSESP_GATEWAY_H
|
||||
#define EMSESP_GATEWAY_H
|
||||
|
||||
#include <Arduino.h>
|
||||
#include <ArduinoJson.h>
|
||||
|
||||
#include <uuid/log.h>
|
||||
|
||||
#include "emsdevice.h"
|
||||
#include "telegram.h"
|
||||
#include "helpers.h"
|
||||
#include "mqtt.h"
|
||||
#include "emsesp.h"
|
||||
|
||||
namespace emsesp {
|
||||
|
||||
|
||||
@@ -19,15 +19,7 @@
|
||||
#ifndef EMSESP_GENERIC_H
|
||||
#define EMSESP_GENERIC_H
|
||||
|
||||
#include <Arduino.h>
|
||||
#include <ArduinoJson.h>
|
||||
|
||||
#include <uuid/log.h>
|
||||
|
||||
#include "emsdevice.h"
|
||||
#include "telegram.h"
|
||||
#include "helpers.h"
|
||||
#include "mqtt.h"
|
||||
#include "emsesp.h"
|
||||
|
||||
namespace emsesp {
|
||||
|
||||
|
||||
@@ -32,8 +32,11 @@ Heatpump::Heatpump(uint8_t device_type, uint8_t device_id, uint8_t product_id, c
|
||||
register_telegram_type(0x042B, F("HP1"), true, [&](std::shared_ptr<const Telegram> t) { process_HPMonitor1(t); });
|
||||
register_telegram_type(0x047B, F("HP2"), true, [&](std::shared_ptr<const Telegram> t) { process_HPMonitor2(t); });
|
||||
|
||||
register_device_value(DeviceValueTAG::TAG_NONE, &airHumidity_, DeviceValueType::UINT, flash_string_vector{F("2")}, F("airHumidity"), F("Relative air humidity"), DeviceValueUOM::NONE);
|
||||
register_device_value(DeviceValueTAG::TAG_NONE, &dewTemperature_, DeviceValueType::UINT, {}, F("dewTemperature"), F("Dew point temperature"), DeviceValueUOM::NONE);
|
||||
// device values
|
||||
register_device_value(
|
||||
DeviceValueTAG::TAG_NONE, &airHumidity_, DeviceValueType::UINT, FL_(div2), F("airHumidity"), F("Relative air humidity"), DeviceValueUOM::NONE);
|
||||
register_device_value(
|
||||
DeviceValueTAG::TAG_NONE, &dewTemperature_, DeviceValueType::UINT, nullptr, F("dewTemperature"), F("Dew point temperature"), DeviceValueUOM::NONE);
|
||||
}
|
||||
|
||||
// publish HA config
|
||||
|
||||
@@ -19,16 +19,7 @@
|
||||
#ifndef EMSESP_HEATPUMP_H
|
||||
#define EMSESP_HEATPUMP_H
|
||||
|
||||
#include <Arduino.h>
|
||||
#include <ArduinoJson.h>
|
||||
|
||||
#include <uuid/log.h>
|
||||
|
||||
#include "emsdevice.h"
|
||||
#include "emsesp.h"
|
||||
#include "telegram.h"
|
||||
#include "helpers.h"
|
||||
#include "mqtt.h"
|
||||
|
||||
namespace emsesp {
|
||||
|
||||
|
||||
@@ -53,6 +53,7 @@ Mixer::Mixer(uint8_t device_type, uint8_t device_id, uint8_t product_id, const s
|
||||
if (flags == EMSdevice::EMS_DEVICE_FLAG_IPM) {
|
||||
register_telegram_type(0x010C, F("IPMSetMessage"), false, [&](std::shared_ptr<const Telegram> t) { process_IPMStatusMessage(t); });
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -74,10 +75,10 @@ void Mixer::register_values(const Type type, uint16_t hc) {
|
||||
tag = DeviceValueTAG::TAG_WWC1 + hc - 1;
|
||||
}
|
||||
|
||||
register_device_value(tag, &flowTemp_, DeviceValueType::USHORT, flash_string_vector{F("10")}, F("flowTemp"), F("Current flow temperature"), DeviceValueUOM::DEGREES);
|
||||
register_device_value(tag, &flowSetTemp_, DeviceValueType::UINT, {}, F("flowSetTemp"), F("Setpoint flow temperature"), DeviceValueUOM::DEGREES);
|
||||
register_device_value(tag, &pumpStatus_, DeviceValueType::BOOL, {}, F("pumpStatus"), F("Pump/Valve status"), DeviceValueUOM::NONE);
|
||||
register_device_value(tag, &status_, DeviceValueType::INT, {}, F("status"), F("Current status"), DeviceValueUOM::NONE);
|
||||
register_device_value(tag, &flowTemp_, DeviceValueType::USHORT, FL_(div10), F("flowTemp"), F("Current flow temperature"), DeviceValueUOM::DEGREES);
|
||||
register_device_value(tag, &flowSetTemp_, DeviceValueType::UINT, nullptr, F("flowSetTemp"), F("Setpoint flow temperature"), DeviceValueUOM::DEGREES);
|
||||
register_device_value(tag, &pumpStatus_, DeviceValueType::BOOL, nullptr, F("pumpStatus"), F("Pump/Valve status"), DeviceValueUOM::NONE);
|
||||
register_device_value(tag, &status_, DeviceValueType::INT, nullptr, F("status"), F("Current status"), DeviceValueUOM::NONE);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -19,16 +19,7 @@
|
||||
#ifndef EMSESP_MIXER_H
|
||||
#define EMSESP_MIXER_H
|
||||
|
||||
#include <Arduino.h>
|
||||
#include <ArduinoJson.h>
|
||||
|
||||
#include <uuid/log.h>
|
||||
|
||||
#include "emsdevice.h"
|
||||
#include "emsesp.h"
|
||||
#include "telegram.h"
|
||||
#include "helpers.h"
|
||||
#include "mqtt.h"
|
||||
|
||||
namespace emsesp {
|
||||
|
||||
|
||||
@@ -60,37 +60,39 @@ Solar::Solar(uint8_t device_type, uint8_t device_id, uint8_t product_id, const s
|
||||
register_telegram_type(0x0101, F("ISM1Set"), false, [&](std::shared_ptr<const Telegram> t) { process_ISM1Set(t); });
|
||||
}
|
||||
|
||||
// device values...
|
||||
|
||||
// special case for a device_id with 0x2A where it's not actual a solar module
|
||||
if (device_id == 0x2A) {
|
||||
register_device_value(DeviceValueTAG::TAG_NONE, &type_, DeviceValueType::TEXT, {}, F("type"), F("Type"), DeviceValueUOM::NONE);
|
||||
register_device_value(DeviceValueTAG::TAG_NONE, &type_, DeviceValueType::TEXT, nullptr, F("type"), F("Type"), DeviceValueUOM::NONE);
|
||||
strncpy(type_, "warm water circuit", sizeof(type_));
|
||||
}
|
||||
|
||||
register_device_value(DeviceValueTAG::TAG_NONE,
|
||||
&collectorTemp_,
|
||||
DeviceValueType::SHORT,
|
||||
flash_string_vector{F("10")},
|
||||
FL_(div10),
|
||||
F("collectorTemp"),
|
||||
F("Collector temperature (TS1)"),
|
||||
DeviceValueUOM::DEGREES);
|
||||
register_device_value(DeviceValueTAG::TAG_NONE,
|
||||
&tankBottomTemp_,
|
||||
DeviceValueType::SHORT,
|
||||
flash_string_vector{F("10")},
|
||||
FL_(div10),
|
||||
F("tankBottomTemp"),
|
||||
F("Bottom temperature (TS2)"),
|
||||
DeviceValueUOM::DEGREES);
|
||||
register_device_value(DeviceValueTAG::TAG_NONE,
|
||||
&tankBottomTemp2_,
|
||||
DeviceValueType::SHORT,
|
||||
flash_string_vector{F("10")},
|
||||
FL_(div10),
|
||||
F("tankBottomTemp2"),
|
||||
F("Bottom temperature (TS5)"),
|
||||
DeviceValueUOM::DEGREES);
|
||||
register_device_value(DeviceValueTAG::TAG_NONE,
|
||||
&heatExchangerTemp_,
|
||||
DeviceValueType::SHORT,
|
||||
{F("10")},
|
||||
FL_(div10),
|
||||
F("heatExchangerTemp"),
|
||||
F("Heat exchanger temperature (TS6)"),
|
||||
DeviceValueUOM::DEGREES);
|
||||
@@ -98,43 +100,37 @@ Solar::Solar(uint8_t device_type, uint8_t device_id, uint8_t product_id, const s
|
||||
register_device_value(DeviceValueTAG::TAG_NONE,
|
||||
&tank1MaxTempCurrent_,
|
||||
DeviceValueType::UINT,
|
||||
{},
|
||||
nullptr,
|
||||
F("tank1MaxTempCurrent"),
|
||||
F("Maximum Tank temperature"),
|
||||
DeviceValueUOM::NONE);
|
||||
register_device_value(DeviceValueTAG::TAG_NONE,
|
||||
&solarPumpModulation_,
|
||||
DeviceValueType::UINT,
|
||||
{},
|
||||
nullptr,
|
||||
F("solarPumpModulation"),
|
||||
F("Solar pump modulation (PS1)"),
|
||||
DeviceValueUOM::PERCENT);
|
||||
register_device_value(
|
||||
DeviceValueTAG::TAG_NONE, &cylinderPumpModulation_, DeviceValueType::UINT, {}, F("cylinderPumpModulation"), F("Cylinder pump modulation (PS5)"), DeviceValueUOM::PERCENT);
|
||||
|
||||
register_device_value(DeviceValueTAG::TAG_NONE, &solarPump_, DeviceValueType::BOOL, {}, F("solarPump"), F("Solar pump (PS1) active"), DeviceValueUOM::NONE);
|
||||
register_device_value(DeviceValueTAG::TAG_NONE, &valveStatus_, DeviceValueType::BOOL, {}, F("valveStatus"), F("Valve status"), DeviceValueUOM::NONE);
|
||||
register_device_value(DeviceValueTAG::TAG_NONE, &tankHeated_, DeviceValueType::BOOL, {}, F("tankHeated"), F("Tank heated"), DeviceValueUOM::NONE);
|
||||
register_device_value(
|
||||
DeviceValueTAG::TAG_NONE, &collectorShutdown_, DeviceValueType::BOOL, {}, F("collectorShutdown"), F("Collector shutdown"), DeviceValueUOM::NONE);
|
||||
|
||||
register_device_value(DeviceValueTAG::TAG_NONE, &pumpWorkMin_, DeviceValueType::TIME, {}, F("pumpWorkMin"), F("Pump working time"), DeviceValueUOM::MINUTES);
|
||||
|
||||
register_device_value(DeviceValueTAG::TAG_NONE,
|
||||
&energyLastHour_,
|
||||
DeviceValueType::ULONG,
|
||||
flash_string_vector{F("10")},
|
||||
F("energyLastHour"),
|
||||
F("Energy last hour"),
|
||||
DeviceValueUOM::WH);
|
||||
register_device_value(DeviceValueTAG::TAG_NONE,
|
||||
&energyTotal_,
|
||||
DeviceValueType::ULONG,
|
||||
flash_string_vector{F("10")},
|
||||
F("energyTotal"),
|
||||
F("Energy total"),
|
||||
DeviceValueUOM::KWH);
|
||||
register_device_value(DeviceValueTAG::TAG_NONE, &energyToday_, DeviceValueType::ULONG, {}, F("energyToday"), F("Energy today"), DeviceValueUOM::WH);
|
||||
&cylinderPumpModulation_,
|
||||
DeviceValueType::UINT,
|
||||
nullptr,
|
||||
F("cylinderPumpModulation"),
|
||||
F("Cylinder pump modulation (PS5)"),
|
||||
DeviceValueUOM::PERCENT);
|
||||
|
||||
register_device_value(DeviceValueTAG::TAG_NONE, &solarPump_, DeviceValueType::BOOL, nullptr, F("solarPump"), F("Solar pump (PS1) active"), DeviceValueUOM::NONE);
|
||||
register_device_value(DeviceValueTAG::TAG_NONE, &valveStatus_, DeviceValueType::BOOL, nullptr, F("valveStatus"), F("Valve status"), DeviceValueUOM::NONE);
|
||||
register_device_value(DeviceValueTAG::TAG_NONE, &tankHeated_, DeviceValueType::BOOL, nullptr, F("tankHeated"), F("Tank heated"), DeviceValueUOM::NONE);
|
||||
register_device_value(
|
||||
DeviceValueTAG::TAG_NONE, &collectorShutdown_, DeviceValueType::BOOL, nullptr, F("collectorShutdown"), F("Collector shutdown"), DeviceValueUOM::NONE);
|
||||
|
||||
register_device_value(DeviceValueTAG::TAG_NONE, &pumpWorkMin_, DeviceValueType::TIME, nullptr, F("pumpWorkMin"), F("Pump working time"), DeviceValueUOM::MINUTES);
|
||||
|
||||
register_device_value(
|
||||
DeviceValueTAG::TAG_NONE, &energyLastHour_, DeviceValueType::ULONG, FL_(div10), F("energyLastHour"), F("Energy last hour"), DeviceValueUOM::WH);
|
||||
register_device_value(DeviceValueTAG::TAG_NONE, &energyTotal_, DeviceValueType::ULONG, FL_(div10), F("energyTotal"), F("Energy total"), DeviceValueUOM::KWH);
|
||||
register_device_value(DeviceValueTAG::TAG_NONE, &energyToday_, DeviceValueType::ULONG, nullptr, F("energyToday"), F("Energy today"), DeviceValueUOM::WH);
|
||||
}
|
||||
|
||||
// publish HA config
|
||||
|
||||
@@ -19,16 +19,7 @@
|
||||
#ifndef EMSESP_SOLAR_H
|
||||
#define EMSESP_SOLAR_H
|
||||
|
||||
#include <Arduino.h>
|
||||
#include <ArduinoJson.h>
|
||||
|
||||
#include <uuid/log.h>
|
||||
|
||||
#include "emsdevice.h"
|
||||
#include "emsesp.h"
|
||||
#include "telegram.h"
|
||||
#include "helpers.h"
|
||||
#include "mqtt.h"
|
||||
|
||||
namespace emsesp {
|
||||
|
||||
|
||||
@@ -34,15 +34,10 @@ Switch::Switch(uint8_t device_type, uint8_t device_id, uint8_t product_id, const
|
||||
register_telegram_type(0x9D, F("WM10SetMessage"), false, [&](std::shared_ptr<const Telegram> t) { process_WM10SetMessage(t); });
|
||||
register_telegram_type(0x1E, F("WM10TempMessage"), false, [&](std::shared_ptr<const Telegram> t) { process_WM10TempMessage(t); });
|
||||
|
||||
register_device_value(DeviceValueTAG::TAG_NONE, &activated_, DeviceValueType::BOOL, {}, F("activated"), F("Activated"), DeviceValueUOM::NONE);
|
||||
register_device_value(DeviceValueTAG::TAG_NONE,
|
||||
&flowTemp_,
|
||||
DeviceValueType::USHORT,
|
||||
flash_string_vector{F("10")},
|
||||
F("flowTemp"),
|
||||
F("Current flow temperature"),
|
||||
DeviceValueUOM::DEGREES);
|
||||
register_device_value(DeviceValueTAG::TAG_NONE, &status_, DeviceValueType::INT, {}, F("status"), F("Status"), DeviceValueUOM::NONE);
|
||||
register_device_value(DeviceValueTAG::TAG_NONE, &activated_, DeviceValueType::BOOL, nullptr, F("activated"), F("Activated"), DeviceValueUOM::NONE);
|
||||
register_device_value(
|
||||
DeviceValueTAG::TAG_NONE, &flowTemp_, DeviceValueType::USHORT, FL_(div10), F("flowTemp"), F("Current flow temperature"), DeviceValueUOM::DEGREES);
|
||||
register_device_value(DeviceValueTAG::TAG_NONE, &status_, DeviceValueType::INT, nullptr, F("status"), F("Status"), DeviceValueUOM::NONE);
|
||||
}
|
||||
|
||||
// publish HA config
|
||||
|
||||
@@ -19,16 +19,7 @@
|
||||
#ifndef EMSESP_SWITCH_H
|
||||
#define EMSESP_SWITCH_H
|
||||
|
||||
#include <Arduino.h>
|
||||
#include <ArduinoJson.h>
|
||||
|
||||
#include <uuid/log.h>
|
||||
|
||||
#include "emsdevice.h"
|
||||
#include "emsesp.h"
|
||||
#include "telegram.h"
|
||||
#include "helpers.h"
|
||||
#include "mqtt.h"
|
||||
|
||||
namespace emsesp {
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ Thermostat::Thermostat(uint8_t device_type, uint8_t device_id, uint8_t product_i
|
||||
&& ((actual_master_thermostat == EMSESP_DEFAULT_MASTER_THERMOSTAT) || (device_id < actual_master_thermostat)))) {
|
||||
EMSESP::actual_master_thermostat(device_id);
|
||||
actual_master_thermostat = device_id;
|
||||
reserve_mem(25); // reserve some space for the telegram registries, to avoid memory fragmentation
|
||||
reserve_telgram_functions(25); // reserve some space for the telegram registries, to avoid memory fragmentation
|
||||
|
||||
// common telegram handlers
|
||||
register_telegram_type(EMS_TYPE_RCOutdoorTemp, F("RCOutdoorTemp"), false, [&](std::shared_ptr<const Telegram> t) { process_RCOutdoorTemp(t); });
|
||||
@@ -868,6 +868,10 @@ void Thermostat::process_RC35Monitor(std::shared_ptr<const Telegram> telegram) {
|
||||
// exit if the 15th byte (second from last) is 0x00, which I think is calculated flow setpoint temperature
|
||||
// with weather controlled RC35s this value is >=5, otherwise can be zero and our setpoint temps will be incorrect
|
||||
// see https://github.com/proddy/EMS-ESP/issues/373#issuecomment-627907301
|
||||
if (telegram->offset > 0 || telegram->message_length < 15) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (telegram->message_data[14] == 0x00) {
|
||||
return;
|
||||
}
|
||||
@@ -890,7 +894,7 @@ void Thermostat::process_RC35Monitor(std::shared_ptr<const Telegram> telegram) {
|
||||
// type 0x3D (HC1), 0x47 (HC2), 0x51 (HC3), 0x5B (HC4) - Working Mode Heating - for reading the mode from the RC35 thermostat (0x10)
|
||||
void Thermostat::process_RC35Set(std::shared_ptr<const Telegram> telegram) {
|
||||
// check to see we have a valid type. heating: 1 radiator, 2 convectors, 3 floors, 4 room supply
|
||||
if (telegram->message_data[0] == 0x00) {
|
||||
if (telegram->offset == 0 && telegram->message_data[0] == 0x00) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -935,6 +939,10 @@ void Thermostat::process_RC35Timer(std::shared_ptr<const Telegram> telegram) {
|
||||
|
||||
// process_RCTime - type 0x06 - date and time from a thermostat - 14 bytes long
|
||||
void Thermostat::process_RCTime(std::shared_ptr<const Telegram> telegram) {
|
||||
if (telegram->offset > 0 || telegram->message_length < 5) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (flags() == EMS_DEVICE_FLAG_EASY) {
|
||||
return; // not supported
|
||||
}
|
||||
@@ -975,6 +983,10 @@ void Thermostat::process_RCTime(std::shared_ptr<const Telegram> telegram) {
|
||||
// 10 00 A2 00 41 32 32 03 30 00 02 00 00 00 00 00 00 02 CRC
|
||||
// A 2 2 816
|
||||
void Thermostat::process_RCError(std::shared_ptr<const Telegram> telegram) {
|
||||
if (telegram->offset > 0 || telegram->message_length < 5) {
|
||||
return;
|
||||
}
|
||||
|
||||
char buf[4];
|
||||
buf[0] = telegram->message_data[0];
|
||||
buf[1] = telegram->message_data[1];
|
||||
@@ -986,6 +998,10 @@ void Thermostat::process_RCError(std::shared_ptr<const Telegram> telegram) {
|
||||
|
||||
// 0x12 error log
|
||||
void Thermostat::process_RCErrorMessage(std::shared_ptr<const Telegram> telegram) {
|
||||
if (telegram->offset > 0 || telegram->message_length < 12) {
|
||||
return;
|
||||
}
|
||||
|
||||
// data: displaycode(2), errornumber(2), year, month, hour, day, minute, duration(2), src-addr
|
||||
if (telegram->message_data[4] & 0x80) { // valid date
|
||||
char code[3];
|
||||
@@ -1011,7 +1027,7 @@ bool Thermostat::set_minexttemp(const char * value, const int8_t id) {
|
||||
return false;
|
||||
}
|
||||
|
||||
LOG_INFO(F("Setting min external temperature to %d"), mt);
|
||||
LOG_INFO(F("Setting min external temperature to %d C"), mt);
|
||||
if ((model() == EMS_DEVICE_FLAG_RC300) || (model() == EMS_DEVICE_FLAG_RC100)) {
|
||||
write_command(0x240, 10, mt, 0x240);
|
||||
} else {
|
||||
@@ -1128,7 +1144,7 @@ bool Thermostat::set_control(const char * value, const int8_t id) {
|
||||
|
||||
uint8_t hc_num = (id == -1) ? AUTO_HEATING_CIRCUIT : id;
|
||||
std::shared_ptr<Thermostat::HeatingCircuit> hc = heating_circuit(hc_num);
|
||||
if (hc == nullptr || ctrl > 2) {
|
||||
if (hc == nullptr) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1238,12 +1254,20 @@ bool Thermostat::set_holiday(const char * value, const int8_t id) {
|
||||
data[0] = (hd[0] - '0') * 10 + (hd[1] - '0');
|
||||
data[1] = (hd[3] - '0') * 10 + (hd[4] - '0');
|
||||
data[2] = (hd[7] - '0') * 100 + (hd[8] - '0') * 10 + (hd[9] - '0');
|
||||
data[3] = (hd[11] - '0') * 10 + (hd[11] - '0');
|
||||
data[3] = (hd[11] - '0') * 10 + (hd[12] - '0');
|
||||
data[4] = (hd[14] - '0') * 10 + (hd[15] - '0');
|
||||
data[5] = (hd[18] - '0') * 100 + (hd[19] - '0') * 10 + (hd[20] - '0');
|
||||
|
||||
LOG_INFO(F("Setting holiday for hc %d"), hc->hc_num());
|
||||
write_command(timer_typeids[hc->hc_num() - 1], 87, data, 6, 0);
|
||||
if (hd[10] == '-') {
|
||||
LOG_INFO(F("Setting holiday away from home for hc %d"), hc->hc_num());
|
||||
write_command(timer_typeids[hc->hc_num() - 1], 87, data, 6, 0);
|
||||
} else if (hd[10] == '+') {
|
||||
LOG_INFO(F("Setting holiday at home for hc %d"), hc->hc_num());
|
||||
write_command(timer_typeids[hc->hc_num() - 1], 93, data, 6, 0);
|
||||
} else {
|
||||
LOG_WARNING(F("Set holiday: Invalid"));
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -2004,6 +2028,7 @@ void Thermostat::add_commands() {
|
||||
register_mqtt_cmd(F("clockoffset"), [&](const char * value, const int8_t id) { return set_clockoffset(value, id); });
|
||||
register_mqtt_cmd(F("language"), [&](const char * value, const int8_t id) { return set_language(value, id); });
|
||||
register_mqtt_cmd(F("display"), [&](const char * value, const int8_t id) { return set_display(value, id); });
|
||||
break;
|
||||
case EMS_DEVICE_FLAG_RC35: // RC30 and RC35
|
||||
register_mqtt_cmd(F("nighttemp"), [&](const char * value, const int8_t id) { return set_nighttemp(value, id); });
|
||||
register_mqtt_cmd(F("daytemp"), [&](const char * value, const int8_t id) { return set_daytemp(value, id); });
|
||||
@@ -2042,41 +2067,43 @@ void Thermostat::add_commands() {
|
||||
|
||||
// register main device values, top level for all thermostats (non heating circuit)
|
||||
void Thermostat::register_device_values() {
|
||||
/*
|
||||
|
||||
uint8_t model = this->model();
|
||||
|
||||
// Common for all thermostats
|
||||
register_device_value(DeviceValueTAG::TAG_NONE, &dateTime_, DeviceValueType::TEXT, {}, F("dateTime"), F("Date/Time"), DeviceValueUOM::NONE);
|
||||
register_device_value(DeviceValueTAG::TAG_NONE, &errorCode_, DeviceValueType::TEXT, {}, F("errorCode"), F("Error code"), DeviceValueUOM::NONE);
|
||||
register_device_value(DeviceValueTAG::TAG_NONE, &lastCode_, DeviceValueType::TEXT, {}, F("lastCode"), F("Last error"), DeviceValueUOM::NONE);
|
||||
register_device_value(DeviceValueTAG::TAG_NONE, &wwTemp_, DeviceValueType::UINT, {}, F("wwTemp"), F("Warm water high temperature"), DeviceValueUOM::DEGREES);
|
||||
register_device_value(DeviceValueTAG::TAG_NONE, &wwTempLow_, DeviceValueType::UINT, {}, F("wwTempLow"), F("Warm water low temperature"), DeviceValueUOM::DEGREES);
|
||||
register_device_value(DeviceValueTAG::TAG_NONE, &wwExtra1_, DeviceValueType::UINT, {}, F("wwExtra1"), F("Warm water circuit 1 extra"), DeviceValueUOM::DEGREES);
|
||||
register_device_value(DeviceValueTAG::TAG_NONE, &wwExtra2_, DeviceValueType::UINT, {}, F("wwExtra2"), F("Warm water circuit 2 extra"), DeviceValueUOM::DEGREES);
|
||||
register_device_value(DeviceValueTAG::TAG_NONE, &dateTime_, DeviceValueType::TEXT,nullptr, F("dateTime"), F("Date/Time"), DeviceValueUOM::NONE);
|
||||
register_device_value(DeviceValueTAG::TAG_NONE, &errorCode_, DeviceValueType::TEXT,nullptr, F("errorCode"), F("Error code"), DeviceValueUOM::NONE);
|
||||
register_device_value(DeviceValueTAG::TAG_NONE, &lastCode_, DeviceValueType::TEXT,nullptr, F("lastCode"), F("Last error"), DeviceValueUOM::NONE);
|
||||
register_device_value(DeviceValueTAG::TAG_NONE, &wwTemp_, DeviceValueType::UINT,nullptr, F("wwTemp"), F("Warm water high temperature"), DeviceValueUOM::DEGREES);
|
||||
register_device_value(DeviceValueTAG::TAG_NONE, &wwTempLow_, DeviceValueType::UINT,nullptr, F("wwTempLow"), F("Warm water low temperature"), DeviceValueUOM::DEGREES);
|
||||
register_device_value(DeviceValueTAG::TAG_NONE, &wwExtra1_, DeviceValueType::UINT,nullptr, F("wwExtra1"), F("Warm water circuit 1 extra"), DeviceValueUOM::DEGREES);
|
||||
register_device_value(DeviceValueTAG::TAG_NONE, &wwExtra2_, DeviceValueType::UINT,nullptr, F("wwExtra2"), F("Warm water circuit 2 extra"), DeviceValueUOM::DEGREES);
|
||||
register_device_value(DeviceValueTAG::TAG_NONE,
|
||||
&tempsensor1_,
|
||||
DeviceValueType::USHORT,
|
||||
flash_string_vector{F("10")},
|
||||
FL_(div10),
|
||||
F("inttemp1"),
|
||||
F("Temperature sensor 1"),
|
||||
DeviceValueUOM::DEGREES);
|
||||
register_device_value(DeviceValueTAG::TAG_NONE,
|
||||
&tempsensor2_,
|
||||
DeviceValueType::USHORT,
|
||||
flash_string_vector{F("10")},
|
||||
FL_(div10),
|
||||
F("inttemp2"),
|
||||
F("Temperature sensor 2"),
|
||||
DeviceValueUOM::DEGREES);
|
||||
register_device_value(DeviceValueTAG::TAG_NONE,
|
||||
&ibaCalIntTemperature_,
|
||||
DeviceValueType::INT,
|
||||
flash_string_vector{F("2")},
|
||||
FL_(div2),
|
||||
F("intoffset"),
|
||||
F("Offset int. temperature"),
|
||||
DeviceValueUOM::DEGREES);
|
||||
register_device_value(DeviceValueTAG::TAG_NONE,
|
||||
&ibaMinExtTemperature_,
|
||||
DeviceValueType::INT,
|
||||
{},
|
||||
nullptr,
|
||||
F("minexttemp"),
|
||||
F("Min ext. temperature"),
|
||||
DeviceValueUOM::DEGREES); // min ext temp for heating curve, in deg.
|
||||
@@ -2108,7 +2135,7 @@ void Thermostat::register_device_values() {
|
||||
register_device_value(DeviceValueTAG::TAG_NONE,
|
||||
&ibaClockOffset_,
|
||||
DeviceValueType::UINT,
|
||||
{},
|
||||
nullptr,
|
||||
F("ibaClockOffset"),
|
||||
F("Clock offset"),
|
||||
DeviceValueUOM::NONE); // offset (in sec) to clock, 0xff=-1s, 0x02=2s
|
||||
@@ -2126,12 +2153,12 @@ void Thermostat::register_device_values() {
|
||||
register_device_value(DeviceValueTAG::TAG_NONE,
|
||||
&dampedoutdoortemp2_,
|
||||
DeviceValueType::SHORT,
|
||||
flash_string_vector{F("10")},
|
||||
FL_(div10),
|
||||
F("dampedtemp"),
|
||||
F("Damped outdoor temperature"),
|
||||
DeviceValueUOM::DEGREES);
|
||||
register_device_value(
|
||||
DeviceValueTAG::TAG_NONE, &floordrytemp_, DeviceValueType::UINT, {}, F("floordrytemp"), F("Floor drying temperature"), DeviceValueUOM::DEGREES);
|
||||
DeviceValueTAG::TAG_NONE, &floordrytemp_, DeviceValueType::UINT,nullptr, F("floordrytemp"), F("Floor drying temperature"), DeviceValueUOM::DEGREES);
|
||||
register_device_value(DeviceValueTAG::TAG_NONE,
|
||||
&ibaBuildingType_,
|
||||
DeviceValueType::ENUM,
|
||||
@@ -2160,7 +2187,7 @@ void Thermostat::register_device_values() {
|
||||
register_device_value(DeviceValueTAG::TAG_NONE,
|
||||
&dampedoutdoortemp_,
|
||||
DeviceValueType::SHORT,
|
||||
{},
|
||||
nullptr,
|
||||
F("dampedtemp"),
|
||||
F("Damped outdoor temperature"),
|
||||
DeviceValueUOM::DEGREES);
|
||||
@@ -2186,10 +2213,12 @@ void Thermostat::register_device_values() {
|
||||
F("Warm water circulation mode"),
|
||||
DeviceValueUOM::NONE);
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
// registers the values for a heating circuit
|
||||
void Thermostat::register_device_values_hc(std::shared_ptr<emsesp::Thermostat::HeatingCircuit> hc) {
|
||||
/*
|
||||
uint8_t model = hc->get_model();
|
||||
|
||||
// heating circuit
|
||||
@@ -2198,14 +2227,14 @@ void Thermostat::register_device_values_hc(std::shared_ptr<emsesp::Thermostat::H
|
||||
// different logic on how temperature values are stored, depending on model
|
||||
flash_string_vector setpoint_temp_divider, curr_temp_divider;
|
||||
if (model == EMS_DEVICE_FLAG_EASY) {
|
||||
setpoint_temp_divider = flash_string_vector{F("100")};
|
||||
curr_temp_divider = flash_string_vector{F("100")};
|
||||
setpoint_temp_divider = FL_(div100);
|
||||
curr_temp_divider = FL_(div100);
|
||||
} else if (model == EMS_DEVICE_FLAG_JUNKERS) {
|
||||
setpoint_temp_divider = flash_string_vector{F("10")};
|
||||
curr_temp_divider = flash_string_vector{F("10")};
|
||||
setpoint_temp_divider = FL_(div10);
|
||||
curr_temp_divider = FL_(div10);
|
||||
} else {
|
||||
setpoint_temp_divider = flash_string_vector{F("2")};
|
||||
curr_temp_divider = flash_string_vector{F("10")};
|
||||
setpoint_temp_divider = FL_(div2);
|
||||
curr_temp_divider = FL_(div10);
|
||||
}
|
||||
register_device_value(
|
||||
tag, &hc->setpoint_roomTemp, DeviceValueType::SHORT, setpoint_temp_divider, F("seltemp"), F("Setpoint room temperature"), DeviceValueUOM::DEGREES);
|
||||
@@ -2226,7 +2255,7 @@ void Thermostat::register_device_values_hc(std::shared_ptr<emsesp::Thermostat::H
|
||||
F("HA current room temperature"),
|
||||
DeviceValueUOM::DEGREES);
|
||||
} else if (option == Mqtt::HA_Climate_Format::ZERO) {
|
||||
register_device_value(tag, &zero_value_, DeviceValueType::UINT, {}, F("hatemp"), nullptr, DeviceValueUOM::DEGREES);
|
||||
register_device_value(tag, &zero_value_, DeviceValueType::UINT,nullptr, F("hatemp"), nullptr, DeviceValueUOM::DEGREES);
|
||||
}
|
||||
|
||||
// if we're sending to HA the only valid mode types are heat, auto and off
|
||||
@@ -2250,14 +2279,14 @@ void Thermostat::register_device_values_hc(std::shared_ptr<emsesp::Thermostat::H
|
||||
register_device_value(tag, &hc->manualtemp, DeviceValueType::UINT, {F("2")}, F("manualtemp"), F("Manual temperature"), DeviceValueUOM::DEGREES);
|
||||
register_device_value(tag, &hc->daytemp, DeviceValueType::UINT, {F("2")}, F("comforttemp"), F("Comfort temperature"), DeviceValueUOM::DEGREES);
|
||||
|
||||
register_device_value(tag, &hc->summertemp, DeviceValueType::UINT, {}, F("summertemp"), F("Summer temperature"), DeviceValueUOM::DEGREES);
|
||||
register_device_value(tag, &hc->designtemp, DeviceValueType::UINT, {}, F("designtemp"), F("Design temperature"), DeviceValueUOM::DEGREES);
|
||||
register_device_value(tag, &hc->offsettemp, DeviceValueType::INT, {}, F("offsettemp"), F("Offset temperature"), DeviceValueUOM::DEGREES);
|
||||
register_device_value(tag, &hc->minflowtemp, DeviceValueType::UINT, {}, F("minflowtemp"), F("Min flow temperature"), DeviceValueUOM::DEGREES);
|
||||
register_device_value(tag, &hc->maxflowtemp, DeviceValueType::UINT, {}, F("maxflowtemp"), F("Max flow temperature"), DeviceValueUOM::DEGREES);
|
||||
register_device_value(tag, &hc->roominfluence, DeviceValueType::UINT, {}, F("roominfluence"), F("Room influence"), DeviceValueUOM::NONE);
|
||||
register_device_value(tag, &hc->nofrosttemp, DeviceValueType::INT, {}, F("nofrosttemp"), F("Nofrost temperature"), DeviceValueUOM::DEGREES);
|
||||
register_device_value(tag, &hc->targetflowtemp, DeviceValueType::UINT, {}, F("targetflowtemp"), F("Target flow temperature"), DeviceValueUOM::DEGREES);
|
||||
register_device_value(tag, &hc->summertemp, DeviceValueType::UINT,nullptr, F("summertemp"), F("Summer temperature"), DeviceValueUOM::DEGREES);
|
||||
register_device_value(tag, &hc->designtemp, DeviceValueType::UINT,nullptr, F("designtemp"), F("Design temperature"), DeviceValueUOM::DEGREES);
|
||||
register_device_value(tag, &hc->offsettemp, DeviceValueType::INT,nullptr, F("offsettemp"), F("Offset temperature"), DeviceValueUOM::DEGREES);
|
||||
register_device_value(tag, &hc->minflowtemp, DeviceValueType::UINT,nullptr, F("minflowtemp"), F("Min flow temperature"), DeviceValueUOM::DEGREES);
|
||||
register_device_value(tag, &hc->maxflowtemp, DeviceValueType::UINT,nullptr, F("maxflowtemp"), F("Max flow temperature"), DeviceValueUOM::DEGREES);
|
||||
register_device_value(tag, &hc->roominfluence, DeviceValueType::UINT,nullptr, F("roominfluence"), F("Room influence"), DeviceValueUOM::NONE);
|
||||
register_device_value(tag, &hc->nofrosttemp, DeviceValueType::INT,nullptr, F("nofrosttemp"), F("Nofrost temperature"), DeviceValueUOM::DEGREES);
|
||||
register_device_value(tag, &hc->targetflowtemp, DeviceValueType::UINT,nullptr, F("targetflowtemp"), F("Target flow temperature"), DeviceValueUOM::DEGREES);
|
||||
register_device_value(tag,
|
||||
&hc->heatingtype,
|
||||
DeviceValueType::ENUM,
|
||||
@@ -2279,7 +2308,7 @@ void Thermostat::register_device_values_hc(std::shared_ptr<emsesp::Thermostat::H
|
||||
F("controlmode"),
|
||||
F("Control mode"),
|
||||
DeviceValueUOM::NONE);
|
||||
register_device_value(tag, &hc->program, DeviceValueType::UINT, {}, F("program"), F("Program"), DeviceValueUOM::NONE);
|
||||
register_device_value(tag, &hc->program, DeviceValueType::UINT,nullptr, F("program"), F("Program"), DeviceValueUOM::NONE);
|
||||
}
|
||||
|
||||
if (model == EMS_DEVICE_FLAG_RC20) {
|
||||
@@ -2290,9 +2319,9 @@ void Thermostat::register_device_values_hc(std::shared_ptr<emsesp::Thermostat::H
|
||||
if (model == EMS_DEVICE_FLAG_RC20_2) {
|
||||
register_device_value(tag, &hc->mode, DeviceValueType::ENUM, flash_string_vector{F("off"), F("manual"), F("auto")}, F("mode"), F("Mode"), DeviceValueUOM::NONE);
|
||||
register_device_value(tag, &hc->modetype, DeviceValueType::ENUM, flash_string_vector{F("day")}, F("modetype"), F("Mode type"), DeviceValueUOM::NONE);
|
||||
register_device_value(tag, &hc->daytemp, DeviceValueType::UINT, flash_string_vector{F("2")}, F("daytemp"), F("Day temperature"), DeviceValueUOM::DEGREES);
|
||||
register_device_value(tag, &hc->nighttemp, DeviceValueType::UINT, flash_string_vector{F("2")}, F("nighttemp"), F("Night temperature"), DeviceValueUOM::DEGREES);
|
||||
register_device_value(tag, &hc->program, DeviceValueType::UINT, {}, F("program"), F("Program"), DeviceValueUOM::NONE);
|
||||
register_device_value(tag, &hc->daytemp, DeviceValueType::UINT, FL_(div2), F("daytemp"), F("Day temperature"), DeviceValueUOM::DEGREES);
|
||||
register_device_value(tag, &hc->nighttemp, DeviceValueType::UINT, FL_(div2), F("nighttemp"), F("Night temperature"), DeviceValueUOM::DEGREES);
|
||||
register_device_value(tag, &hc->program, DeviceValueType::UINT,nullptr, F("program"), F("Program"), DeviceValueUOM::NONE);
|
||||
}
|
||||
|
||||
if (model == EMS_DEVICE_FLAG_RC35 || model == EMS_DEVICE_FLAG_RC30_1) {
|
||||
@@ -2300,18 +2329,18 @@ void Thermostat::register_device_values_hc(std::shared_ptr<emsesp::Thermostat::H
|
||||
register_device_value(tag, &hc->modetype, DeviceValueType::ENUM, {F("night"), F("day")}, F("modetype"), F("Mode type"), DeviceValueUOM::NONE);
|
||||
register_device_value(tag, &hc->daytemp, DeviceValueType::UINT, {F("2")}, F("daytemp"), F("Day temperature"), DeviceValueUOM::DEGREES);
|
||||
register_device_value(tag, &hc->nighttemp, DeviceValueType::UINT, {F("2")}, F("nighttemp"), F("Night temperature"), DeviceValueUOM::DEGREES);
|
||||
register_device_value(tag, &hc->designtemp, DeviceValueType::UINT, {}, F("designtemp"), F("Design temperature"), DeviceValueUOM::DEGREES);
|
||||
register_device_value(tag, &hc->designtemp, DeviceValueType::UINT,nullptr, F("designtemp"), F("Design temperature"), DeviceValueUOM::DEGREES);
|
||||
register_device_value(tag, &hc->offsettemp, DeviceValueType::INT, {F("2")}, F("offsettemp"), F("Offset temperature"), DeviceValueUOM::DEGREES);
|
||||
register_device_value(tag, &hc->holidaytemp, DeviceValueType::UINT, {F("2")}, F("holidaytemp"), F("Holiday temperature"), DeviceValueUOM::DEGREES);
|
||||
register_device_value(tag, &hc->targetflowtemp, DeviceValueType::UINT, {}, F("targetflowtemp"), F("Target flow temperature"), DeviceValueUOM::DEGREES);
|
||||
register_device_value(tag, &hc->summertemp, DeviceValueType::UINT, {}, F("summertemp"), F("Summer temperature"), DeviceValueUOM::DEGREES);
|
||||
register_device_value(tag, &hc->summermode, DeviceValueType::BOOL, {}, F("summermode"), F("Summer mode"), DeviceValueUOM::NONE);
|
||||
register_device_value(tag, &hc->holidaymode, DeviceValueType::BOOL, {}, F("holidaymode"), F("Holiday mode"), DeviceValueUOM::NONE);
|
||||
register_device_value(tag, &hc->nofrosttemp, DeviceValueType::INT, {}, F("nofrosttemp"), F("Nofrost temperature"), DeviceValueUOM::DEGREES);
|
||||
register_device_value(tag, &hc->roominfluence, DeviceValueType::UINT, {}, F("roominfluence"), F("Room influence"), DeviceValueUOM::NONE);
|
||||
register_device_value(tag, &hc->minflowtemp, DeviceValueType::UINT, {}, F("minflowtemp"), F("Min flow temperature"), DeviceValueUOM::DEGREES);
|
||||
register_device_value(tag, &hc->maxflowtemp, DeviceValueType::UINT, {}, F("maxflowtemp"), F("Max flow temperature"), DeviceValueUOM::DEGREES);
|
||||
register_device_value(tag, &hc->flowtempoffset, DeviceValueType::UINT, {}, F("flowtempoffset"), F("Flow temperature offset"), DeviceValueUOM::DEGREES);
|
||||
register_device_value(tag, &hc->targetflowtemp, DeviceValueType::UINT,nullptr, F("targetflowtemp"), F("Target flow temperature"), DeviceValueUOM::DEGREES);
|
||||
register_device_value(tag, &hc->summertemp, DeviceValueType::UINT,nullptr, F("summertemp"), F("Summer temperature"), DeviceValueUOM::DEGREES);
|
||||
register_device_value(tag, &hc->summermode, DeviceValueType::BOOL,nullptr, F("summermode"), F("Summer mode"), DeviceValueUOM::NONE);
|
||||
register_device_value(tag, &hc->holidaymode, DeviceValueType::BOOL,nullptr, F("holidaymode"), F("Holiday mode"), DeviceValueUOM::NONE);
|
||||
register_device_value(tag, &hc->nofrosttemp, DeviceValueType::INT,nullptr, F("nofrosttemp"), F("Nofrost temperature"), DeviceValueUOM::DEGREES);
|
||||
register_device_value(tag, &hc->roominfluence, DeviceValueType::UINT,nullptr, F("roominfluence"), F("Room influence"), DeviceValueUOM::NONE);
|
||||
register_device_value(tag, &hc->minflowtemp, DeviceValueType::UINT,nullptr, F("minflowtemp"), F("Min flow temperature"), DeviceValueUOM::DEGREES);
|
||||
register_device_value(tag, &hc->maxflowtemp, DeviceValueType::UINT,nullptr, F("maxflowtemp"), F("Max flow temperature"), DeviceValueUOM::DEGREES);
|
||||
register_device_value(tag, &hc->flowtempoffset, DeviceValueType::UINT,nullptr, F("flowtempoffset"), F("Flow temperature offset"), DeviceValueUOM::DEGREES);
|
||||
register_device_value(tag,
|
||||
&hc->heatingtype,
|
||||
DeviceValueType::ENUM,
|
||||
@@ -2333,7 +2362,7 @@ void Thermostat::register_device_values_hc(std::shared_ptr<emsesp::Thermostat::H
|
||||
F("controlmode"),
|
||||
F("Control mode"),
|
||||
DeviceValueUOM::NONE);
|
||||
register_device_value(tag, &hc->program, DeviceValueType::UINT, {}, F("program"), F("Program"), DeviceValueUOM::NONE);
|
||||
register_device_value(tag, &hc->program, DeviceValueType::UINT,nullptr, F("program"), F("Program"), DeviceValueUOM::NONE);
|
||||
}
|
||||
|
||||
if (model == EMSdevice::EMS_DEVICE_FLAG_JUNKERS) {
|
||||
@@ -2346,11 +2375,12 @@ void Thermostat::register_device_values_hc(std::shared_ptr<emsesp::Thermostat::H
|
||||
F("modetype"),
|
||||
F("Mode type"),
|
||||
DeviceValueUOM::NONE);
|
||||
register_device_value(tag, &hc->daytemp, DeviceValueType::UINT, flash_string_vector{F("2")}, F("heattemp"), F("Heat temperature"), DeviceValueUOM::DEGREES);
|
||||
register_device_value(tag, &hc->nighttemp, DeviceValueType::UINT, flash_string_vector{F("2")}, F("ecotemp"), F("Eco temperature"), DeviceValueUOM::DEGREES);
|
||||
register_device_value(tag, &hc->daytemp, DeviceValueType::UINT, FL_(div2), F("heattemp"), F("Heat temperature"), DeviceValueUOM::DEGREES);
|
||||
register_device_value(tag, &hc->nighttemp, DeviceValueType::UINT, FL_(div2), F("ecotemp"), F("Eco temperature"), DeviceValueUOM::DEGREES);
|
||||
register_device_value(
|
||||
tag, &hc->nofrosttemp, DeviceValueType::INT, flash_string_vector{F("2")}, F("nofrosttemp"), F("Nofrost temperature"), DeviceValueUOM::DEGREES);
|
||||
tag, &hc->nofrosttemp, DeviceValueType::INT, FL_(div2), F("nofrosttemp"), F("Nofrost temperature"), DeviceValueUOM::DEGREES);
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
} // namespace emsesp
|
||||
|
||||
@@ -19,19 +19,7 @@
|
||||
#ifndef EMSESP_THERMOSTAT_H
|
||||
#define EMSESP_THERMOSTAT_H
|
||||
|
||||
#include <Arduino.h>
|
||||
#include <ArduinoJson.h>
|
||||
|
||||
#include <uuid/log.h>
|
||||
|
||||
#include "emsdevice.h"
|
||||
#include "telegram.h"
|
||||
#include "emsesp.h"
|
||||
#include "helpers.h"
|
||||
#include "mqtt.h"
|
||||
|
||||
#include <vector>
|
||||
#include <time.h>
|
||||
|
||||
namespace emsesp {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user