mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2026-03-16 06:36:32 +03:00
Merge branch 'origin/dev'
This commit is contained in:
@@ -26,29 +26,36 @@ uuid::log::Logger AnalogSensor::logger_{F_(analogsensor), uuid::log::Facility::D
|
||||
void AnalogSensor::start() {
|
||||
reload(); // fetch the list of sensors from our customization service
|
||||
|
||||
if (analog_enabled_) {
|
||||
analogSetAttenuation(ADC_2_5db); // for all channels 1.5V
|
||||
if (!analog_enabled_) {
|
||||
return;
|
||||
}
|
||||
analogSetAttenuation(ADC_2_5db); // for all channels 1.5V
|
||||
|
||||
LOG_INFO(F("Starting Analog sensor service"));
|
||||
LOG_INFO("Starting Analog sensor service");
|
||||
|
||||
// Add API call for /info
|
||||
Command::add(
|
||||
EMSdevice::DeviceType::ANALOGSENSOR,
|
||||
F_(info),
|
||||
[&](const char * value, const int8_t id, JsonObject & output) { return command_info(value, id, output); },
|
||||
F_(info_cmd));
|
||||
FL_(info_cmd));
|
||||
Command::add(
|
||||
EMSdevice::DeviceType::ANALOGSENSOR,
|
||||
F_(values),
|
||||
[&](const char * value, const int8_t id, JsonObject & output) { return command_info(value, 0, output); },
|
||||
nullptr,
|
||||
CommandFlag::HIDDEN); // this command is hidden
|
||||
Command::add(
|
||||
EMSdevice::DeviceType::ANALOGSENSOR,
|
||||
F_(setvalue),
|
||||
[&](const char * value, const int8_t id) { return command_setvalue(value, id); },
|
||||
F("set io value"),
|
||||
FL_(setiovalue_cmd),
|
||||
CommandFlag::ADMIN_ONLY);
|
||||
Command::add(
|
||||
EMSdevice::DeviceType::ANALOGSENSOR,
|
||||
F_(commands),
|
||||
[&](const char * value, const int8_t id, JsonObject & output) { return command_commands(value, id, output); },
|
||||
F_(commands_cmd));
|
||||
FL_(commands_cmd));
|
||||
|
||||
Mqtt::subscribe(EMSdevice::DeviceType::ANALOGSENSOR, "analogsensor/#", nullptr); // use empty function callback
|
||||
}
|
||||
@@ -60,7 +67,14 @@ void AnalogSensor::reload() {
|
||||
#if defined(EMSESP_STANDALONE)
|
||||
analog_enabled_ = true; // for local offline testing
|
||||
#endif
|
||||
|
||||
for (auto sensor : sensors_) {
|
||||
remove_ha_topic(sensor.gpio());
|
||||
sensor.ha_registered = false;
|
||||
}
|
||||
if (!analog_enabled_) {
|
||||
sensors_.clear();
|
||||
return;
|
||||
}
|
||||
// load the list of analog sensors from the customization service
|
||||
// and store them locally and then activate them
|
||||
EMSESP::webCustomizationService.read([&](WebCustomization & settings) {
|
||||
@@ -107,6 +121,15 @@ void AnalogSensor::reload() {
|
||||
sensors_.back().set_value(0); // reset value only for new sensors
|
||||
}
|
||||
}
|
||||
if (sensor.type == AnalogType::COUNTER || sensor.type >= AnalogType::DIGITAL_OUT) {
|
||||
Command::add(
|
||||
EMSdevice::DeviceType::ANALOGSENSOR,
|
||||
sensor.name.c_str(),
|
||||
[&](const char * value, const int8_t id) { return command_setvalue(value, sensor.gpio); },
|
||||
sensor.type == AnalogType::COUNTER ? FL_(counter)
|
||||
: sensor.type == AnalogType::DIGITAL_OUT ? FL_(digital_out)
|
||||
: FL_(pwm));
|
||||
}
|
||||
}
|
||||
return true;
|
||||
});
|
||||
@@ -118,21 +141,27 @@ void AnalogSensor::reload() {
|
||||
for (auto & sensor : sensors_) {
|
||||
sensor.ha_registered = false; // force HA configs to be re-created
|
||||
if (sensor.type() == AnalogType::ADC) {
|
||||
LOG_DEBUG(F("Adding analog ADC sensor on GPIO%d"), sensor.gpio());
|
||||
LOG_DEBUG("Adding analog ADC sensor on GPIO %02d", sensor.gpio());
|
||||
// analogSetPinAttenuation does not work with analogReadMilliVolts
|
||||
sensor.analog_ = 0; // initialize
|
||||
sensor.last_reading_ = 0;
|
||||
} else if (sensor.type() == AnalogType::COUNTER) {
|
||||
LOG_DEBUG(F("Adding analog I/O Counter sensor on GPIO%d"), sensor.gpio());
|
||||
LOG_DEBUG("Adding analog I/O Counter sensor on GPIO %02d", sensor.gpio());
|
||||
pinMode(sensor.gpio(), INPUT_PULLUP);
|
||||
#if CONFIG_IDF_TARGET_ESP32
|
||||
if (sensor.gpio() == 25 || sensor.gpio() == 26) {
|
||||
dacWrite(sensor.gpio(), 255);
|
||||
}
|
||||
#elif CONFIG_IDF_TARGET_ESP32S2
|
||||
if (sensor.gpio() == 23 || sensor.gpio() == 24) {
|
||||
dacWrite(sensor.gpio(), 255);
|
||||
}
|
||||
#endif
|
||||
sensor.polltime_ = 0;
|
||||
sensor.poll_ = digitalRead(sensor.gpio());
|
||||
publish_sensor(sensor);
|
||||
} else if (sensor.type() == AnalogType::TIMER || sensor.type() == AnalogType::RATE) {
|
||||
LOG_DEBUG(F("Adding analog Timer/Rate sensor on GPIO%d"), sensor.gpio());
|
||||
LOG_DEBUG("Adding analog Timer/Rate sensor on GPIO %02d", sensor.gpio());
|
||||
pinMode(sensor.gpio(), INPUT_PULLUP);
|
||||
sensor.polltime_ = uuid::get_uptime();
|
||||
sensor.last_polltime_ = uuid::get_uptime();
|
||||
@@ -141,7 +170,7 @@ void AnalogSensor::reload() {
|
||||
sensor.set_value(0);
|
||||
publish_sensor(sensor);
|
||||
} else if (sensor.type() == AnalogType::DIGITAL_IN) {
|
||||
LOG_DEBUG(F("Adding analog Read sensor on GPIO%d"), sensor.gpio());
|
||||
LOG_DEBUG("Adding analog Read sensor on GPIO %02d", sensor.gpio());
|
||||
pinMode(sensor.gpio(), INPUT_PULLUP);
|
||||
sensor.set_value(digitalRead(sensor.gpio())); // initial value
|
||||
sensor.set_uom(0); // no uom, just for safe measures
|
||||
@@ -149,8 +178,9 @@ void AnalogSensor::reload() {
|
||||
sensor.poll_ = digitalRead(sensor.gpio());
|
||||
publish_sensor(sensor);
|
||||
} else if (sensor.type() == AnalogType::DIGITAL_OUT) {
|
||||
LOG_DEBUG(F("Adding analog Write sensor on GPIO%d"), sensor.gpio());
|
||||
LOG_DEBUG("Adding analog Write sensor on GPIO %02d", sensor.gpio());
|
||||
pinMode(sensor.gpio(), OUTPUT);
|
||||
#if CONFIG_IDF_TARGET_ESP32
|
||||
if (sensor.gpio() == 25 || sensor.gpio() == 26) {
|
||||
if (sensor.offset() > 255) {
|
||||
sensor.set_offset(255);
|
||||
@@ -159,14 +189,26 @@ void AnalogSensor::reload() {
|
||||
}
|
||||
dacWrite(sensor.gpio(), sensor.offset());
|
||||
sensor.set_value(sensor.offset());
|
||||
} else {
|
||||
} else
|
||||
#elif CONFIG_IDF_TARGET_ESP32S2
|
||||
if (sensor.gpio() == 23 || sensor.gpio() == 24) {
|
||||
if (sensor.offset() > 255) {
|
||||
sensor.set_offset(255);
|
||||
} else if (sensor.offset() < 0) {
|
||||
sensor.set_offset(0);
|
||||
}
|
||||
dacWrite(sensor.gpio(), sensor.offset());
|
||||
sensor.set_value(sensor.offset());
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
digitalWrite(sensor.gpio(), sensor.offset() > 0 ? 1 : 0);
|
||||
sensor.set_value(digitalRead(sensor.gpio()));
|
||||
}
|
||||
sensor.set_uom(0); // no uom, just for safe measures
|
||||
publish_sensor(sensor);
|
||||
} else if (sensor.type() >= AnalogType::PWM_0) {
|
||||
LOG_DEBUG(F("Adding PWM output sensor on GPIO%d"), sensor.gpio());
|
||||
LOG_DEBUG("Adding PWM output sensor on GPIO %02d", sensor.gpio());
|
||||
uint channel = sensor.type() - AnalogType::PWM_0;
|
||||
ledcSetup(channel, sensor.factor(), 13);
|
||||
ledcAttachPin(sensor.gpio(), channel);
|
||||
@@ -258,17 +300,20 @@ void AnalogSensor::loop() {
|
||||
}
|
||||
|
||||
// update analog information name and offset
|
||||
bool AnalogSensor::update(uint8_t gpio, const std::string & name, float offset, float factor, uint8_t uom, int8_t type) {
|
||||
bool AnalogSensor::update(uint8_t gpio, const std::string & name, double offset, double factor, uint8_t uom, int8_t type) {
|
||||
boolean found_sensor = false; // see if we can find the sensor in our customization list
|
||||
|
||||
EMSESP::webCustomizationService.update(
|
||||
[&](WebCustomization & settings) {
|
||||
for (auto & AnalogCustomization : settings.analogCustomizations) {
|
||||
if (AnalogCustomization.type == AnalogType::COUNTER || AnalogCustomization.type >= AnalogType::DIGITAL_OUT) {
|
||||
Command::erase_command(EMSdevice::DeviceType::ANALOGSENSOR, AnalogCustomization.name.c_str());
|
||||
}
|
||||
if (AnalogCustomization.gpio == gpio) {
|
||||
found_sensor = true; // found the record
|
||||
// see if it's marked for deletion
|
||||
if (type == AnalogType::MARK_DELETED) {
|
||||
LOG_DEBUG(F("Removing analog sensor GPIO %d"), gpio);
|
||||
LOG_DEBUG("Removing analog sensor GPIO %02d", gpio);
|
||||
settings.analogCustomizations.remove(AnalogCustomization);
|
||||
} else {
|
||||
// update existing record
|
||||
@@ -277,7 +322,7 @@ bool AnalogSensor::update(uint8_t gpio, const std::string & name, float offset,
|
||||
AnalogCustomization.factor = factor;
|
||||
AnalogCustomization.uom = uom;
|
||||
AnalogCustomization.type = type;
|
||||
LOG_DEBUG(F("Customizing existing analog GPIO %d"), gpio);
|
||||
LOG_DEBUG("Customizing existing analog GPIO %02d", gpio);
|
||||
}
|
||||
return StateUpdateResult::CHANGED; // persist the change
|
||||
}
|
||||
@@ -303,7 +348,7 @@ bool AnalogSensor::update(uint8_t gpio, const std::string & name, float offset,
|
||||
newSensor.uom = uom;
|
||||
newSensor.type = type;
|
||||
settings.analogCustomizations.push_back(newSensor);
|
||||
LOG_DEBUG(F("Adding new customization for analog sensor GPIO %d"), gpio);
|
||||
LOG_DEBUG("Adding new customization for analog sensor GPIO %02d", gpio);
|
||||
return StateUpdateResult::CHANGED; // persist the change
|
||||
},
|
||||
"local");
|
||||
@@ -329,12 +374,12 @@ void AnalogSensor::publish_sensor(const Sensor & sensor) const {
|
||||
if (Mqtt::publish_single()) {
|
||||
char topic[Mqtt::MQTT_TOPIC_MAX_SIZE];
|
||||
if (Mqtt::publish_single2cmd()) {
|
||||
snprintf(topic, sizeof(topic), "%s/%s", read_flash_string(F_(analogsensor)).c_str(), sensor.name().c_str());
|
||||
snprintf(topic, sizeof(topic), "%s/%s", F_(analogsensor), sensor.name().c_str());
|
||||
} else {
|
||||
snprintf(topic, sizeof(topic), "%s%s/%s", read_flash_string(F_(analogsensor)).c_str(), "_data", sensor.name().c_str());
|
||||
snprintf(topic, sizeof(topic), "%s%s/%s", F_(analogsensor), "_data", sensor.name().c_str());
|
||||
}
|
||||
char payload[10];
|
||||
Mqtt::publish(topic, Helpers::render_value(payload, sensor.value(), 2)); // always publish as floats
|
||||
Mqtt::publish(topic, Helpers::render_value(payload, sensor.value(), 2)); // always publish as doubles
|
||||
}
|
||||
}
|
||||
|
||||
@@ -344,10 +389,10 @@ void AnalogSensor::remove_ha_topic(const uint8_t gpio) const {
|
||||
return;
|
||||
}
|
||||
#ifdef EMSESP_DEBUG
|
||||
LOG_DEBUG(F("Removing HA config for analog sensor GPIO %d"), gpio);
|
||||
LOG_DEBUG("Removing HA config for analog sensor GPIO %02d", gpio);
|
||||
#endif
|
||||
char topic[Mqtt::MQTT_TOPIC_MAX_SIZE];
|
||||
snprintf(topic, sizeof(topic), "sensor/%s/analogsensor_%d/config", Mqtt::base().c_str(), gpio);
|
||||
snprintf(topic, sizeof(topic), "sensor/%s/analogsensor_%02d/config", Mqtt::basename().c_str(), gpio);
|
||||
Mqtt::publish_ha(topic);
|
||||
}
|
||||
|
||||
@@ -369,8 +414,7 @@ void AnalogSensor::publish_values(const bool force) {
|
||||
|
||||
for (auto & sensor : sensors_) {
|
||||
if (sensor.type() != AnalogType::NOTUSED) {
|
||||
if (Mqtt::is_nested() || Mqtt::ha_enabled()) {
|
||||
// nested
|
||||
if (Mqtt::is_nested()) {
|
||||
char s[10];
|
||||
JsonObject dataSensor = doc.createNestedObject(Helpers::smallitoa(s, sensor.gpio()));
|
||||
dataSensor["name"] = sensor.name();
|
||||
@@ -382,66 +426,75 @@ void AnalogSensor::publish_values(const bool force) {
|
||||
case AnalogType::PWM_0:
|
||||
case AnalogType::PWM_1:
|
||||
case AnalogType::PWM_2:
|
||||
dataSensor["value"] = sensor.value(); // float
|
||||
dataSensor["value"] = serialized(Helpers::render_value(s, sensor.value(), 2)); // double
|
||||
break;
|
||||
default:
|
||||
dataSensor["value"] = (uint8_t)sensor.value(); // convert to char for 1 or 0
|
||||
break;
|
||||
}
|
||||
|
||||
// create HA config
|
||||
if (Mqtt::ha_enabled() && (!sensor.ha_registered || force)) {
|
||||
LOG_DEBUG(F("Recreating HA config for analog sensor GPIO %d"), sensor.gpio());
|
||||
|
||||
StaticJsonDocument<EMSESP_JSON_SIZE_MEDIUM> config;
|
||||
|
||||
char stat_t[50];
|
||||
snprintf(stat_t, sizeof(stat_t), "%s/analogsensor_data", Mqtt::base().c_str());
|
||||
config["stat_t"] = stat_t;
|
||||
|
||||
char str[50];
|
||||
snprintf(str, sizeof(str), "{{value_json['%d'].value}}", sensor.gpio());
|
||||
config["val_tpl"] = str;
|
||||
|
||||
snprintf(str, sizeof(str), "analog_sensor_%s", sensor.name().c_str());
|
||||
config["object_id"] = str;
|
||||
|
||||
snprintf(str, sizeof(str), "%s", sensor.name().c_str());
|
||||
config["name"] = str;
|
||||
|
||||
snprintf(str, sizeof(str), "analogsensor_%d", sensor.gpio());
|
||||
config["uniq_id"] = str;
|
||||
|
||||
if (sensor.uom() != DeviceValueUOM::NONE) {
|
||||
config["unit_of_meas"] = EMSdevice::uom_to_string(sensor.uom());
|
||||
}
|
||||
|
||||
JsonObject dev = config.createNestedObject("dev");
|
||||
JsonArray ids = dev.createNestedArray("ids");
|
||||
ids.add("ems-esp");
|
||||
|
||||
char topic[Mqtt::MQTT_TOPIC_MAX_SIZE];
|
||||
snprintf(topic, sizeof(topic), "sensor/%s/analogsensor_%d/config", Mqtt::base().c_str(), sensor.gpio());
|
||||
|
||||
Mqtt::publish_ha(topic, config.as<JsonObject>());
|
||||
|
||||
sensor.ha_registered = true;
|
||||
}
|
||||
|
||||
|
||||
} else {
|
||||
// not nested
|
||||
doc[sensor.name()] = sensor.value();
|
||||
}
|
||||
|
||||
// create HA config
|
||||
if (Mqtt::ha_enabled() && (!sensor.ha_registered || force)) {
|
||||
LOG_DEBUG("Recreating HA config for analog sensor GPIO %02d", sensor.gpio());
|
||||
|
||||
StaticJsonDocument<EMSESP_JSON_SIZE_MEDIUM> config;
|
||||
|
||||
char stat_t[50];
|
||||
snprintf(stat_t, sizeof(stat_t), "%s/analogsensor_data", Mqtt::base().c_str()); // use base path
|
||||
config["stat_t"] = stat_t;
|
||||
|
||||
char str[50];
|
||||
if (Mqtt::is_nested()) {
|
||||
snprintf(str, sizeof(str), "{{value_json['%02d'].value}}", sensor.gpio());
|
||||
} else {
|
||||
snprintf(str, sizeof(str), "{{value_json['%s']}", sensor.name().c_str());
|
||||
}
|
||||
config["val_tpl"] = str;
|
||||
|
||||
char uniq_s[70];
|
||||
if (Mqtt::entity_format() == 2) {
|
||||
snprintf(uniq_s, sizeof(uniq_s), "%s_analogsensor_%02d", Mqtt::basename().c_str(), sensor.gpio());
|
||||
} else {
|
||||
snprintf(uniq_s, sizeof(uniq_s), "analogsensor_%02d", sensor.gpio());
|
||||
}
|
||||
|
||||
config["object_id"] = uniq_s;
|
||||
config["uniq_id"] = uniq_s; // same as object_id
|
||||
|
||||
snprintf(str, sizeof(str), "%s", sensor.name().c_str());
|
||||
config["name"] = str;
|
||||
|
||||
if (sensor.uom() != DeviceValueUOM::NONE) {
|
||||
config["unit_of_meas"] = EMSdevice::uom_to_string(sensor.uom());
|
||||
}
|
||||
|
||||
JsonObject dev = config.createNestedObject("dev");
|
||||
JsonArray ids = dev.createNestedArray("ids");
|
||||
ids.add("ems-esp");
|
||||
|
||||
char topic[Mqtt::MQTT_TOPIC_MAX_SIZE];
|
||||
snprintf(topic, sizeof(topic), "sensor/%s/analogsensor_%02d/config", Mqtt::basename().c_str(), sensor.gpio());
|
||||
|
||||
Mqtt::publish_ha(topic, config.as<JsonObject>());
|
||||
|
||||
sensor.ha_registered = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Mqtt::publish(F("analogsensor_data"), doc.as<JsonObject>());
|
||||
Mqtt::publish("analogsensor_data", doc.as<JsonObject>());
|
||||
}
|
||||
|
||||
// called from emsesp.cpp, similar to the emsdevice->get_value_info
|
||||
// searches by name
|
||||
bool AnalogSensor::get_value_info(JsonObject & output, const char * cmd, const int8_t id) const {
|
||||
if (sensors_.empty()) {
|
||||
return false;
|
||||
}
|
||||
// make a copy of the string command for parsing
|
||||
char command_s[30];
|
||||
strlcpy(command_s, cmd, sizeof(command_s));
|
||||
@@ -455,15 +508,27 @@ bool AnalogSensor::get_value_info(JsonObject & output, const char * cmd, const i
|
||||
}
|
||||
|
||||
for (const auto & sensor : sensors_) {
|
||||
if (strcmp(command_s, sensor.name().c_str()) == 0) {
|
||||
output["gpio"] = sensor.gpio();
|
||||
output["name"] = sensor.name();
|
||||
output["type"] = F_(number);
|
||||
output["analog"] = FL_(enum_sensortype)[sensor.type()];
|
||||
output["uom"] = EMSdevice::uom_to_string(sensor.uom());
|
||||
output["offset"] = sensor.offset();
|
||||
output["factor"] = sensor.factor();
|
||||
output["value"] = sensor.value();
|
||||
if (strcmp(command_s, sensor.name().c_str()) == 0 || Helpers::atoint(command_s) == sensor.gpio()) {
|
||||
output["gpio"] = sensor.gpio();
|
||||
output["name"] = sensor.name();
|
||||
output["type"] = F_(number);
|
||||
output["analog"] = FL_(list_sensortype)[sensor.type()];
|
||||
output["uom"] = EMSdevice::uom_to_string(sensor.uom());
|
||||
output["offset"] = sensor.offset();
|
||||
output["factor"] = sensor.factor();
|
||||
output["value"] = sensor.value();
|
||||
output["writeable"] = sensor.type() == AnalogType::COUNTER || sensor.type() >= AnalogType::DIGITAL_OUT;
|
||||
// min/max for writeable analogs
|
||||
if (sensor.type() == AnalogType::COUNTER) {
|
||||
output["min"] = 0;
|
||||
output["max"] = 4000000;
|
||||
} else if (sensor.type() == AnalogType::DIGITAL_OUT) {
|
||||
output["min"] = 0;
|
||||
output["max"] = sensor.gpio() == 25 || sensor.gpio() == 26 ? 255 : 1;
|
||||
} else if (sensor.type() >= AnalogType::PWM_0) {
|
||||
output["min"] = 0;
|
||||
output["max"] = 100;
|
||||
}
|
||||
// if we're filtering on an attribute, go find it
|
||||
if (attribute_s) {
|
||||
if (output.containsKey(attribute_s)) {
|
||||
@@ -493,11 +558,11 @@ bool AnalogSensor::command_info(const char * value, const int8_t id, JsonObject
|
||||
}
|
||||
|
||||
for (const auto & sensor : sensors_) {
|
||||
if (id == -1) { // show number and id
|
||||
if (id == -1) { // show number and id for info command
|
||||
JsonObject dataSensor = output.createNestedObject(sensor.name());
|
||||
dataSensor["gpio"] = sensor.gpio();
|
||||
dataSensor["type"] = F_(number);
|
||||
dataSensor["analog"] = FL_(enum_sensortype)[sensor.type()];
|
||||
dataSensor["analog"] = FL_(list_sensortype)[sensor.type()];
|
||||
if (sensor.type() == AnalogType::ADC) {
|
||||
dataSensor["uom"] = EMSdevice::uom_to_string(sensor.uom());
|
||||
dataSensor["offset"] = sensor.offset();
|
||||
@@ -513,8 +578,12 @@ bool AnalogSensor::command_info(const char * value, const int8_t id, JsonObject
|
||||
dataSensor["frequency"] = sensor.factor();
|
||||
}
|
||||
dataSensor["value"] = sensor.value();
|
||||
} else {
|
||||
} else if (id == 0) { // output values command
|
||||
output[sensor.name()] = sensor.value();
|
||||
} else { // if someone wants gpio numbers
|
||||
char gpio_str[9];
|
||||
snprintf(gpio_str, sizeof(gpio_str), "gpio_%02d", sensor.gpio());
|
||||
output[gpio_str] = sensor.value();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -522,7 +591,7 @@ bool AnalogSensor::command_info(const char * value, const int8_t id, JsonObject
|
||||
}
|
||||
|
||||
// this creates the sensor, initializing everything
|
||||
AnalogSensor::Sensor::Sensor(const uint8_t gpio, const std::string & name, const float offset, const float factor, const uint8_t uom, const int8_t type)
|
||||
AnalogSensor::Sensor::Sensor(const uint8_t gpio, const std::string & name, const double offset, const double factor, const uint8_t uom, const int8_t type)
|
||||
: gpio_(gpio)
|
||||
, name_(name)
|
||||
, offset_(offset)
|
||||
@@ -536,17 +605,21 @@ AnalogSensor::Sensor::Sensor(const uint8_t gpio, const std::string & name, const
|
||||
std::string AnalogSensor::Sensor::name() const {
|
||||
if (name_.empty()) {
|
||||
char name[50];
|
||||
snprintf(name, sizeof(name), "Analog Sensor GPIO%d", gpio_);
|
||||
snprintf(name, sizeof(name), "Analog Sensor GPIO %02d", gpio_);
|
||||
return name;
|
||||
}
|
||||
return name_;
|
||||
}
|
||||
|
||||
// set the counter value, id is gpio-no
|
||||
// set the dig_out/counter/DAC/PWM value, id is gpio-no
|
||||
bool AnalogSensor::command_setvalue(const char * value, const int8_t gpio) {
|
||||
float val;
|
||||
if (!Helpers::value2float(value, val)) {
|
||||
return false;
|
||||
bool b;
|
||||
if (!Helpers::value2bool(value, b)) {
|
||||
return false;
|
||||
}
|
||||
val = b ? 1 : 0;
|
||||
}
|
||||
for (auto & sensor : sensors_) {
|
||||
if (sensor.gpio() == gpio) {
|
||||
@@ -565,14 +638,26 @@ bool AnalogSensor::command_setvalue(const char * value, const int8_t gpio) {
|
||||
return true;
|
||||
} else if (sensor.type() == AnalogType::DIGITAL_OUT) {
|
||||
uint8_t v = val;
|
||||
if (sensor.gpio() == 25 || sensor.gpio() == 26) {
|
||||
#if CONFIG_IDF_TARGET_ESP32
|
||||
if ((sensor.gpio() == 25 || sensor.gpio() == 26) && v <= 255) {
|
||||
sensor.set_offset(v);
|
||||
sensor.set_value(v);
|
||||
pinMode(sensor.gpio(), OUTPUT);
|
||||
dacWrite(sensor.gpio(), sensor.offset());
|
||||
publish_sensor(sensor);
|
||||
return true;
|
||||
} else if (v == 0 || v == 1) {
|
||||
} else
|
||||
#elif CONFIG_IDF_TARGET_ESP32S2
|
||||
if ((sensor.gpio() == 23 || sensor.gpio() == 24) && v <= 255) {
|
||||
sensor.set_offset(v);
|
||||
sensor.set_value(v);
|
||||
pinMode(sensor.gpio(), OUTPUT);
|
||||
dacWrite(sensor.gpio(), sensor.offset());
|
||||
publish_sensor(sensor);
|
||||
return true;
|
||||
} else
|
||||
#endif
|
||||
if (v == 0 || v == 1) {
|
||||
sensor.set_offset(v);
|
||||
sensor.set_value(v);
|
||||
pinMode(sensor.gpio(), OUTPUT);
|
||||
|
||||
@@ -25,7 +25,6 @@
|
||||
|
||||
#ifndef EMSESP_STANDALONE
|
||||
#include "driver/adc.h"
|
||||
#include <esp_bt.h>
|
||||
#endif
|
||||
|
||||
#include <uuid/log.h>
|
||||
@@ -36,39 +35,40 @@ class AnalogSensor {
|
||||
public:
|
||||
class Sensor {
|
||||
public:
|
||||
Sensor(const uint8_t gpio, const std::string & name, const float offset, const float factor, const uint8_t uom, const int8_t type);
|
||||
Sensor(const uint8_t gpio, const std::string & name, const double offset, const double factor, const uint8_t uom, const int8_t type);
|
||||
~Sensor() = default;
|
||||
|
||||
void set_offset(const float offset) {
|
||||
void set_offset(const double offset) {
|
||||
offset_ = offset;
|
||||
}
|
||||
|
||||
std::string name() const;
|
||||
void set_name(const std::string & name) {
|
||||
name_ = name;
|
||||
|
||||
void set_name(const std::string & name) {
|
||||
name_ = name;
|
||||
}
|
||||
|
||||
uint8_t gpio() const {
|
||||
return gpio_;
|
||||
}
|
||||
|
||||
float value() const {
|
||||
double value() const {
|
||||
return value_;
|
||||
}
|
||||
|
||||
void set_value(float value) {
|
||||
void set_value(const double value) {
|
||||
value_ = value;
|
||||
}
|
||||
|
||||
float factor() const {
|
||||
double factor() const {
|
||||
return factor_;
|
||||
}
|
||||
|
||||
void set_factor(float factor) {
|
||||
void set_factor(const double factor) {
|
||||
factor_ = factor;
|
||||
}
|
||||
|
||||
float offset() const {
|
||||
double offset() const {
|
||||
return offset_;
|
||||
}
|
||||
|
||||
@@ -84,7 +84,7 @@ class AnalogSensor {
|
||||
return type_;
|
||||
}
|
||||
|
||||
void set_type(int8_t type) {
|
||||
void set_type(const int8_t type) {
|
||||
type_ = type;
|
||||
}
|
||||
|
||||
@@ -101,10 +101,10 @@ class AnalogSensor {
|
||||
private:
|
||||
uint8_t gpio_;
|
||||
std::string name_;
|
||||
float offset_;
|
||||
float factor_;
|
||||
double offset_;
|
||||
double factor_;
|
||||
uint8_t uom_;
|
||||
float value_; // float because of the factor is a float
|
||||
double value_; // double because of the factor is a double
|
||||
int8_t type_;
|
||||
};
|
||||
|
||||
@@ -157,7 +157,7 @@ class AnalogSensor {
|
||||
return sensors_.size();
|
||||
}
|
||||
|
||||
bool update(uint8_t gpio, const std::string & name, float offset, float factor, uint8_t uom, int8_t type);
|
||||
bool update(uint8_t gpio, const std::string & name, double offset, double factor, uint8_t uom, int8_t type);
|
||||
bool get_value_info(JsonObject & output, const char * cmd, const int8_t id) const;
|
||||
|
||||
#ifdef EMSESP_DEBUG
|
||||
|
||||
187
src/command.cpp
187
src/command.cpp
@@ -52,8 +52,10 @@ uint8_t Command::process(const char * path, const bool is_admin, const JsonObjec
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef EMSESP_DEBUG
|
||||
#if defined(EMSESP_USE_SERIAL)
|
||||
// Serial.println(p.path().c_str()); // dump paths, for debugging
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// re-calculate new path
|
||||
@@ -82,7 +84,7 @@ uint8_t Command::process(const char * path, const bool is_admin, const JsonObjec
|
||||
// validate the device, make sure it exists
|
||||
uint8_t device_type = EMSdevice::device_name_2_device_type(device_s);
|
||||
if (!device_has_commands(device_type)) {
|
||||
LOG_DEBUG(F("Command failed: unknown device '%s'"), device_s);
|
||||
LOG_DEBUG("Command failed: unknown device '%s'", device_s);
|
||||
return message(CommandRet::ERROR, "unknown device", output);
|
||||
}
|
||||
|
||||
@@ -114,13 +116,9 @@ uint8_t Command::process(const char * path, const bool is_admin, const JsonObjec
|
||||
command_p = parse_command_string(command_p, id_n);
|
||||
if (command_p == nullptr) {
|
||||
// handle dead endpoints like api/system or api/boiler
|
||||
// default to 'info' for SYSTEM, DALLASENSOR and ANALOGSENSOR, the other devices to 'values' for shortname version
|
||||
// default to 'info' for SYSTEM, the other devices to 'values' for shortname version
|
||||
if (num_paths < (id_n > 0 ? 4 : 3)) {
|
||||
if (device_type < EMSdevice::DeviceType::BOILER) {
|
||||
command_p = "info";
|
||||
} else {
|
||||
command_p = "values";
|
||||
}
|
||||
command_p = device_type == EMSdevice::DeviceType::SYSTEM ? F_(info) : F_(values);
|
||||
} else {
|
||||
return message(CommandRet::NOT_FOUND, "missing or bad command", output);
|
||||
}
|
||||
@@ -133,9 +131,15 @@ uint8_t Command::process(const char * path, const bool is_admin, const JsonObjec
|
||||
id_n = input["hc"];
|
||||
} else if (input.containsKey("wwc")) {
|
||||
id_n = input["wwc"];
|
||||
id_n += 8; // wwc1 has id 9
|
||||
id_n += DeviceValueTAG::TAG_WWC1 - DeviceValueTAG::TAG_HC1; // wwc1 has id 9
|
||||
} else if (input.containsKey("id")) {
|
||||
id_n = input["id"];
|
||||
} else if (input.containsKey("ahs")) {
|
||||
id_n = input["ahs"];
|
||||
id_n += DeviceValueTAG::TAG_AHS1 - DeviceValueTAG::TAG_HC1; // ahs1 has id 19
|
||||
} else if (input.containsKey("hs")) {
|
||||
id_n = input["hs"];
|
||||
id_n += DeviceValueTAG::TAG_HS1 - DeviceValueTAG::TAG_HC1; // hs1 has id 20
|
||||
}
|
||||
}
|
||||
|
||||
@@ -170,15 +174,17 @@ uint8_t Command::process(const char * path, const bool is_admin, const JsonObjec
|
||||
std::string Command::return_code_string(const uint8_t return_code) {
|
||||
switch (return_code) {
|
||||
case CommandRet::ERROR:
|
||||
return read_flash_string(F("Error"));
|
||||
return "Error";
|
||||
case CommandRet::OK:
|
||||
return read_flash_string(F("OK"));
|
||||
return "OK";
|
||||
case CommandRet::NOT_FOUND:
|
||||
return read_flash_string(F("Not Found"));
|
||||
return "Not Found";
|
||||
case CommandRet::NOT_ALLOWED:
|
||||
return read_flash_string(F("Not Authorized"));
|
||||
return "Not Authorized";
|
||||
case CommandRet::FAIL:
|
||||
return read_flash_string(F("Failed"));
|
||||
return "Failed";
|
||||
case CommandRet::INVALID:
|
||||
return "Invalid";
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -193,27 +199,43 @@ const char * Command::parse_command_string(const char * command, int8_t & id) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// convert cmd to lowercase and compare
|
||||
char * lowerCmd = strdup(command);
|
||||
for (char * p = lowerCmd; *p; p++) {
|
||||
*p = tolower(*p);
|
||||
}
|
||||
|
||||
// check prefix and valid number range, also check 'id'
|
||||
if (!strncmp(command, "hc", 2) && command[2] >= '1' && command[2] <= '8') {
|
||||
if (!strncmp(lowerCmd, "hc", 2) && command[2] >= '1' && command[2] <= '8') {
|
||||
id = command[2] - '0';
|
||||
command += 3;
|
||||
} else if (!strncmp(command, "wwc", 3) && command[3] == '1' && command[4] == '0') {
|
||||
id = 19;
|
||||
} else if (!strncmp(lowerCmd, "wwc", 3) && command[3] == '1' && command[4] == '0') {
|
||||
id = DeviceValueTAG::TAG_WWC10 - DeviceValueTAG::TAG_HC1 + 1; //18;
|
||||
command += 5;
|
||||
} else if (!strncmp(command, "wwc", 3) && command[3] >= '1' && command[3] <= '9') {
|
||||
id = command[3] - '0' + 8;
|
||||
} else if (!strncmp(lowerCmd, "wwc", 3) && command[3] >= '1' && command[3] <= '9') {
|
||||
id = command[3] - '1' + DeviceValueTAG::TAG_WWC1 - DeviceValueTAG::TAG_HC1 + 1; //9;
|
||||
command += 4;
|
||||
} else if (!strncmp(command, "id", 2) && command[2] == '1' && command[3] >= '0' && command[3] <= '9') {
|
||||
} else if (!strncmp(lowerCmd, "id", 2) && command[2] == '1' && command[3] >= '0' && command[3] <= '9') {
|
||||
id = command[3] - '0' + 10;
|
||||
command += 4;
|
||||
} else if (!strncmp(command, "id", 2) && command[2] >= '1' && command[2] <= '9') {
|
||||
} else if (!strncmp(lowerCmd, "id", 2) && command[2] >= '1' && command[2] <= '9') {
|
||||
id = command[2] - '0';
|
||||
command += 3;
|
||||
} else if (!strncmp(lowerCmd, "ahs", 3) && command[3] >= '1' && command[3] <= '1') { // only ahs1 for now
|
||||
id = command[3] - '1' + DeviceValueTAG::TAG_AHS1 - DeviceValueTAG::TAG_HC1 + 1; // 19;
|
||||
command += 4;
|
||||
} else if (!strncmp(lowerCmd, "hs", 2) && command[2] == '1' && command[3] >= '0' && command[3] <= '6') {
|
||||
id = command[3] - '0' + DeviceValueTAG::TAG_HS10 - DeviceValueTAG::TAG_HC1 + 1; //29;
|
||||
command += 4;
|
||||
} else if (!strncmp(lowerCmd, "hs", 2) && command[2] >= '1' && command[2] <= '9') {
|
||||
id = command[2] - '1' + DeviceValueTAG::TAG_HS1 - DeviceValueTAG::TAG_HC1 + 1; //20;
|
||||
command += 3;
|
||||
}
|
||||
// remove separator
|
||||
if (command[0] == '/' || command[0] == '.' || command[0] == '_') {
|
||||
command++;
|
||||
}
|
||||
free(lowerCmd);
|
||||
// return null for empty command
|
||||
if (command[0] == '\0') {
|
||||
return nullptr;
|
||||
@@ -236,19 +258,23 @@ uint8_t Command::call(const uint8_t device_type, const char * cmd, const char *
|
||||
// id may be used to represent a heating circuit for example
|
||||
// returns 0 if the command errored, 1 (TRUE) if ok, 2 if not found, 3 if error or 4 if not allowed
|
||||
uint8_t Command::call(const uint8_t device_type, const char * cmd, const char * value, const bool is_admin, const int8_t id, JsonObject & output) {
|
||||
if (cmd == nullptr) {
|
||||
return CommandRet::NOT_FOUND;
|
||||
}
|
||||
uint8_t return_code = CommandRet::OK;
|
||||
|
||||
std::string dname = EMSdevice::device_type_2_device_name(device_type);
|
||||
auto dname = EMSdevice::device_type_2_device_name(device_type);
|
||||
uint8_t device_id = EMSESP::device_id_from_cmd(device_type, cmd, id);
|
||||
|
||||
// see if there is a command registered
|
||||
auto cf = find_command(device_type, cmd);
|
||||
auto cf = find_command(device_type, device_id, cmd);
|
||||
|
||||
// check if its a call to and end-point to a device
|
||||
// except for system commands as this is a special device without any queryable entities (device values)
|
||||
if ((device_type > EMSdevice::DeviceType::SYSTEM) && (!value || !strlen(value))) {
|
||||
if (!cf || !cf->cmdfunction_json_) {
|
||||
#if defined(EMSESP_DEBUG)
|
||||
LOG_DEBUG(F("[DEBUG] Calling %s command '%s' to retrieve attributes"), dname.c_str(), cmd);
|
||||
LOG_DEBUG("[DEBUG] Calling %s command '%s' to retrieve attributes", dname, cmd);
|
||||
#endif
|
||||
return EMSESP::get_device_value_info(output, cmd, id, device_type) ? CommandRet::OK : CommandRet::ERROR; // entity = cmd
|
||||
}
|
||||
@@ -262,17 +288,23 @@ uint8_t Command::call(const uint8_t device_type, const char * cmd, const char *
|
||||
return CommandRet::NOT_ALLOWED; // command not allowed
|
||||
}
|
||||
|
||||
if ((value == nullptr) || (strlen(value) == 0)) {
|
||||
if (EMSESP::system_.readonly_mode()) {
|
||||
LOG_INFO(F("[readonly] Calling command '%s/%s' (%s)"), dname.c_str(), cmd, read_flash_string(cf->description_).c_str());
|
||||
} else {
|
||||
LOG_DEBUG(F("Calling command '%s/%s' (%s)"), dname.c_str(), cmd, read_flash_string(cf->description_).c_str());
|
||||
}
|
||||
auto description = Helpers::translated_word(cf->description_);
|
||||
char info_s[100];
|
||||
if (strlen(description)) {
|
||||
snprintf(info_s, sizeof(info_s), "'%s/%s' (%s)", dname, cmd, description);
|
||||
} else {
|
||||
if (EMSESP::system_.readonly_mode()) {
|
||||
LOG_INFO(F("[readonly] Calling command '%s/%s' (%s) with value %s"), dname.c_str(), cmd, read_flash_string(cf->description_).c_str(), value);
|
||||
snprintf(info_s, sizeof(info_s), "'%s/%s'", dname, cmd);
|
||||
}
|
||||
|
||||
std::string ro = EMSESP::system_.readonly_mode() ? "[readonly] " : "";
|
||||
|
||||
if ((value == nullptr) || (strlen(value) == 0)) {
|
||||
LOG_DEBUG(("%sCalling command %s"), ro.c_str(), info_s);
|
||||
} else {
|
||||
if (id > 0) {
|
||||
LOG_DEBUG(("%sCalling command %s with value %s and id %d on device 0x%02X"), ro.c_str(), info_s, value, id, device_id);
|
||||
} else {
|
||||
LOG_DEBUG(F("Calling command '%s/%s' (%s) with value %s"), dname.c_str(), cmd, read_flash_string(cf->description_).c_str(), value);
|
||||
LOG_DEBUG(("%sCalling command %s with value %s"), ro.c_str(), info_s, value);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -281,8 +313,13 @@ uint8_t Command::call(const uint8_t device_type, const char * cmd, const char *
|
||||
return_code = ((cf->cmdfunction_json_)(value, id, output)) ? CommandRet::OK : CommandRet::ERROR;
|
||||
}
|
||||
|
||||
if (cf->cmdfunction_ && !EMSESP::cmd_is_readonly(device_type, cmd, id)) {
|
||||
return_code = ((cf->cmdfunction_)(value, id)) ? CommandRet::OK : CommandRet::ERROR;
|
||||
// check if read-only. This also checks for valid tags (e.g. heating circuits)
|
||||
if (cf->cmdfunction_) {
|
||||
if (EMSESP::cmd_is_readonly(device_type, device_id, cmd, id)) {
|
||||
return_code = CommandRet::INVALID; // readonly or invalid hc
|
||||
} else {
|
||||
return_code = ((cf->cmdfunction_)(value, id)) ? CommandRet::OK : CommandRet::ERROR;
|
||||
}
|
||||
}
|
||||
|
||||
// report back
|
||||
@@ -294,51 +331,49 @@ uint8_t Command::call(const uint8_t device_type, const char * cmd, const char *
|
||||
}
|
||||
|
||||
// we didn't find the command and its not an endpoint, report error
|
||||
LOG_DEBUG(F("Command failed: invalid command '%s'"), cmd);
|
||||
LOG_DEBUG("Command failed: invalid command '%s'", cmd ? cmd : "");
|
||||
return message(CommandRet::NOT_FOUND, "invalid command", output);
|
||||
}
|
||||
|
||||
// add a command to the list, which does not return json
|
||||
void Command::add(const uint8_t device_type, const __FlashStringHelper * cmd, const cmd_function_p cb, const __FlashStringHelper * description, uint8_t flags) {
|
||||
void Command::add(const uint8_t device_type, const uint8_t device_id, const char * cmd, const cmd_function_p cb, const char * const * description, uint8_t flags) {
|
||||
// if the command already exists for that device type don't add it
|
||||
if (find_command(device_type, read_flash_string(cmd).c_str()) != nullptr) {
|
||||
if (find_command(device_type, device_id, cmd) != nullptr) {
|
||||
return;
|
||||
}
|
||||
|
||||
// if the description is empty, it's hidden which means it will not show up in Web API or Console as an available command
|
||||
if (description == nullptr) {
|
||||
if (!description) {
|
||||
flags |= CommandFlag::HIDDEN;
|
||||
}
|
||||
|
||||
cmdfunctions_.emplace_back(device_type, flags, cmd, cb, nullptr, description); // callback for json is nullptr
|
||||
cmdfunctions_.emplace_back(device_type, device_id, flags, cmd, cb, nullptr, description); // callback for json is nullptr
|
||||
}
|
||||
|
||||
// same for system/dallas/analog devices with device_id 0
|
||||
void Command::add(const uint8_t device_type, const char * cmd, const cmd_function_p cb, const char * const * description, uint8_t flags) {
|
||||
add(device_type, 0, cmd, cb, description, flags);
|
||||
}
|
||||
|
||||
// add a command to the list, which does return a json object as output
|
||||
void Command::add(const uint8_t device_type, const __FlashStringHelper * cmd, const cmd_json_function_p cb, const __FlashStringHelper * description, uint8_t flags) {
|
||||
void Command::add(const uint8_t device_type, const char * cmd, const cmd_json_function_p cb, const char * const * description, uint8_t flags) {
|
||||
// if the command already exists for that device type don't add it
|
||||
if (find_command(device_type, read_flash_string(cmd).c_str()) != nullptr) {
|
||||
if (find_command(device_type, 0, cmd) != nullptr) {
|
||||
return;
|
||||
}
|
||||
|
||||
cmdfunctions_.emplace_back(device_type, flags, cmd, nullptr, cb, description); // callback for json is included
|
||||
cmdfunctions_.emplace_back(device_type, 0, flags, cmd, nullptr, cb, description); // callback for json is included
|
||||
}
|
||||
|
||||
// see if a command exists for that device type
|
||||
// is not case sensitive
|
||||
Command::CmdFunction * Command::find_command(const uint8_t device_type, const char * cmd) {
|
||||
Command::CmdFunction * Command::find_command(const uint8_t device_type, const uint8_t device_id, const char * cmd) {
|
||||
if ((cmd == nullptr) || (strlen(cmd) == 0) || (cmdfunctions_.empty())) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// convert cmd to lowercase and compare
|
||||
char lowerCmd[30];
|
||||
strlcpy(lowerCmd, cmd, sizeof(lowerCmd));
|
||||
for (char * p = lowerCmd; *p; p++) {
|
||||
*p = tolower(*p);
|
||||
}
|
||||
|
||||
for (auto & cf : cmdfunctions_) {
|
||||
if (!strcmp(lowerCmd, Helpers::toLower(read_flash_string(cf.cmd_)).c_str()) && (cf.device_type_ == device_type)) {
|
||||
if (Helpers::toLower(cmd) == Helpers::toLower(cf.cmd_) && (cf.device_type_ == device_type) && (!device_id || cf.device_id_ == device_id)) {
|
||||
return &cf;
|
||||
}
|
||||
}
|
||||
@@ -346,6 +381,20 @@ Command::CmdFunction * Command::find_command(const uint8_t device_type, const ch
|
||||
return nullptr; // command not found
|
||||
}
|
||||
|
||||
void Command::erase_command(const uint8_t device_type, const char * cmd) {
|
||||
if ((cmd == nullptr) || (strlen(cmd) == 0) || (cmdfunctions_.empty())) {
|
||||
return;
|
||||
}
|
||||
auto it = cmdfunctions_.begin();
|
||||
for (auto & cf : cmdfunctions_) {
|
||||
if (Helpers::toLower(cmd) == Helpers::toLower(cf.cmd_) && (cf.device_type_ == device_type)) {
|
||||
cmdfunctions_.erase(it);
|
||||
return;
|
||||
}
|
||||
it++;
|
||||
}
|
||||
}
|
||||
|
||||
// list all commands for a specific device, output as json
|
||||
bool Command::list(const uint8_t device_type, JsonObject & output) {
|
||||
if (cmdfunctions_.empty()) {
|
||||
@@ -357,15 +406,19 @@ bool Command::list(const uint8_t device_type, JsonObject & output) {
|
||||
std::list<std::string> sorted_cmds;
|
||||
for (const auto & cf : cmdfunctions_) {
|
||||
if ((cf.device_type_ == device_type) && !cf.has_flags(CommandFlag::HIDDEN)) {
|
||||
sorted_cmds.push_back(read_flash_string(cf.cmd_));
|
||||
sorted_cmds.push_back((cf.cmd_));
|
||||
}
|
||||
}
|
||||
sorted_cmds.sort();
|
||||
|
||||
for (const auto & cl : sorted_cmds) {
|
||||
for (const auto & cf : cmdfunctions_) {
|
||||
if ((cf.device_type_ == device_type) && !cf.has_flags(CommandFlag::HIDDEN) && cf.description_ && (cl == read_flash_string(cf.cmd_))) {
|
||||
output[cl] = cf.description_;
|
||||
if ((cf.device_type_ == device_type) && !cf.has_flags(CommandFlag::HIDDEN) && cf.description_ && (cl == std::string(cf.cmd_))) {
|
||||
if (cf.has_flags(CommandFlag::MQTT_SUB_FLAG_WW)) {
|
||||
output[cl] = EMSdevice::tag_to_string(DeviceValueTAG::TAG_DEVICE_DATA_WW) + " " + Helpers::translated_word(cf.description_);
|
||||
} else {
|
||||
output[cl] = Helpers::translated_word(cf.description_);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -376,7 +429,7 @@ bool Command::list(const uint8_t device_type, JsonObject & output) {
|
||||
// output list of all commands to console for a specific DeviceType
|
||||
void Command::show(uuid::console::Shell & shell, uint8_t device_type, bool verbose) {
|
||||
if (cmdfunctions_.empty()) {
|
||||
shell.println(F("No commands available"));
|
||||
shell.println("No commands available");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -384,7 +437,7 @@ void Command::show(uuid::console::Shell & shell, uint8_t device_type, bool verbo
|
||||
std::list<std::string> sorted_cmds;
|
||||
for (const auto & cf : cmdfunctions_) {
|
||||
if ((cf.device_type_ == device_type) && !cf.has_flags(CommandFlag::HIDDEN)) {
|
||||
sorted_cmds.push_back(read_flash_string(cf.cmd_));
|
||||
sorted_cmds.push_back((cf.cmd_));
|
||||
}
|
||||
}
|
||||
sorted_cmds.sort();
|
||||
@@ -404,7 +457,7 @@ void Command::show(uuid::console::Shell & shell, uint8_t device_type, bool verbo
|
||||
for (const auto & cl : sorted_cmds) {
|
||||
// find and print the description
|
||||
for (const auto & cf : cmdfunctions_) {
|
||||
if ((cf.device_type_ == device_type) && !cf.has_flags(CommandFlag::HIDDEN) && cf.description_ && (cl == read_flash_string(cf.cmd_))) {
|
||||
if ((cf.device_type_ == device_type) && !cf.has_flags(CommandFlag::HIDDEN) && cf.description_ && (cl == std::string(cf.cmd_))) {
|
||||
uint8_t i = cl.length();
|
||||
shell.print(" ");
|
||||
if (cf.has_flags(MQTT_SUB_FLAG_HC)) {
|
||||
@@ -424,7 +477,7 @@ void Command::show(uuid::console::Shell & shell, uint8_t device_type, bool verbo
|
||||
shell.print(EMSdevice::tag_to_string(DeviceValueTAG::TAG_DEVICE_DATA_WW));
|
||||
shell.print(' ');
|
||||
}
|
||||
shell.print(read_flash_string(cf.description_));
|
||||
shell.print(Helpers::translated_word(cf.description_));
|
||||
if (!cf.has_flags(CommandFlag::ADMIN_ONLY)) {
|
||||
shell.print(' ');
|
||||
shell.print(COLOR_BRIGHT_RED);
|
||||
@@ -474,19 +527,19 @@ bool Command::device_has_commands(const uint8_t device_type) {
|
||||
|
||||
// list sensors and EMS devices
|
||||
void Command::show_devices(uuid::console::Shell & shell) {
|
||||
shell.printf("%s ", EMSdevice::device_type_2_device_name(EMSdevice::DeviceType::SYSTEM).c_str());
|
||||
shell.printf("%s ", EMSdevice::device_type_2_device_name(EMSdevice::DeviceType::SYSTEM));
|
||||
|
||||
if (EMSESP::dallassensor_.have_sensors()) {
|
||||
shell.printf("%s ", EMSdevice::device_type_2_device_name(EMSdevice::DeviceType::DALLASSENSOR).c_str());
|
||||
shell.printf("%s ", EMSdevice::device_type_2_device_name(EMSdevice::DeviceType::DALLASSENSOR));
|
||||
}
|
||||
if (EMSESP::analogsensor_.have_sensors()) {
|
||||
shell.printf("%s ", EMSdevice::device_type_2_device_name(EMSdevice::DeviceType::ANALOGSENSOR).c_str());
|
||||
shell.printf("%s ", EMSdevice::device_type_2_device_name(EMSdevice::DeviceType::ANALOGSENSOR));
|
||||
}
|
||||
|
||||
for (const auto & device_class : EMSFactory::device_handlers()) {
|
||||
for (const auto & emsdevice : EMSESP::emsdevices) {
|
||||
if (emsdevice && (emsdevice->device_type() == device_class.first) && (device_has_commands(device_class.first))) {
|
||||
shell.printf("%s ", EMSdevice::device_type_2_device_name(device_class.first).c_str());
|
||||
shell.printf("%s ", EMSdevice::device_type_2_device_name(device_class.first));
|
||||
break; // we only want to show one (not multiple of the same device types)
|
||||
}
|
||||
}
|
||||
@@ -497,12 +550,12 @@ void Command::show_devices(uuid::console::Shell & shell) {
|
||||
// output list of all commands to console
|
||||
// calls show with verbose mode set
|
||||
void Command::show_all(uuid::console::Shell & shell) {
|
||||
shell.println(F("Available commands (*=do not need authorization): "));
|
||||
shell.println("Available commands (*=do not need authorization): ");
|
||||
|
||||
// show system first
|
||||
shell.print(COLOR_BOLD_ON);
|
||||
shell.print(COLOR_YELLOW);
|
||||
shell.printf(" %s: ", EMSdevice::device_type_2_device_name(EMSdevice::DeviceType::SYSTEM).c_str());
|
||||
shell.printf(" %s: ", EMSdevice::device_type_2_device_name(EMSdevice::DeviceType::SYSTEM));
|
||||
shell.print(COLOR_RESET);
|
||||
show(shell, EMSdevice::DeviceType::SYSTEM, true);
|
||||
|
||||
@@ -510,14 +563,14 @@ void Command::show_all(uuid::console::Shell & shell) {
|
||||
if (EMSESP::dallassensor_.have_sensors()) {
|
||||
shell.print(COLOR_BOLD_ON);
|
||||
shell.print(COLOR_YELLOW);
|
||||
shell.printf(" %s: ", EMSdevice::device_type_2_device_name(EMSdevice::DeviceType::DALLASSENSOR).c_str());
|
||||
shell.printf(" %s: ", EMSdevice::device_type_2_device_name(EMSdevice::DeviceType::DALLASSENSOR));
|
||||
shell.print(COLOR_RESET);
|
||||
show(shell, EMSdevice::DeviceType::DALLASSENSOR, true);
|
||||
}
|
||||
if (EMSESP::analogsensor_.have_sensors()) {
|
||||
shell.print(COLOR_BOLD_ON);
|
||||
shell.print(COLOR_YELLOW);
|
||||
shell.printf(" %s: ", EMSdevice::device_type_2_device_name(EMSdevice::DeviceType::ANALOGSENSOR).c_str());
|
||||
shell.printf(" %s: ", EMSdevice::device_type_2_device_name(EMSdevice::DeviceType::ANALOGSENSOR));
|
||||
shell.print(COLOR_RESET);
|
||||
show(shell, EMSdevice::DeviceType::ANALOGSENSOR, true);
|
||||
}
|
||||
@@ -527,7 +580,7 @@ void Command::show_all(uuid::console::Shell & shell) {
|
||||
if (Command::device_has_commands(device_class.first)) {
|
||||
shell.print(COLOR_BOLD_ON);
|
||||
shell.print(COLOR_YELLOW);
|
||||
shell.printf(" %s: ", EMSdevice::device_type_2_device_name(device_class.first).c_str());
|
||||
shell.printf(" %s: ", EMSdevice::device_type_2_device_name(device_class.first));
|
||||
shell.print(COLOR_RESET);
|
||||
show(shell, device_class.first, true);
|
||||
}
|
||||
|
||||
@@ -40,12 +40,12 @@ enum CommandFlag : uint8_t {
|
||||
|
||||
// return status after calling a Command
|
||||
enum CommandRet : uint8_t {
|
||||
FAIL = 0, // 0 or FALSE
|
||||
OK, // 1 or TRUE
|
||||
NOT_FOUND, // 2
|
||||
ERROR, // 3
|
||||
NOT_ALLOWED // needs authentication
|
||||
|
||||
FAIL = 0, // 0 or FALSE
|
||||
OK, // 1 or TRUE
|
||||
NOT_FOUND, // 2
|
||||
ERROR, // 3
|
||||
NOT_ALLOWED, // 4 - needs authentication
|
||||
INVALID // 5 - invalid (tag)
|
||||
};
|
||||
|
||||
using cmd_function_p = std::function<bool(const char * data, const int8_t id)>;
|
||||
@@ -54,20 +54,23 @@ using cmd_json_function_p = std::function<bool(const char * data, const int8_t i
|
||||
class Command {
|
||||
public:
|
||||
struct CmdFunction {
|
||||
uint8_t device_type_; // DeviceType::
|
||||
uint8_t flags_; // mqtt flags for command subscriptions
|
||||
const __FlashStringHelper * cmd_;
|
||||
const cmd_function_p cmdfunction_;
|
||||
const cmd_json_function_p cmdfunction_json_;
|
||||
const __FlashStringHelper * description_;
|
||||
uint8_t device_type_; // DeviceType::
|
||||
uint8_t device_id_;
|
||||
uint8_t flags_; // mqtt flags for command subscriptions
|
||||
const char * cmd_;
|
||||
cmd_function_p cmdfunction_;
|
||||
cmd_json_function_p cmdfunction_json_;
|
||||
const char * const * description_;
|
||||
|
||||
CmdFunction(const uint8_t device_type,
|
||||
const uint8_t flags,
|
||||
const __FlashStringHelper * cmd,
|
||||
const cmd_function_p cmdfunction,
|
||||
const cmd_json_function_p cmdfunction_json,
|
||||
const __FlashStringHelper * description)
|
||||
CmdFunction(const uint8_t device_type,
|
||||
const uint8_t device_id,
|
||||
const uint8_t flags,
|
||||
const char * cmd,
|
||||
const cmd_function_p cmdfunction,
|
||||
const cmd_json_function_p cmdfunction_json,
|
||||
const char * const * description)
|
||||
: device_type_(device_type)
|
||||
, device_id_(device_id)
|
||||
, flags_(flags)
|
||||
, cmd_(cmd)
|
||||
, cmdfunction_(cmdfunction)
|
||||
@@ -93,28 +96,35 @@ class Command {
|
||||
return cmdfunctions_;
|
||||
}
|
||||
|
||||
#define add_
|
||||
|
||||
static uint8_t call(const uint8_t device_type, const char * cmd, const char * value, const bool is_admin, const int8_t id, JsonObject & output);
|
||||
static uint8_t call(const uint8_t device_type, const char * cmd, const char * value);
|
||||
|
||||
// with normal call back function taking a value and id
|
||||
static void add(const uint8_t device_type,
|
||||
const __FlashStringHelper * cmd,
|
||||
const cmd_function_p cb,
|
||||
const __FlashStringHelper * description,
|
||||
uint8_t flags = CommandFlag::MQTT_SUB_FLAG_DEFAULT);
|
||||
static void add(const uint8_t device_type,
|
||||
const uint8_t device_id,
|
||||
const char * cmd,
|
||||
const cmd_function_p cb,
|
||||
const char * const * description,
|
||||
uint8_t flags = CommandFlag::MQTT_SUB_FLAG_DEFAULT);
|
||||
|
||||
// same for system/dallas/analog devices
|
||||
static void add(const uint8_t device_type,
|
||||
const char * cmd,
|
||||
const cmd_function_p cb,
|
||||
const char * const * description,
|
||||
uint8_t flags = CommandFlag::MQTT_SUB_FLAG_DEFAULT);
|
||||
|
||||
// callback function taking value, id and a json object for its output
|
||||
static void add(const uint8_t device_type,
|
||||
const __FlashStringHelper * cmd,
|
||||
const cmd_json_function_p cb,
|
||||
const __FlashStringHelper * description,
|
||||
uint8_t flags = CommandFlag::MQTT_SUB_FLAG_DEFAULT);
|
||||
static void add(const uint8_t device_type,
|
||||
const char * cmd,
|
||||
const cmd_json_function_p cb,
|
||||
const char * const * description,
|
||||
uint8_t flags = CommandFlag::MQTT_SUB_FLAG_DEFAULT);
|
||||
|
||||
static void show_all(uuid::console::Shell & shell);
|
||||
static Command::CmdFunction * find_command(const uint8_t device_type, const char * cmd);
|
||||
static Command::CmdFunction * find_command(const uint8_t device_type, const uint8_t device_id, const char * cmd);
|
||||
|
||||
static void erase_command(const uint8_t device_type, const char * cmd);
|
||||
static void show(uuid::console::Shell & shell, uint8_t device_type, bool verbose);
|
||||
static void show_devices(uuid::console::Shell & shell);
|
||||
static bool device_has_commands(const uint8_t device_type);
|
||||
|
||||
58
src/common.h
Normal file
58
src/common.h
Normal file
@@ -0,0 +1,58 @@
|
||||
/*
|
||||
* EMS-ESP - https://github.com/emsesp/EMS-ESP
|
||||
* Copyright 2020 Paul Derbyshire
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef EMSESP_COMMON_H
|
||||
#define EMSESP_COMMON_H
|
||||
|
||||
// logging
|
||||
#include <uuid/log.h>
|
||||
|
||||
using uuid::log::Level;
|
||||
#define LOG_DEBUG(...) logger_.debug(__VA_ARGS__)
|
||||
#define LOG_INFO(...) logger_.info(__VA_ARGS__)
|
||||
#define LOG_TRACE(...) logger_.trace(__VA_ARGS__)
|
||||
#define LOG_NOTICE(...) logger_.notice(__VA_ARGS__)
|
||||
#define LOG_WARNING(...) logger_.warning(__VA_ARGS__)
|
||||
#define LOG_ERROR(...) logger_.err(__VA_ARGS__)
|
||||
|
||||
// flash strings
|
||||
using uuid::string_vector;
|
||||
using string_vector = std::vector<const char *>;
|
||||
|
||||
#ifdef FPSTR
|
||||
#undef FPSTR
|
||||
#endif
|
||||
|
||||
// clang-format off
|
||||
|
||||
#define FPSTR(pstr_pointer) pstr_pointer
|
||||
#define MAKE_PSTR(string_name, string_literal) static const char __pstr__##string_name[] = string_literal;
|
||||
#define MAKE_PSTR_WORD(string_name) MAKE_PSTR(string_name, #string_name)
|
||||
|
||||
#define F_(string_name) (__pstr__##string_name)
|
||||
#define FL_(list_name) (__pstr__L_##list_name)
|
||||
#define MAKE_PSTR_LIST(list_name, ...) static const char * const __pstr__L_##list_name[] = {__VA_ARGS__, nullptr};
|
||||
#define MAKE_PSTR_ENUM(enum_name, ...) static const char * const * __pstr__L_##enum_name[] = {__VA_ARGS__, nullptr};
|
||||
|
||||
// clang-format on
|
||||
|
||||
// load translations
|
||||
#include "locale_translations.h"
|
||||
#include "locale_common.h"
|
||||
|
||||
#endif
|
||||
211
src/console.cpp
211
src/console.cpp
@@ -45,26 +45,26 @@ EMSESPShell::EMSESPShell()
|
||||
}
|
||||
|
||||
void EMSESPShell::started() {
|
||||
logger().log(LogLevel::DEBUG, LogFacility::CONSOLE, F("User session opened on console %s"), console_name().c_str());
|
||||
logger().log(LogLevel::DEBUG, LogFacility::CONSOLE, ("User session opened on console %s"), console_name().c_str());
|
||||
}
|
||||
|
||||
void EMSESPShell::stopped() {
|
||||
if (has_flags(CommandFlags::ADMIN)) {
|
||||
logger().log(LogLevel::DEBUG, LogFacility::AUTH, F("su session closed on console %s"), console_name().c_str());
|
||||
logger().log(LogLevel::DEBUG, LogFacility::AUTH, ("su session closed on console %s"), console_name().c_str());
|
||||
}
|
||||
logger().log(LogLevel::DEBUG, LogFacility::CONSOLE, F("User session closed on console %s"), console_name().c_str());
|
||||
logger().log(LogLevel::DEBUG, LogFacility::CONSOLE, ("User session closed on console %s"), console_name().c_str());
|
||||
}
|
||||
|
||||
// show welcome banner
|
||||
// this is one of the first functions called when the shell is started
|
||||
void EMSESPShell::display_banner() {
|
||||
println();
|
||||
printfln(F("┌──────────────────────────────────────┐"));
|
||||
printfln(F("│ %sEMS-ESP version %-10s%s │"), COLOR_BOLD_ON, EMSESP_APP_VERSION, COLOR_BOLD_OFF);
|
||||
printfln(F("│ %s%shttps://github.com/emsesp/EMS-ESP32%s │"), COLOR_BRIGHT_GREEN, COLOR_UNDERLINE, COLOR_RESET);
|
||||
printfln(F("│ │"));
|
||||
printfln(F("│ type %shelp%s to show available commands │"), COLOR_UNDERLINE, COLOR_RESET);
|
||||
printfln(F("└──────────────────────────────────────┘"));
|
||||
printfln("┌────────────────────────────────────────────┐");
|
||||
printfln("│ %sEMS-ESP version %-10s%s │", COLOR_BOLD_ON, EMSESP_APP_VERSION, COLOR_BOLD_OFF);
|
||||
printfln("│ %s%shttps://github.com/emsesp/EMS-ESP32%s │", COLOR_BRIGHT_GREEN, COLOR_UNDERLINE, COLOR_RESET);
|
||||
printfln("│ │");
|
||||
printfln("│ type %shelp%s to show available commands │", COLOR_UNDERLINE, COLOR_RESET);
|
||||
printfln("└────────────────────────────────────────────┘");
|
||||
println();
|
||||
|
||||
// set console name
|
||||
@@ -100,9 +100,9 @@ void EMSESPShell::add_console_commands() {
|
||||
|
||||
commands->add_command(ShellContext::MAIN,
|
||||
CommandFlags::USER,
|
||||
flash_string_vector{F_(show)},
|
||||
string_vector{F_(show)},
|
||||
[](Shell & shell, const std::vector<std::string> & arguments __attribute__((unused))) {
|
||||
shell.printfln(F("%s%sEMS-ESP version %s%s"), COLOR_BRIGHT_GREEN, COLOR_BOLD_ON, EMSESP_APP_VERSION, COLOR_RESET);
|
||||
shell.printfln("%s%sEMS-ESP version %s%s", COLOR_BRIGHT_GREEN, COLOR_BOLD_ON, EMSESP_APP_VERSION, COLOR_RESET);
|
||||
shell.println();
|
||||
EMSESP::show_device_values(shell);
|
||||
EMSESP::show_sensor_values(shell);
|
||||
@@ -110,36 +110,36 @@ void EMSESPShell::add_console_commands() {
|
||||
|
||||
commands->add_command(ShellContext::MAIN,
|
||||
CommandFlags::USER,
|
||||
flash_string_vector{F_(show), F_(devices)},
|
||||
string_vector{F_(show), F_(devices)},
|
||||
[](Shell & shell, const std::vector<std::string> & arguments __attribute__((unused))) { EMSESP::show_devices(shell); });
|
||||
|
||||
|
||||
commands->add_command(ShellContext::MAIN,
|
||||
CommandFlags::USER,
|
||||
flash_string_vector{F_(show), F_(ems)},
|
||||
string_vector{F_(show), F_(ems)},
|
||||
[](Shell & shell, const std::vector<std::string> & arguments __attribute__((unused))) { EMSESP::show_ems(shell); });
|
||||
|
||||
commands->add_command(ShellContext::MAIN,
|
||||
CommandFlags::USER,
|
||||
flash_string_vector{F_(show), F_(values)},
|
||||
string_vector{F_(show), F_(values)},
|
||||
[](Shell & shell, const std::vector<std::string> & arguments __attribute__((unused))) { EMSESP::show_device_values(shell); });
|
||||
|
||||
commands->add_command(ShellContext::MAIN,
|
||||
CommandFlags::USER,
|
||||
flash_string_vector{F_(show), F_(mqtt)},
|
||||
string_vector{F_(show), F_(mqtt)},
|
||||
[](Shell & shell, const std::vector<std::string> & arguments __attribute__((unused))) { Mqtt::show_mqtt(shell); });
|
||||
|
||||
|
||||
commands->add_command(ShellContext::MAIN,
|
||||
CommandFlags::USER,
|
||||
flash_string_vector{F_(show), F_(commands)},
|
||||
string_vector{F_(show), F_(commands)},
|
||||
[](Shell & shell, const std::vector<std::string> & arguments __attribute__((unused))) { Command::show_all(shell); });
|
||||
|
||||
commands->add_command(
|
||||
ShellContext::MAIN,
|
||||
CommandFlags::ADMIN,
|
||||
flash_string_vector{F_(set), F_(bus_id)},
|
||||
flash_string_vector{F_(deviceid_mandatory)},
|
||||
string_vector{F_(set), F_(bus_id)},
|
||||
string_vector{F_(deviceid_mandatory)},
|
||||
[](Shell & shell, const std::vector<std::string> & arguments) {
|
||||
uint8_t device_id = Helpers::hextoint(arguments.front().c_str());
|
||||
if ((device_id == 0x0B) || (device_id == 0x0D) || (device_id == 0x0A) || (device_id == 0x0F) || (device_id == 0x12)) {
|
||||
@@ -151,24 +151,17 @@ void EMSESPShell::add_console_commands() {
|
||||
},
|
||||
"local");
|
||||
} else {
|
||||
shell.println(F("Must be 0B, 0D, 0A, 0F or 12"));
|
||||
shell.println("Must be 0B, 0D, 0A, 0E, 0F, or 48 - 4D");
|
||||
}
|
||||
},
|
||||
[](Shell & shell __attribute__((unused)), const std::vector<std::string> & arguments __attribute__((unused))) -> const std::vector<std::string> {
|
||||
return std::vector<std::string>{
|
||||
read_flash_string(F("0B")),
|
||||
read_flash_string(F("0D")),
|
||||
read_flash_string(F("0A")),
|
||||
read_flash_string(F("0F")),
|
||||
read_flash_string(F("12")),
|
||||
|
||||
};
|
||||
return std::vector<std::string>{"0B", "0D", "0A", "0E", "0F", "48", "49", "4A", "4B", "4C", "4D"};
|
||||
});
|
||||
|
||||
commands->add_command(ShellContext::MAIN,
|
||||
CommandFlags::ADMIN,
|
||||
flash_string_vector{F_(set), F_(tx_mode)},
|
||||
flash_string_vector{F_(n_mandatory)},
|
||||
string_vector{F_(set), F_(tx_mode)},
|
||||
string_vector{F_(n_mandatory)},
|
||||
[](Shell & shell, const std::vector<std::string> & arguments) {
|
||||
uint8_t tx_mode = std::strtol(arguments[0].c_str(), nullptr, 10);
|
||||
// save the tx_mode
|
||||
@@ -183,13 +176,13 @@ void EMSESPShell::add_console_commands() {
|
||||
|
||||
commands->add_command(ShellContext::MAIN,
|
||||
CommandFlags::ADMIN,
|
||||
flash_string_vector{F_(scan), F_(devices)},
|
||||
flash_string_vector{F_(deep_optional)},
|
||||
string_vector{F_(scan), F_(devices)},
|
||||
string_vector{F_(deep_optional)},
|
||||
[](Shell & shell, const std::vector<std::string> & arguments) {
|
||||
if (arguments.size() == 0) {
|
||||
EMSESP::scan_devices();
|
||||
} else {
|
||||
shell.printfln(F("Performing a deep scan..."));
|
||||
shell.printfln("Performing a deep scan...");
|
||||
EMSESP::clear_all_devices();
|
||||
std::vector<uint8_t> Device_Ids;
|
||||
|
||||
@@ -222,9 +215,10 @@ void EMSESPShell::add_console_commands() {
|
||||
|
||||
commands->add_command(ShellContext::MAIN,
|
||||
CommandFlags::USER,
|
||||
flash_string_vector{F_(set)},
|
||||
string_vector{F_(set)},
|
||||
[](Shell & shell, const std::vector<std::string> & arguments __attribute__((unused))) {
|
||||
EMSESP::webSettingsService.read([&](WebSettings & settings) {
|
||||
shell.printfln("Language: %s", settings.locale.c_str());
|
||||
shell.printfln(F_(tx_mode_fmt), settings.tx_mode);
|
||||
shell.printfln(F_(bus_id_fmt), settings.ems_bus_id);
|
||||
shell.printfln(F_(board_profile_fmt), settings.board_profile.c_str());
|
||||
@@ -233,13 +227,13 @@ void EMSESPShell::add_console_commands() {
|
||||
|
||||
commands->add_command(ShellContext::MAIN,
|
||||
CommandFlags::USER,
|
||||
flash_string_vector{F_(read)},
|
||||
flash_string_vector{F_(deviceid_mandatory), F_(typeid_mandatory), F_(offset_optional), F_(length_optional)},
|
||||
string_vector{F_(read)},
|
||||
string_vector{F_(deviceid_mandatory), F_(typeid_mandatory), F_(offset_optional), F_(length_optional)},
|
||||
[=](Shell & shell __attribute__((unused)), const std::vector<std::string> & arguments) {
|
||||
uint8_t device_id = Helpers::hextoint(arguments.front().c_str());
|
||||
|
||||
if (!EMSESP::valid_device(device_id)) {
|
||||
shell.printfln(F("Invalid deviceID"));
|
||||
shell.printfln("Invalid deviceID");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -260,38 +254,40 @@ void EMSESPShell::add_console_commands() {
|
||||
#ifndef EMSESP_STANDALONE
|
||||
commands->add_command(ShellContext::MAIN,
|
||||
CommandFlags::USER,
|
||||
flash_string_vector{F_(set), F_(timeout)},
|
||||
flash_string_vector{F_(n_mandatory)},
|
||||
string_vector{F_(set), F_(timeout)},
|
||||
string_vector{F_(n_mandatory)},
|
||||
[](Shell & shell, const std::vector<std::string> & arguments) {
|
||||
uint16_t value = Helpers::atoint(arguments.front().c_str());
|
||||
telnet_.initial_idle_timeout(value * 60);
|
||||
shell.printfln(F("Telnet timeout set to %d minutes"), value);
|
||||
shell.printfln("Telnet timeout set to %d minutes", value);
|
||||
});
|
||||
#endif
|
||||
|
||||
commands->add_command(ShellContext::MAIN,
|
||||
CommandFlags::USER,
|
||||
flash_string_vector{F_(watch)},
|
||||
flash_string_vector{F_(watch_format_optional), F_(watchid_optional)},
|
||||
string_vector{F_(watch)},
|
||||
string_vector{F_(watch_format_optional), F_(watchid_optional)},
|
||||
[](Shell & shell, const std::vector<std::string> & arguments) {
|
||||
uint16_t watch_id = WATCH_ID_NONE;
|
||||
|
||||
// only use english commands, not the translations
|
||||
if (!arguments.empty()) {
|
||||
// get raw/pretty
|
||||
if (arguments[0] == read_flash_string(F_(raw))) {
|
||||
if (arguments[0] == (F_(raw))) {
|
||||
EMSESP::watch(EMSESP::WATCH_RAW); // raw
|
||||
} else if (arguments[0] == read_flash_string(F_(on))) {
|
||||
} else if (arguments[0] == (FL_(on)[0])) {
|
||||
EMSESP::watch(EMSESP::WATCH_ON); // on
|
||||
} else if (arguments[0] == read_flash_string(F_(off))) {
|
||||
} else if (arguments[0] == (FL_(off)[0])) {
|
||||
EMSESP::watch(EMSESP::WATCH_OFF); // off
|
||||
} else if (arguments[0] == read_flash_string(F_(unknown))) {
|
||||
} else if (arguments[0] == (FL_(unknown)[0])) {
|
||||
EMSESP::watch(EMSESP::WATCH_UNKNOWN); // unknown
|
||||
watch_id = WATCH_ID_NONE;
|
||||
} else {
|
||||
watch_id = Helpers::hextoint(arguments[0].c_str());
|
||||
if (watch_id && ((EMSESP::watch() == EMSESP::WATCH_OFF) || (EMSESP::watch() == EMSESP::WATCH_UNKNOWN))) {
|
||||
if (watch_id > 0 && ((EMSESP::watch() == EMSESP::WATCH_OFF) || (EMSESP::watch() == EMSESP::WATCH_UNKNOWN))) {
|
||||
EMSESP::watch(EMSESP::WATCH_ON); // on
|
||||
} else if (!watch_id) {
|
||||
} else if (watch_id == 0) {
|
||||
EMSESP::watch(EMSESP::WATCH_OFF); // off
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -302,41 +298,44 @@ void EMSESPShell::add_console_commands() {
|
||||
}
|
||||
|
||||
EMSESP::watch_id(watch_id);
|
||||
} else {
|
||||
shell.printfln("Invalid: use watch raw|on|off|unknown|id [id]");
|
||||
return;
|
||||
}
|
||||
|
||||
uint8_t watch = EMSESP::watch();
|
||||
if (watch == EMSESP::WATCH_OFF) {
|
||||
shell.printfln(F("Watching telegrams is off"));
|
||||
shell.printfln("Watching telegrams is off");
|
||||
return;
|
||||
}
|
||||
|
||||
// if logging is off, the watch won't show anything, show force it back to NOTICE
|
||||
if (shell.log_level() < Level::NOTICE) {
|
||||
shell.log_level(Level::NOTICE);
|
||||
shell.printfln(F("Setting log level to Notice"));
|
||||
shell.printfln("Setting log level to Notice");
|
||||
}
|
||||
|
||||
if (watch == EMSESP::WATCH_ON) {
|
||||
shell.printfln(F("Watching incoming telegrams, displayed in decoded format"));
|
||||
shell.printfln("Watching incoming telegrams, displayed in decoded format");
|
||||
} else if (watch == EMSESP::WATCH_RAW) {
|
||||
shell.printfln(F("Watching incoming telegrams, displayed as raw bytes")); // WATCH_RAW
|
||||
shell.printfln("Watching incoming telegrams, displayed as raw bytes"); // WATCH_RAW
|
||||
} else {
|
||||
shell.printfln(F("Watching unknown telegrams")); // WATCH_UNKNOWN
|
||||
shell.printfln("Watching unknown telegrams"); // WATCH_UNKNOWN
|
||||
}
|
||||
|
||||
watch_id = EMSESP::watch_id();
|
||||
if (watch_id > 0x80) {
|
||||
shell.printfln(F("Filtering only telegrams that match a telegram type of 0x%02X"), watch_id);
|
||||
shell.printfln("Filtering only telegrams that match a telegram type of 0x%02X", watch_id);
|
||||
} else if (watch_id != WATCH_ID_NONE) {
|
||||
shell.printfln(F("Filtering only telegrams that match a deviceID or telegram type of 0x%02X"), watch_id);
|
||||
shell.printfln("Filtering only telegrams that match a deviceID or telegram type of 0x%02X", watch_id);
|
||||
}
|
||||
});
|
||||
|
||||
commands->add_command(
|
||||
ShellContext::MAIN,
|
||||
CommandFlags::ADMIN,
|
||||
flash_string_vector{F_(call)},
|
||||
flash_string_vector{F_(device_type_optional), F_(cmd_optional), F_(data_optional), F_(id_optional)},
|
||||
string_vector{F_(call)},
|
||||
string_vector{F_(device_type_optional), F_(cmd_optional), F_(data_optional), F_(id_optional)},
|
||||
[&](Shell & shell, const std::vector<std::string> & arguments) {
|
||||
if (arguments.empty()) {
|
||||
Command::show_all(shell); // list options
|
||||
@@ -346,7 +345,7 @@ void EMSESPShell::add_console_commands() {
|
||||
// validate the device_type
|
||||
uint8_t device_type = EMSdevice::device_name_2_device_type(arguments[0].c_str());
|
||||
if (!Command::device_has_commands(device_type)) {
|
||||
shell.print(F("Invalid device. Available devices are: "));
|
||||
shell.print("Invalid device. Available devices are: ");
|
||||
Command::show_devices(shell);
|
||||
return;
|
||||
}
|
||||
@@ -354,7 +353,7 @@ void EMSESPShell::add_console_commands() {
|
||||
|
||||
// validate that a command is present
|
||||
if (arguments.size() < 2) {
|
||||
shell.print(F("Missing command. Available commands are: "));
|
||||
shell.print("Missing command. Available commands are: ");
|
||||
Command::show(shell, device_type, false); // non-verbose mode
|
||||
return;
|
||||
}
|
||||
@@ -365,11 +364,15 @@ void EMSESPShell::add_console_commands() {
|
||||
uint8_t return_code = CommandRet::OK;
|
||||
JsonObject json = doc.to<JsonObject>();
|
||||
|
||||
if (cmd == nullptr) {
|
||||
cmd = device_type == EMSdevice::DeviceType::SYSTEM ? F_(info) : F_(values);
|
||||
}
|
||||
|
||||
if (arguments.size() == 2) {
|
||||
// no value specified, just the cmd
|
||||
return_code = Command::call(device_type, cmd, nullptr, true, id, json);
|
||||
} else if (arguments.size() == 3) {
|
||||
if (strncmp(cmd, "info", 4) == 0) {
|
||||
if (strncmp(cmd, F_(info), 4) == 0 || strncmp(cmd, F_(values), 6) == 0) {
|
||||
// info has a id but no value
|
||||
return_code = Command::call(device_type, cmd, nullptr, true, atoi(arguments.back().c_str()), json);
|
||||
} else if (arguments[2] == "?") {
|
||||
@@ -388,17 +391,22 @@ void EMSESPShell::add_console_commands() {
|
||||
}
|
||||
|
||||
if (return_code == CommandRet::OK && json.size()) {
|
||||
if (json.containsKey("api_data")) {
|
||||
JsonVariant data = json["api_data"];
|
||||
shell.println(data.as<const char *>());
|
||||
return;
|
||||
}
|
||||
serializeJsonPretty(doc, shell);
|
||||
shell.println();
|
||||
return;
|
||||
}
|
||||
|
||||
if (return_code == CommandRet::NOT_FOUND) {
|
||||
shell.println(F("Unknown command"));
|
||||
shell.print(F("Available commands are: "));
|
||||
shell.println("Unknown command");
|
||||
shell.print("Available commands are: ");
|
||||
Command::show(shell, device_type, false); // non-verbose mode
|
||||
} else if (return_code != CommandRet::OK) {
|
||||
shell.printfln(F("Bad syntax (error code %d)"), return_code);
|
||||
shell.printfln("Bad syntax (error code %d)", return_code);
|
||||
}
|
||||
},
|
||||
[&](Shell & shell __attribute__((unused)), const std::vector<std::string> & arguments) -> std::vector<std::string> {
|
||||
@@ -419,7 +427,7 @@ void EMSESPShell::add_console_commands() {
|
||||
if (Command::device_has_commands(device_type)) {
|
||||
for (const auto & cf : Command::commands()) {
|
||||
if (cf.device_type_ == device_type) {
|
||||
command_list.emplace_back(read_flash_string(cf.cmd_));
|
||||
command_list.emplace_back(cf.cmd_);
|
||||
}
|
||||
}
|
||||
return command_list;
|
||||
@@ -443,8 +451,8 @@ void Console::load_standard_commands(unsigned int context) {
|
||||
// create commands test and t
|
||||
EMSESPShell::commands->add_command(context,
|
||||
CommandFlags::USER,
|
||||
flash_string_vector{F("test")},
|
||||
flash_string_vector{F_(name_optional), F_(data_optional)},
|
||||
string_vector{"test"},
|
||||
string_vector{F_(name_optional), F_(data_optional)},
|
||||
[](Shell & shell, const std::vector<std::string> & arguments) {
|
||||
if (arguments.empty()) {
|
||||
Test::run_test(shell, "default");
|
||||
@@ -455,7 +463,7 @@ void Console::load_standard_commands(unsigned int context) {
|
||||
}
|
||||
});
|
||||
|
||||
EMSESPShell::commands->add_command(context, CommandFlags::USER, flash_string_vector{F("t")}, [](Shell & shell, const std::vector<std::string> & arguments) {
|
||||
EMSESPShell::commands->add_command(context, CommandFlags::USER, string_vector{("t")}, [](Shell & shell, const std::vector<std::string> & arguments) {
|
||||
Test::run_test(shell, "default");
|
||||
});
|
||||
#endif
|
||||
@@ -463,8 +471,8 @@ void Console::load_standard_commands(unsigned int context) {
|
||||
#if defined(EMSESP_DEBUG)
|
||||
EMSESPShell::commands->add_command(context,
|
||||
CommandFlags::USER,
|
||||
flash_string_vector{F_(debug)},
|
||||
flash_string_vector{F_(name_optional)},
|
||||
string_vector{F_(debug)},
|
||||
string_vector{F_(name_optional)},
|
||||
[](Shell & shell, const std::vector<std::string> & arguments) {
|
||||
if (arguments.empty()) {
|
||||
Test::debug(shell, "default");
|
||||
@@ -477,8 +485,8 @@ void Console::load_standard_commands(unsigned int context) {
|
||||
EMSESPShell::commands->add_command(
|
||||
context,
|
||||
CommandFlags::USER,
|
||||
flash_string_vector{F_(log)},
|
||||
flash_string_vector{F_(log_level_optional)},
|
||||
string_vector{F_(log)},
|
||||
string_vector{F_(log_level_optional)},
|
||||
[](Shell & shell, const std::vector<std::string> & arguments) {
|
||||
if (!arguments.empty()) {
|
||||
uuid::log::Level level;
|
||||
@@ -489,7 +497,7 @@ void Console::load_standard_commands(unsigned int context) {
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
shell.print(F("levels: "));
|
||||
shell.print("levels: ");
|
||||
std::vector<std::string> v = uuid::log::levels_lowercase();
|
||||
size_t i = v.size();
|
||||
while (i--) {
|
||||
@@ -506,22 +514,22 @@ void Console::load_standard_commands(unsigned int context) {
|
||||
|
||||
EMSESPShell::commands->add_command(context,
|
||||
CommandFlags::USER,
|
||||
flash_string_vector{F_(help)},
|
||||
string_vector{F_(help)},
|
||||
[](Shell & shell, const std::vector<std::string> & arguments __attribute__((unused))) {
|
||||
shell.print_all_available_commands();
|
||||
});
|
||||
|
||||
EMSESPShell::commands->add_command(context,
|
||||
CommandFlags::USER,
|
||||
flash_string_vector{F_(exit)},
|
||||
string_vector{F_(exit)},
|
||||
[=](Shell & shell, const std::vector<std::string> & arguments __attribute__((unused))) { shell.stop(); });
|
||||
|
||||
EMSESPShell::commands->add_command(context,
|
||||
CommandFlags::USER,
|
||||
flash_string_vector{F_(su)},
|
||||
string_vector{F_(su)},
|
||||
[=](Shell & shell, const std::vector<std::string> & arguments __attribute__((unused))) {
|
||||
auto become_admin = [](Shell & shell) {
|
||||
shell.logger().log(LogLevel::NOTICE, LogFacility::AUTH, F("su session opened on console"));
|
||||
shell.logger().log(LogLevel::NOTICE, LogFacility::AUTH, ("su session opened on console"));
|
||||
shell.add_flags(CommandFlags::ADMIN);
|
||||
};
|
||||
|
||||
@@ -537,8 +545,8 @@ void Console::load_standard_commands(unsigned int context) {
|
||||
become_admin(shell);
|
||||
} else {
|
||||
shell.delay_until(now + INVALID_PASSWORD_DELAY_MS, [](Shell & shell) {
|
||||
shell.logger().log(LogLevel::NOTICE, LogFacility::AUTH, F("Invalid su password on console"));
|
||||
shell.println(F("su: incorrect password"));
|
||||
shell.logger().log(LogLevel::NOTICE, LogFacility::AUTH, "Invalid su password on console");
|
||||
shell.println("su: incorrect password");
|
||||
});
|
||||
}
|
||||
});
|
||||
@@ -552,21 +560,21 @@ void Console::load_standard_commands(unsigned int context) {
|
||||
void Console::load_system_commands(unsigned int context) {
|
||||
EMSESPShell::commands->add_command(context,
|
||||
CommandFlags::ADMIN,
|
||||
flash_string_vector{F_(restart)},
|
||||
string_vector{F_(restart)},
|
||||
[](Shell & shell __attribute__((unused)), const std::vector<std::string> & arguments __attribute__((unused))) {
|
||||
EMSESP::system_.system_restart();
|
||||
});
|
||||
|
||||
EMSESPShell::commands->add_command(context,
|
||||
CommandFlags::ADMIN,
|
||||
flash_string_vector{F_(wifi), F_(reconnect)},
|
||||
string_vector{F_(wifi), F_(reconnect)},
|
||||
[](Shell & shell __attribute__((unused)), const std::vector<std::string> & arguments __attribute__((unused))) {
|
||||
EMSESP::system_.wifi_reconnect();
|
||||
});
|
||||
|
||||
EMSESPShell::commands->add_command(ShellContext::MAIN,
|
||||
CommandFlags::ADMIN,
|
||||
flash_string_vector{F_(format)},
|
||||
string_vector{F_(format)},
|
||||
[](Shell & shell, const std::vector<std::string> & arguments __attribute__((unused))) {
|
||||
shell.enter_password(F_(password_prompt), [=](Shell & shell, bool completed, const std::string & password) {
|
||||
if (completed) {
|
||||
@@ -574,7 +582,7 @@ void Console::load_system_commands(unsigned int context) {
|
||||
if (securitySettings.jwtSecret.equals(password.c_str())) {
|
||||
EMSESP::system_.format(shell);
|
||||
} else {
|
||||
shell.println(F("incorrect password"));
|
||||
shell.println("incorrect password");
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -583,7 +591,7 @@ void Console::load_system_commands(unsigned int context) {
|
||||
|
||||
EMSESPShell::commands->add_command(context,
|
||||
CommandFlags::ADMIN,
|
||||
flash_string_vector{F_(passwd)},
|
||||
string_vector{F_(passwd)},
|
||||
[](Shell & shell, const std::vector<std::string> & arguments __attribute__((unused))) {
|
||||
shell.enter_password(F_(new_password_prompt1), [](Shell & shell, bool completed, const std::string & password1) {
|
||||
if (completed) {
|
||||
@@ -597,9 +605,9 @@ void Console::load_system_commands(unsigned int context) {
|
||||
return StateUpdateResult::CHANGED;
|
||||
},
|
||||
"local");
|
||||
shell.println(F("su password updated"));
|
||||
shell.println("su password updated");
|
||||
} else {
|
||||
shell.println(F("Passwords do not match"));
|
||||
shell.println("Passwords do not match");
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -609,7 +617,7 @@ void Console::load_system_commands(unsigned int context) {
|
||||
|
||||
EMSESPShell::commands->add_command(context,
|
||||
CommandFlags::USER,
|
||||
flash_string_vector{F_(show), F_(system)},
|
||||
string_vector{F_(show), F_(system)},
|
||||
[=](Shell & shell, const std::vector<std::string> & arguments __attribute__((unused))) {
|
||||
EMSESP::system_.show_system(shell);
|
||||
shell.println();
|
||||
@@ -617,8 +625,8 @@ void Console::load_system_commands(unsigned int context) {
|
||||
|
||||
EMSESPShell::commands->add_command(context,
|
||||
CommandFlags::ADMIN,
|
||||
flash_string_vector{F_(set), F_(hostname)},
|
||||
flash_string_vector{F_(name_mandatory)},
|
||||
string_vector{F_(set), F_(hostname)},
|
||||
string_vector{F_(name_mandatory)},
|
||||
[](Shell & shell, const std::vector<std::string> & arguments) {
|
||||
shell.println("The network connection will be reset...");
|
||||
Shell::loop_all();
|
||||
@@ -633,8 +641,8 @@ void Console::load_system_commands(unsigned int context) {
|
||||
|
||||
EMSESPShell::commands->add_command(context,
|
||||
CommandFlags::ADMIN,
|
||||
flash_string_vector{F_(set), F_(wifi), F_(ssid)},
|
||||
flash_string_vector{F_(name_mandatory)},
|
||||
string_vector{F_(set), F_(wifi), F_(ssid)},
|
||||
string_vector{F_(name_mandatory)},
|
||||
[](Shell & shell, const std::vector<std::string> & arguments) {
|
||||
EMSESP::esp8266React.getNetworkSettingsService()->updateWithoutPropagation([&](NetworkSettings & networkSettings) {
|
||||
networkSettings.ssid = arguments.front().c_str();
|
||||
@@ -646,8 +654,8 @@ void Console::load_system_commands(unsigned int context) {
|
||||
// added by mvdp
|
||||
EMSESPShell::commands->add_command(context,
|
||||
CommandFlags::ADMIN,
|
||||
flash_string_vector{F("mqtt"), F("subscribe")},
|
||||
flash_string_vector{F("<topic>")},
|
||||
string_vector{("mqtt"), ("subscribe")},
|
||||
string_vector{("<topic>")},
|
||||
[](Shell & shell, const std::vector<std::string> & arguments) {
|
||||
Mqtt::subscribe(arguments.front());
|
||||
shell.println("subscribing");
|
||||
@@ -655,7 +663,7 @@ void Console::load_system_commands(unsigned int context) {
|
||||
|
||||
EMSESPShell::commands->add_command(context,
|
||||
CommandFlags::ADMIN,
|
||||
flash_string_vector{F_(set), F_(wifi), F_(password)},
|
||||
string_vector{F_(set), F_(wifi), F_(password)},
|
||||
[](Shell & shell, const std::vector<std::string> & arguments __attribute__((unused))) {
|
||||
shell.enter_password(F_(new_password_prompt1), [](Shell & shell, bool completed, const std::string & password1) {
|
||||
if (completed) {
|
||||
@@ -670,7 +678,7 @@ void Console::load_system_commands(unsigned int context) {
|
||||
});
|
||||
shell.println("Use `wifi reconnect` to save and apply the new settings");
|
||||
} else {
|
||||
shell.println(F("Passwords do not match"));
|
||||
shell.println("Passwords do not match");
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -680,13 +688,14 @@ void Console::load_system_commands(unsigned int context) {
|
||||
|
||||
EMSESPShell::commands->add_command(context,
|
||||
CommandFlags::ADMIN,
|
||||
flash_string_vector{F_(set), F_(board_profile)},
|
||||
flash_string_vector{F_(name_mandatory)},
|
||||
string_vector{F_(set), F_(board_profile)},
|
||||
string_vector{F_(name_mandatory)},
|
||||
[](Shell & shell, const std::vector<std::string> & arguments) {
|
||||
std::vector<int8_t> data; // led, dallas, rx, tx, button, phy_type, eth_power, eth_phy_addr, eth_clock_mode
|
||||
std::string board_profile = Helpers::toUpper(arguments.front());
|
||||
if (!EMSESP::system_.load_board_profile(data, board_profile)) {
|
||||
shell.println(F("Invalid board profile (S32, E32, MH-ET, NODEMCU, OLIMEX, OLIMEXPOE, CUSTOM)"));
|
||||
shell.println(
|
||||
"Invalid board profile (S32, E32, MH-ET, NODEMCU, OLIMEX, OLIMEXPOE, C3MINI, S2MINI, S3MINI, CUSTOM)");
|
||||
return;
|
||||
}
|
||||
EMSESP::webSettingsService.update(
|
||||
@@ -709,7 +718,7 @@ void Console::load_system_commands(unsigned int context) {
|
||||
});
|
||||
EMSESPShell::commands->add_command(context,
|
||||
CommandFlags::ADMIN,
|
||||
flash_string_vector{F_(show), F_(users)},
|
||||
string_vector{F_(show), F_(users)},
|
||||
[](Shell & shell, const std::vector<std::string> & arguments __attribute__((unused))) {
|
||||
EMSESP::system_.show_users(shell);
|
||||
});
|
||||
@@ -725,14 +734,14 @@ std::string EMSESPShell::prompt_suffix() {
|
||||
}
|
||||
|
||||
void EMSESPShell::end_of_transmission() {
|
||||
invoke_command(read_flash_string(F_(exit)));
|
||||
invoke_command(F_(exit));
|
||||
}
|
||||
|
||||
EMSESPStreamConsole::EMSESPStreamConsole(Stream & stream, bool local)
|
||||
: uuid::console::Shell(commands, ShellContext::MAIN, local ? (CommandFlags::USER | CommandFlags::LOCAL) : CommandFlags::USER)
|
||||
, uuid::console::StreamConsole(stream)
|
||||
, EMSESPShell()
|
||||
, name_(read_flash_string(F("Serial")))
|
||||
, name_("Serial")
|
||||
, pty_(SIZE_MAX)
|
||||
, addr_()
|
||||
, port_(0) {
|
||||
@@ -758,14 +767,14 @@ EMSESPStreamConsole::EMSESPStreamConsole(Stream & stream, const IPAddress & addr
|
||||
snprintf(text.data(), text.size(), "pty%u", (uint16_t)pty_);
|
||||
name_ = text.data();
|
||||
#ifndef EMSESP_STANDALONE
|
||||
logger().info(F("Allocated console %s for connection from [%s]:%u"), name_.c_str(), uuid::printable_to_string(addr_).c_str(), port_);
|
||||
logger().info("Allocated console %s for connection from [%s]:%u", name_.c_str(), uuid::printable_to_string(addr_).c_str(), port_);
|
||||
#endif
|
||||
}
|
||||
|
||||
EMSESPStreamConsole::~EMSESPStreamConsole() {
|
||||
if (pty_ != SIZE_MAX) {
|
||||
#ifndef EMSESP_STANDALONE
|
||||
logger().info(F("Shutdown console %s for connection from [%s]:%u"), name_.c_str(), uuid::printable_to_string(addr_).c_str(), port_);
|
||||
logger().info("Shutdown console %s for connection from [%s]:%u", name_.c_str(), uuid::printable_to_string(addr_).c_str(), port_);
|
||||
#endif
|
||||
ptys_[pty_] = false;
|
||||
ptys_.shrink_to_fit();
|
||||
|
||||
@@ -26,36 +26,8 @@
|
||||
#include "system.h"
|
||||
#include "mqtt.h"
|
||||
|
||||
using uuid::flash_string_vector;
|
||||
using uuid::read_flash_string;
|
||||
using uuid::console::Commands;
|
||||
using uuid::console::Shell;
|
||||
using uuid::log::Level;
|
||||
|
||||
#define LOG_DEBUG(...) logger_.debug(__VA_ARGS__)
|
||||
#define LOG_INFO(...) logger_.info(__VA_ARGS__)
|
||||
#define LOG_TRACE(...) logger_.trace(__VA_ARGS__)
|
||||
#define LOG_NOTICE(...) logger_.notice(__VA_ARGS__)
|
||||
#define LOG_WARNING(...) logger_.warning(__VA_ARGS__)
|
||||
#define LOG_ERROR(...) logger_.err(__VA_ARGS__)
|
||||
|
||||
// clang-format off
|
||||
// strings stored 32 bit aligned on ESP8266/ESP32
|
||||
#define MAKE_STR(string_name, string_literal) static constexpr const char * __str__##string_name = string_literal;
|
||||
#define MAKE_PSTR(string_name, string_literal) static const char __pstr__##string_name[] __attribute__((__aligned__(sizeof(uint32_t)))) PROGMEM = string_literal;
|
||||
#define MAKE_PSTR_WORD(string_name) MAKE_PSTR(string_name, #string_name)
|
||||
#define F_(string_name) FPSTR(__pstr__##string_name)
|
||||
#define FSTR_(string_name) __str__##string_name
|
||||
#define MAKE_PSTR_LIST(list_name, ...) static const __FlashStringHelper * const __pstr__##list_name[] PROGMEM = {__VA_ARGS__, nullptr};
|
||||
#define FL_(list_name) (__pstr__##list_name)
|
||||
// clang-format on
|
||||
|
||||
// localizations
|
||||
#include "locale_EN.h"
|
||||
|
||||
#ifdef LOCAL
|
||||
#undef LOCAL
|
||||
#endif
|
||||
|
||||
static constexpr uint32_t INVALID_PASSWORD_DELAY_MS = 2000;
|
||||
|
||||
@@ -64,19 +36,14 @@ namespace emsesp {
|
||||
using LogLevel = ::uuid::log::Level;
|
||||
using LogFacility = ::uuid::log::Facility;
|
||||
|
||||
enum CommandFlags : uint8_t {
|
||||
|
||||
USER = 0,
|
||||
ADMIN = (1 << 0),
|
||||
LOCAL = (1 << 1)
|
||||
|
||||
};
|
||||
#ifdef LOCAL
|
||||
#undef LOCAL
|
||||
#endif
|
||||
enum CommandFlags : uint8_t { USER = 0, ADMIN = (1 << 0), LOCAL = (1 << 1) };
|
||||
|
||||
enum ShellContext : uint8_t {
|
||||
|
||||
MAIN = 0,
|
||||
SYSTEM,
|
||||
|
||||
};
|
||||
|
||||
class EMSESPShell : virtual public uuid::console::Shell {
|
||||
|
||||
@@ -36,12 +36,13 @@ void DallasSensor::start() {
|
||||
reload();
|
||||
|
||||
if (!dallas_gpio_) {
|
||||
sensors_.clear();
|
||||
return; // disabled if dallas gpio is 0
|
||||
}
|
||||
|
||||
#ifndef EMSESP_STANDALONE
|
||||
bus_.begin(dallas_gpio_);
|
||||
LOG_INFO(F("Starting Dallas sensor service"));
|
||||
LOG_INFO("Starting Dallas sensor service");
|
||||
#endif
|
||||
|
||||
// Add API calls
|
||||
@@ -49,12 +50,18 @@ void DallasSensor::start() {
|
||||
EMSdevice::DeviceType::DALLASSENSOR,
|
||||
F_(info),
|
||||
[&](const char * value, const int8_t id, JsonObject & output) { return command_info(value, id, output); },
|
||||
F_(info_cmd));
|
||||
FL_(info_cmd));
|
||||
Command::add(
|
||||
EMSdevice::DeviceType::DALLASSENSOR,
|
||||
F_(values),
|
||||
[&](const char * value, const int8_t id, JsonObject & output) { return command_info(value, 0, output); },
|
||||
nullptr,
|
||||
CommandFlag::HIDDEN); // this command is hidden
|
||||
Command::add(
|
||||
EMSdevice::DeviceType::DALLASSENSOR,
|
||||
F_(commands),
|
||||
[&](const char * value, const int8_t id, JsonObject & output) { return command_commands(value, id, output); },
|
||||
F_(commands_cmd));
|
||||
FL_(commands_cmd));
|
||||
|
||||
Mqtt::subscribe(EMSdevice::DeviceType::DALLASSENSOR, "dallasssensor/#", nullptr); // use empty function callback
|
||||
}
|
||||
@@ -68,6 +75,7 @@ void DallasSensor::reload() {
|
||||
});
|
||||
|
||||
for (auto & sensor : sensors_) {
|
||||
remove_ha_topic(sensor.id());
|
||||
sensor.ha_registered = false; // force HA configs to be re-created
|
||||
}
|
||||
}
|
||||
@@ -83,7 +91,7 @@ void DallasSensor::loop() {
|
||||
if (state_ == State::IDLE) {
|
||||
if (time_now - last_activity_ >= READ_INTERVAL_MS) {
|
||||
#ifdef EMSESP_DEBUG_SENSOR
|
||||
LOG_DEBUG(F("[DEBUG] Read sensor temperature"));
|
||||
LOG_DEBUG("[DEBUG] Read sensor temperature");
|
||||
#endif
|
||||
if (bus_.reset() || parasite_) {
|
||||
YIELD;
|
||||
@@ -98,7 +106,7 @@ void DallasSensor::loop() {
|
||||
if (++scanretry_ > SCAN_MAX) { // every 30 sec
|
||||
scanretry_ = 0;
|
||||
#ifdef EMSESP_DEBUG_SENSOR
|
||||
LOG_ERROR(F("Bus reset failed"));
|
||||
LOG_ERROR("Bus reset failed");
|
||||
#endif
|
||||
for (auto & sensor : sensors_) {
|
||||
sensor.temperature_c = EMS_VALUE_SHORT_NOTSET;
|
||||
@@ -111,13 +119,13 @@ void DallasSensor::loop() {
|
||||
} else if (state_ == State::READING) {
|
||||
if (temperature_convert_complete() && (time_now - last_activity_ > CONVERSION_MS)) {
|
||||
#ifdef EMSESP_DEBUG_SENSOR
|
||||
LOG_DEBUG(F("Scanning for sensors"));
|
||||
LOG_DEBUG("Scanning for sensors");
|
||||
#endif
|
||||
bus_.reset_search();
|
||||
state_ = State::SCANNING;
|
||||
} else if (time_now - last_activity_ > READ_TIMEOUT_MS) {
|
||||
#ifdef EMSESP_DEBUG_SENSOR
|
||||
LOG_WARNING(F("Dallas sensor read timeout"));
|
||||
LOG_WARNING("Dallas sensor read timeout");
|
||||
#endif
|
||||
state_ = State::IDLE;
|
||||
sensorfails_++;
|
||||
@@ -125,7 +133,7 @@ void DallasSensor::loop() {
|
||||
} else if (state_ == State::SCANNING) {
|
||||
if (time_now - last_activity_ > SCAN_TIMEOUT_MS) {
|
||||
#ifdef EMSESP_DEBUG_SENSOR
|
||||
LOG_ERROR(F("Dallas sensor scan timeout"));
|
||||
LOG_ERROR("Dallas sensor scan timeout");
|
||||
#endif
|
||||
state_ = State::IDLE;
|
||||
sensorfails_++;
|
||||
@@ -152,23 +160,23 @@ void DallasSensor::loop() {
|
||||
if (sensor.internal_id() == get_id(addr)) {
|
||||
t += sensor.offset();
|
||||
if (t != sensor.temperature_c) {
|
||||
sensor.temperature_c = t;
|
||||
publish_sensor(sensor);
|
||||
changed_ |= true;
|
||||
}
|
||||
sensor.temperature_c = t;
|
||||
sensor.read = true;
|
||||
found = true;
|
||||
sensor.read = true;
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
// add new sensor. this will create the id string, empty name and offset
|
||||
if (!found && (sensors_.size() < (MAX_SENSORS - 1))) {
|
||||
sensors_.emplace_back(addr);
|
||||
sensors_.back().temperature_c = t + sensors_.back().offset();
|
||||
sensors_.back().read = true;
|
||||
changed_ = true;
|
||||
sensors_.back().read = true;
|
||||
changed_ = true;
|
||||
// look in the customization service for an optional alias or offset for that particular sensor
|
||||
sensors_.back().apply_customization();
|
||||
sensors_.back().temperature_c = t + sensors_.back().offset();
|
||||
publish_sensor(sensors_.back()); // call publish single
|
||||
// sort the sensors based on name
|
||||
// std::sort(sensors_.begin(), sensors_.end(), [](const Sensor & a, const Sensor & b) { return a.name() < b.name(); });
|
||||
@@ -180,12 +188,12 @@ void DallasSensor::loop() {
|
||||
|
||||
default:
|
||||
sensorfails_++;
|
||||
LOG_ERROR(F("Unknown dallas sensor %s"), Sensor(addr).id().c_str());
|
||||
LOG_ERROR("Unknown dallas sensor %s", Sensor(addr).id().c_str());
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
sensorfails_++;
|
||||
LOG_ERROR(F("Invalid dallas sensor %s"), Sensor(addr).id().c_str());
|
||||
LOG_ERROR("Invalid dallas sensor %s", Sensor(addr).id().c_str());
|
||||
}
|
||||
} else {
|
||||
if (!parasite_) {
|
||||
@@ -203,7 +211,7 @@ void DallasSensor::loop() {
|
||||
scancnt_ = 0;
|
||||
} else if (scancnt_ == SCAN_START + 1) { // startup
|
||||
firstscan_ = sensors_.size();
|
||||
// LOG_DEBUG(F("Adding %d dallas sensor(s) from first scan"), firstscan_);
|
||||
// LOG_DEBUG("Adding %d dallas sensor(s) from first scan", firstscan_);
|
||||
} else if ((scancnt_ <= 0) && (firstscan_ != sensors_.size())) { // check 2 times for no change of sensor #
|
||||
scancnt_ = SCAN_START;
|
||||
sensors_.clear(); // restart scaning and clear to get correct numbering
|
||||
@@ -229,7 +237,7 @@ bool DallasSensor::temperature_convert_complete() {
|
||||
int16_t DallasSensor::get_temperature_c(const uint8_t addr[]) {
|
||||
#ifndef EMSESP_STANDALONE
|
||||
if (!bus_.reset()) {
|
||||
LOG_ERROR(F("Bus reset failed before reading scratchpad from %s"), Sensor(addr).id().c_str());
|
||||
LOG_ERROR("Bus reset failed before reading scratchpad from %s", Sensor(addr).id().c_str());
|
||||
return EMS_VALUE_SHORT_NOTSET;
|
||||
}
|
||||
YIELD;
|
||||
@@ -241,13 +249,13 @@ int16_t DallasSensor::get_temperature_c(const uint8_t addr[]) {
|
||||
YIELD;
|
||||
|
||||
if (!bus_.reset()) {
|
||||
LOG_ERROR(F("Bus reset failed after reading scratchpad from %s"), Sensor(addr).id().c_str());
|
||||
LOG_ERROR("Bus reset failed after reading scratchpad from %s", Sensor(addr).id().c_str());
|
||||
return EMS_VALUE_SHORT_NOTSET;
|
||||
}
|
||||
YIELD;
|
||||
|
||||
if (bus_.crc8(scratchpad, SCRATCHPAD_LEN - 1) != scratchpad[SCRATCHPAD_LEN - 1]) {
|
||||
LOG_WARNING(F("Invalid scratchpad CRC: %02X%02X%02X%02X%02X%02X%02X%02X%02X from sensor %s"),
|
||||
LOG_WARNING("Invalid scratchpad CRC: %02X%02X%02X%02X%02X%02X%02X%02X%02X from sensor %s",
|
||||
scratchpad[0],
|
||||
scratchpad[1],
|
||||
scratchpad[2],
|
||||
@@ -314,7 +322,7 @@ bool DallasSensor::update(const std::string & id, const std::string & name, int1
|
||||
SensorCustomization.name = name;
|
||||
SensorCustomization.offset = offset;
|
||||
found = true;
|
||||
LOG_DEBUG(F("Customizing existing sensor ID %s"), id.c_str());
|
||||
LOG_DEBUG("Customizing existing sensor ID %s", id.c_str());
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -324,7 +332,7 @@ bool DallasSensor::update(const std::string & id, const std::string & name, int1
|
||||
newSensor.name = name;
|
||||
newSensor.offset = offset;
|
||||
settings.sensorCustomizations.push_back(newSensor);
|
||||
LOG_DEBUG(F("Adding new customization for sensor ID %s"), id.c_str());
|
||||
LOG_DEBUG("Adding new customization for sensor ID %s", id.c_str());
|
||||
}
|
||||
sensor.ha_registered = false; // it's changed so we may need to recreate the HA config
|
||||
return StateUpdateResult::CHANGED;
|
||||
@@ -359,14 +367,19 @@ bool DallasSensor::command_info(const char * value, const int8_t id, JsonObject
|
||||
}
|
||||
|
||||
for (const auto & sensor : sensors_) {
|
||||
if (id == -1) { // show number and id
|
||||
char val[10];
|
||||
if (id == -1) { // show number and id, info command
|
||||
JsonObject dataSensor = output.createNestedObject(sensor.name());
|
||||
dataSensor["id"] = sensor.id();
|
||||
dataSensor["uom"] = EMSdevice::uom_to_string(DeviceValueUOM::DEGREES);
|
||||
dataSensor["type"] = F_(number);
|
||||
if (Helpers::hasValue(sensor.temperature_c)) {
|
||||
dataSensor["temp"] = Helpers::round2((float)(sensor.temperature_c), 10, EMSESP::system_.fahrenheit() ? 2 : 0);
|
||||
dataSensor["temp"] = serialized(Helpers::render_value(val, sensor.temperature_c, 10, EMSESP::system_.fahrenheit() ? 2 : 0));
|
||||
}
|
||||
} else if (id == 0 && Helpers::hasValue(sensor.temperature_c)) { // values command
|
||||
output[sensor.name()] = serialized(Helpers::render_value(val, sensor.temperature_c, 10, EMSESP::system_.fahrenheit() ? 2 : 0));
|
||||
} else if (Helpers::hasValue(sensor.temperature_c)) {
|
||||
output[sensor.name()] = Helpers::round2((float)(sensor.temperature_c), 10, EMSESP::system_.fahrenheit() ? 2 : 0);
|
||||
output[sensor.id()] = serialized(Helpers::render_value(val, sensor.temperature_c, 10, EMSESP::system_.fahrenheit() ? 2 : 0));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -375,6 +388,9 @@ bool DallasSensor::command_info(const char * value, const int8_t id, JsonObject
|
||||
|
||||
// called from emsesp.cpp, similar to the emsdevice->get_value_info
|
||||
bool DallasSensor::get_value_info(JsonObject & output, const char * cmd, const int8_t id) {
|
||||
if (sensors_.empty()) {
|
||||
return false;
|
||||
}
|
||||
// make a copy of the string command for parsing
|
||||
char command_s[30];
|
||||
strlcpy(command_s, cmd, sizeof(command_s));
|
||||
@@ -388,17 +404,18 @@ bool DallasSensor::get_value_info(JsonObject & output, const char * cmd, const i
|
||||
}
|
||||
|
||||
for (const auto & sensor : sensors_) {
|
||||
if (strcmp(command_s, sensor.name().c_str()) == 0) {
|
||||
if (strcmp(command_s, sensor.name().c_str()) == 0 || strcmp(command_s, sensor.id().c_str()) == 0) {
|
||||
output["id"] = sensor.id();
|
||||
output["name"] = sensor.name();
|
||||
char val[10];
|
||||
if (Helpers::hasValue(sensor.temperature_c)) {
|
||||
output["value"] = Helpers::round2((float)(sensor.temperature_c), 10, EMSESP::system_.fahrenheit() ? 2 : 0);
|
||||
output["value"] = serialized(Helpers::render_value(val, sensor.temperature_c, 10, EMSESP::system_.fahrenheit() ? 2 : 0));
|
||||
}
|
||||
|
||||
output["type"] = F_(number);
|
||||
output["min"] = Helpers::round2(-55, 0, EMSESP::system_.fahrenheit() ? 2 : 0);
|
||||
output["max"] = Helpers::round2(125, 0, EMSESP::system_.fahrenheit() ? 2 : 0);
|
||||
output["uom"] = EMSdevice::uom_to_string(DeviceValueUOM::DEGREES);
|
||||
output["writeable"] = false;
|
||||
|
||||
// if we're filtering on an attribute, go find it
|
||||
if (attribute_s) {
|
||||
if (output.containsKey(attribute_s)) {
|
||||
@@ -425,9 +442,9 @@ void DallasSensor::publish_sensor(const Sensor & sensor) {
|
||||
if (Mqtt::publish_single()) {
|
||||
char topic[Mqtt::MQTT_TOPIC_MAX_SIZE];
|
||||
if (Mqtt::publish_single2cmd()) {
|
||||
snprintf(topic, sizeof(topic), "%s/%s", read_flash_string(F_(dallassensor)).c_str(), sensor.name().c_str());
|
||||
snprintf(topic, sizeof(topic), "%s/%s", (F_(dallassensor)), sensor.name().c_str());
|
||||
} else {
|
||||
snprintf(topic, sizeof(topic), "%s%s/%s", read_flash_string(F_(dallassensor)).c_str(), "_data", sensor.name().c_str());
|
||||
snprintf(topic, sizeof(topic), "%s%s/%s", (F_(dallassensor)), "_data", sensor.name().c_str());
|
||||
}
|
||||
char payload[10];
|
||||
Mqtt::publish(topic, Helpers::render_value(payload, sensor.temperature_c, 10, EMSESP::system_.fahrenheit() ? 2 : 0));
|
||||
@@ -440,13 +457,13 @@ void DallasSensor::remove_ha_topic(const std::string & id) {
|
||||
return;
|
||||
}
|
||||
#ifdef EMSESP_DEBUG
|
||||
LOG_DEBUG(F("Removing HA config for temperature sensor ID %s"), id.c_str());
|
||||
LOG_DEBUG("Removing HA config for temperature sensor ID %s", id.c_str());
|
||||
#endif
|
||||
// use '_' as HA doesn't like '-' in the topic name
|
||||
std::string sensorid = id;
|
||||
std::replace(sensorid.begin(), sensorid.end(), '-', '_');
|
||||
char topic[Mqtt::MQTT_TOPIC_MAX_SIZE];
|
||||
snprintf(topic, sizeof(topic), "sensor/%s/dallassensor_%s/config", Mqtt::base().c_str(), sensorid.c_str());
|
||||
snprintf(topic, sizeof(topic), "sensor/%s/dallassensor_%s/config", Mqtt::basename().c_str(), sensorid.c_str());
|
||||
Mqtt::publish_ha(topic);
|
||||
}
|
||||
|
||||
@@ -468,57 +485,66 @@ void DallasSensor::publish_values(const bool force) {
|
||||
|
||||
for (auto & sensor : sensors_) {
|
||||
bool has_value = Helpers::hasValue(sensor.temperature_c);
|
||||
if (Mqtt::is_nested() || Mqtt::ha_enabled()) {
|
||||
char val[10];
|
||||
if (Mqtt::is_nested()) {
|
||||
JsonObject dataSensor = doc.createNestedObject(sensor.id());
|
||||
dataSensor["name"] = sensor.name();
|
||||
if (has_value) {
|
||||
dataSensor["temp"] = Helpers::round2((float)(sensor.temperature_c), 10, EMSESP::system_.fahrenheit() ? 2 : 0);
|
||||
dataSensor["temp"] = serialized(Helpers::render_value(val, sensor.temperature_c, 10, EMSESP::system_.fahrenheit() ? 2 : 0));
|
||||
}
|
||||
} else if (has_value) {
|
||||
doc[sensor.name()] = Helpers::round2((float)(sensor.temperature_c), 10, EMSESP::system_.fahrenheit() ? 2 : 0);
|
||||
doc[sensor.name()] = serialized(Helpers::render_value(val, sensor.temperature_c, 10, EMSESP::system_.fahrenheit() ? 2 : 0));
|
||||
}
|
||||
|
||||
// create the HA MQTT config
|
||||
// to e.g. homeassistant/sensor/ems-esp/dallassensor_28-233D-9497-0C03/config
|
||||
if (Mqtt::ha_enabled()) {
|
||||
if (!sensor.ha_registered || force) {
|
||||
LOG_DEBUG(F("Recreating HA config for sensor ID %s"), sensor.id().c_str());
|
||||
if (!has_value && sensor.ha_registered) {
|
||||
remove_ha_topic(sensor.id());
|
||||
sensor.ha_registered = false;
|
||||
} else if (!sensor.ha_registered || force) {
|
||||
LOG_DEBUG("Recreating HA config for sensor ID %s", sensor.id().c_str());
|
||||
|
||||
StaticJsonDocument<EMSESP_JSON_SIZE_MEDIUM> config;
|
||||
config["dev_cla"] = FJSON("temperature");
|
||||
config["dev_cla"] = "temperature";
|
||||
|
||||
char stat_t[50];
|
||||
snprintf(stat_t, sizeof(stat_t), "%s/dallassensor_data", Mqtt::base().c_str());
|
||||
snprintf(stat_t, sizeof(stat_t), "%s/dallassensor_data", Mqtt::base().c_str()); // use base path
|
||||
config["stat_t"] = stat_t;
|
||||
|
||||
config["unit_of_meas"] = EMSdevice::uom_to_string(DeviceValueUOM::DEGREES);
|
||||
|
||||
char str[50];
|
||||
snprintf(str, sizeof(str), "{{value_json['%s'].temp}}", sensor.id().c_str());
|
||||
if (Mqtt::is_nested()) {
|
||||
snprintf(str, sizeof(str), "{{value_json['%s'].temp}}", sensor.id().c_str());
|
||||
} else {
|
||||
snprintf(str, sizeof(str), "{{value_json['%s']}}", sensor.name().c_str());
|
||||
}
|
||||
config["val_tpl"] = str;
|
||||
|
||||
snprintf(str, sizeof(str), "temperature_sensor_%s", sensor.name().c_str());
|
||||
config["object_id"] = str;
|
||||
char uniq_s[70];
|
||||
if (Mqtt::entity_format() == 2) {
|
||||
snprintf(uniq_s, sizeof(uniq_s), "%s_dallassensor_%s", Mqtt::basename().c_str(), sensor.id().c_str());
|
||||
} else {
|
||||
snprintf(uniq_s, sizeof(uniq_s), "dallassensor_%s", sensor.id().c_str());
|
||||
}
|
||||
|
||||
config["object_id"] = uniq_s;
|
||||
config["uniq_id"] = uniq_s; // same as object_id
|
||||
|
||||
snprintf(str, sizeof(str), "%s", sensor.name().c_str());
|
||||
config["name"] = str;
|
||||
|
||||
snprintf(str, sizeof(str), "dallasensor_%s", sensor.id().c_str());
|
||||
config["uniq_id"] = str;
|
||||
|
||||
JsonObject dev = config.createNestedObject("dev");
|
||||
dev["name"] = FJSON("EMS-ESP Dallas"); // Global name for device (all Dallas sensors, avoids using the very first name for the group)
|
||||
dev["mf"] = FJSON("Dallas"); // Manufacturer (avoids the ugly <unknown> in HA)
|
||||
dev["mdl"] = FJSON("1Wire"); // Model (avoids the ugly <unknown> in HA)
|
||||
JsonArray ids = dev.createNestedArray("ids");
|
||||
ids.add("ems-esp-dallas"); // Different ids as the other portions of the EMS-ESP
|
||||
ids.add("ems-esp");
|
||||
|
||||
char topic[Mqtt::MQTT_TOPIC_MAX_SIZE];
|
||||
// use '_' as HA doesn't like '-' in the topic name
|
||||
std::string sensorid = sensor.id();
|
||||
std::replace(sensorid.begin(), sensorid.end(), '-', '_');
|
||||
|
||||
snprintf(topic, sizeof(topic), "sensor/%s/dallassensor_%s/config", Mqtt::base().c_str(), sensorid.c_str());
|
||||
snprintf(topic, sizeof(topic), "sensor/%s/dallassensor_%s/config", Mqtt::basename().c_str(), sensorid.c_str());
|
||||
|
||||
Mqtt::publish_ha(topic, config.as<JsonObject>());
|
||||
|
||||
@@ -527,7 +553,7 @@ void DallasSensor::publish_values(const bool force) {
|
||||
}
|
||||
}
|
||||
|
||||
Mqtt::publish(F("dallassensor_data"), doc.as<JsonObject>());
|
||||
Mqtt::publish("dallassensor_data", doc.as<JsonObject>());
|
||||
}
|
||||
|
||||
|
||||
@@ -571,7 +597,7 @@ bool DallasSensor::Sensor::apply_customization() {
|
||||
if (!sensors.empty()) {
|
||||
for (const auto & sensor : sensors) {
|
||||
#if defined(EMSESP_DEBUG)
|
||||
LOG_DEBUG(F("Loading customization for dallas sensor %s"), sensor.id.c_str());
|
||||
LOG_DEBUG("Loading customization for dallas sensor %s", sensor.id.c_str());
|
||||
#endif
|
||||
if (id_ == sensor.id) {
|
||||
set_name(sensor.name);
|
||||
@@ -604,4 +630,4 @@ void DallasSensor::test() {
|
||||
}
|
||||
#endif
|
||||
|
||||
} // namespace emsesp
|
||||
} // namespace emsesp
|
||||
@@ -57,7 +57,7 @@ class DallasSensor {
|
||||
|
||||
std::string name() const;
|
||||
void set_name(const std::string & name) {
|
||||
name_ = name;
|
||||
name_ = name;
|
||||
}
|
||||
|
||||
bool apply_customization();
|
||||
|
||||
@@ -15,11 +15,20 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef EMSESP_DEFAULT_SETTINGS_H
|
||||
#define EMSESP_DEFAULT_SETTINGS_H
|
||||
|
||||
// GENERAL SETTINGS
|
||||
|
||||
#ifndef EMSESP_DEFAULT_LOCALE
|
||||
#define EMSESP_DEFAULT_LOCALE EMSESP_LOCALE_EN // English
|
||||
#endif
|
||||
|
||||
#ifndef EMSESP_DEFAULT_VERSION
|
||||
#define EMSESP_DEFAULT_VERSION ""
|
||||
#endif
|
||||
|
||||
#ifndef EMSESP_DEFAULT_TX_MODE
|
||||
#define EMSESP_DEFAULT_TX_MODE 1 // EMS1.0
|
||||
#endif
|
||||
@@ -123,7 +132,7 @@
|
||||
#endif
|
||||
|
||||
#ifndef EMSESP_DEFAULT_PHY_TYPE
|
||||
#define EMSESP_DEFAULT_PHY_TYPE 0 // No Ethernet, just Wifi
|
||||
#define EMSESP_DEFAULT_PHY_TYPE 0 // No Ethernet, just Wifi. PHY_type::PHY_TYPE_NONE,
|
||||
#endif
|
||||
|
||||
// MQTT
|
||||
@@ -148,6 +157,10 @@
|
||||
#define EMSESP_DEFAULT_PUBLISH_TIME 10
|
||||
#endif
|
||||
|
||||
#ifndef EMSESP_DEFAULT_PUBLISH_HEARTBEAT
|
||||
#define EMSESP_DEFAULT_PUBLISH_HEARTBEAT 60
|
||||
#endif
|
||||
|
||||
#ifndef EMSESP_DEFAULT_NESTED_FORMAT
|
||||
#define EMSESP_DEFAULT_NESTED_FORMAT 1
|
||||
#endif
|
||||
@@ -196,24 +209,39 @@
|
||||
#define EMSESP_DEFAULT_WEBLOG_COMPACT true
|
||||
#endif
|
||||
|
||||
#ifndef EMSESP_DEFAULT_ENTITY_FORMAT
|
||||
#define EMSESP_DEFAULT_ENTITY_FORMAT 1 // in MQTT discovery, use shortnames and not multiple (prefixed with base)
|
||||
#endif
|
||||
|
||||
// matches Web UI settings
|
||||
enum {
|
||||
|
||||
BOOL_FORMAT_ONOFF_STR = 1,
|
||||
BOOL_FORMAT_ONOFF_STR_CAP,
|
||||
BOOL_FORMAT_TRUEFALSE_STR,
|
||||
BOOL_FORMAT_TRUEFALSE,
|
||||
BOOL_FORMAT_10_STR,
|
||||
BOOL_FORMAT_10
|
||||
BOOL_FORMAT_ONOFF_STR = 1, // 1
|
||||
BOOL_FORMAT_ONOFF_STR_CAP, // 2
|
||||
BOOL_FORMAT_TRUEFALSE_STR, // 3
|
||||
BOOL_FORMAT_TRUEFALSE, // 4
|
||||
BOOL_FORMAT_10_STR, // 5
|
||||
BOOL_FORMAT_10 // 6
|
||||
|
||||
};
|
||||
|
||||
enum {
|
||||
|
||||
ENUM_FORMAT_VALUE = 1,
|
||||
ENUM_FORMAT_INDEX // 2
|
||||
ENUM_FORMAT_VALUE = 1, // 1
|
||||
ENUM_FORMAT_INDEX // 2
|
||||
|
||||
};
|
||||
|
||||
#if CONFIG_IDF_TARGET_ESP32C3
|
||||
#define EMSESP_PLATFORM "ESP32-C3";
|
||||
#elif CONFIG_IDF_TARGET_ESP32S2
|
||||
#define EMSESP_PLATFORM "ESP32-S2";
|
||||
#elif CONFIG_IDF_TARGET_ESP32S3
|
||||
#define EMSESP_PLATFORM "ESP32-S3";
|
||||
#elif CONFIG_IDF_TARGET_ESP32 || EMSESP_STANDALONE
|
||||
#define EMSESP_PLATFORM "ESP32";
|
||||
#else
|
||||
#error Target CONFIG_IDF_TARGET is not supported
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
@@ -24,139 +24,155 @@
|
||||
*/
|
||||
|
||||
// Boilers - 0x08
|
||||
{ 64, DeviceType::BOILER, F("BK13/BK15/Smartline/GB1x2"), DeviceFlags::EMS_DEVICE_FLAG_NONE},
|
||||
{ 72, DeviceType::BOILER, F("GB125/MC10"), DeviceFlags::EMS_DEVICE_FLAG_EMS},
|
||||
{ 81, DeviceType::BOILER, F("Cascade CM10"), DeviceFlags::EMS_DEVICE_FLAG_NONE},
|
||||
{ 84, DeviceType::BOILER, F("Logamax Plus GB022"), DeviceFlags::EMS_DEVICE_FLAG_NONE},
|
||||
{ 95, DeviceType::BOILER, F("Condens 2500/Logamax/Logomatic/Cerapur Top/Greenstar/Generic HT3"), DeviceFlags::EMS_DEVICE_FLAG_HT3},
|
||||
{115, DeviceType::BOILER, F("Topline/GB162"), DeviceFlags::EMS_DEVICE_FLAG_NONE},
|
||||
{122, DeviceType::BOILER, F("Proline"), DeviceFlags::EMS_DEVICE_FLAG_NONE},
|
||||
{123, DeviceType::BOILER, F("GBx72/Trendline/Cerapur/Greenstar Si/27i"), DeviceFlags::EMS_DEVICE_FLAG_NONE},
|
||||
{131, DeviceType::BOILER, F("GB212"), DeviceFlags::EMS_DEVICE_FLAG_NONE},
|
||||
{132, DeviceType::BOILER, F("GC7000F"), DeviceFlags::EMS_DEVICE_FLAG_NONE},
|
||||
{133, DeviceType::BOILER, F("Logano GB125/KB195i/Logamatic MC110"), DeviceFlags::EMS_DEVICE_FLAG_NONE},
|
||||
{167, DeviceType::BOILER, F("Cerapur Aero"), DeviceFlags::EMS_DEVICE_FLAG_NONE},
|
||||
{168, DeviceType::BOILER, F("Hybrid Heatpump"), DeviceFlags::EMS_DEVICE_FLAG_HYBRID},
|
||||
{170, DeviceType::BOILER, F("Logano GB212"), DeviceFlags::EMS_DEVICE_FLAG_NONE},
|
||||
{172, DeviceType::BOILER, F("Enviline/Compress 6000AW/Hybrid 7000iAW/SupraEco/Geo 5xx"), DeviceFlags::EMS_DEVICE_FLAG_HEATPUMP},
|
||||
{173, DeviceType::BOILER, F("Geo 5xx"), DeviceFlags::EMS_DEVICE_FLAG_HEATPUMP},
|
||||
{195, DeviceType::BOILER, F("Condens 5000i/Greenstar 8000"), DeviceFlags::EMS_DEVICE_FLAG_NONE},
|
||||
{203, DeviceType::BOILER, F("Logamax U122/Cerapur"), DeviceFlags::EMS_DEVICE_FLAG_NONE},
|
||||
{206, DeviceType::BOILER, F("Ecomline Excellent"), DeviceFlags::EMS_DEVICE_FLAG_NONE},
|
||||
{208, DeviceType::BOILER, F("Logamax Plus/GB192/Condens GC9000"), DeviceFlags::EMS_DEVICE_FLAG_NONE},
|
||||
{210, DeviceType::BOILER, F("Cascade MC400"), DeviceFlags::EMS_DEVICE_FLAG_NONE},
|
||||
{211, DeviceType::BOILER, F("EasyControl Adapter"), DeviceFlags::EMS_DEVICE_FLAG_NONE},
|
||||
{228, DeviceType::BOILER, F("Alternative Heatsource"), DeviceFlags::EMS_DEVICE_FLAG_AM200},
|
||||
{234, DeviceType::BOILER, F("Logamax Plus GB122/Condense 2300"), DeviceFlags::EMS_DEVICE_FLAG_NONE},
|
||||
{ 64, DeviceType::BOILER, "BK13/BK15/Smartline/GB1x2", DeviceFlags::EMS_DEVICE_FLAG_NONE},
|
||||
{ 72, DeviceType::BOILER, "GB125/GB135/MC10", DeviceFlags::EMS_DEVICE_FLAG_EMS},
|
||||
{ 81, DeviceType::BOILER, "Cascade CM10", DeviceFlags::EMS_DEVICE_FLAG_NONE},
|
||||
{ 84, DeviceType::BOILER, "Logamax Plus GB022", DeviceFlags::EMS_DEVICE_FLAG_NONE},
|
||||
{ 95, DeviceType::BOILER, "Condens 2500/Logamax/Logomatic/Cerapur Top/Greenstar/Generic HT3", DeviceFlags::EMS_DEVICE_FLAG_HT3},
|
||||
{115, DeviceType::BOILER, "Topline/GB162", DeviceFlags::EMS_DEVICE_FLAG_NONE},
|
||||
{121, DeviceType::BOILER, "Cascade MCM10", DeviceFlags::EMS_DEVICE_FLAG_NONE},
|
||||
{122, DeviceType::BOILER, "Proline", DeviceFlags::EMS_DEVICE_FLAG_NONE},
|
||||
{123, DeviceType::BOILER, "GBx72/Trendline/Cerapur/Greenstar Si/27i-30i", DeviceFlags::EMS_DEVICE_FLAG_NONE},
|
||||
{131, DeviceType::BOILER, "GB212", DeviceFlags::EMS_DEVICE_FLAG_NONE},
|
||||
{132, DeviceType::BOILER, "GC7000F", DeviceFlags::EMS_DEVICE_FLAG_NONE},
|
||||
{133, DeviceType::BOILER, "Logano GB125/KB195i/Logamatic MC110", DeviceFlags::EMS_DEVICE_FLAG_NONE},
|
||||
{154, DeviceType::BOILER, "Greenstar 30Ri Compact", DeviceFlags::EMS_DEVICE_FLAG_NONE},
|
||||
{167, DeviceType::BOILER, "Cerapur Aero", DeviceFlags::EMS_DEVICE_FLAG_NONE},
|
||||
{168, DeviceType::BOILER, "Hybrid Heatpump", DeviceFlags::EMS_DEVICE_FLAG_HYBRID},
|
||||
{170, DeviceType::BOILER, "Logano GB212", DeviceFlags::EMS_DEVICE_FLAG_NONE},
|
||||
{172, DeviceType::BOILER, "Enviline/Compress 6000AW/Hybrid 3000-7000iAW/SupraEco/Geo 5xx/WLW196i/WSW196i", DeviceFlags::EMS_DEVICE_FLAG_HEATPUMP},
|
||||
{173, DeviceType::BOILER, "Geo 5xx", DeviceFlags::EMS_DEVICE_FLAG_HEATPUMP},
|
||||
{195, DeviceType::BOILER, "Condens 5000i/Greenstar 8000/GC9800IW", DeviceFlags::EMS_DEVICE_FLAG_NONE},
|
||||
{203, DeviceType::BOILER, "Logamax U122/Cerapur", DeviceFlags::EMS_DEVICE_FLAG_NONE},
|
||||
{206, DeviceType::BOILER, "Ecomline Excellent", DeviceFlags::EMS_DEVICE_FLAG_NONE},
|
||||
{208, DeviceType::BOILER, "Logamax Plus/GB192/Condens GC9000/Greenstar ErP", DeviceFlags::EMS_DEVICE_FLAG_NONE},
|
||||
{210, DeviceType::BOILER, "Cascade MC400", DeviceFlags::EMS_DEVICE_FLAG_NONE},
|
||||
{211, DeviceType::BOILER, "EasyControl Adapter", DeviceFlags::EMS_DEVICE_FLAG_NONE},
|
||||
{234, DeviceType::BOILER, "Logamax Plus GB122/Condense 2300", DeviceFlags::EMS_DEVICE_FLAG_NONE},
|
||||
|
||||
// Controllers - 0x09 / 0x10 / 0x50
|
||||
{ 68, DeviceType::CONTROLLER, F("BC10/RFM20"), DeviceFlags::EMS_DEVICE_FLAG_NONE}, // 0x09
|
||||
{ 81, DeviceType::CONTROLLER, F("CM10"), DeviceFlags::EMS_DEVICE_FLAG_NONE},
|
||||
{ 84, DeviceType::CONTROLLER, F("GB022"), DeviceFlags::EMS_DEVICE_FLAG_NONE},
|
||||
{ 89, DeviceType::CONTROLLER, F("BC10 GB142"), DeviceFlags::EMS_DEVICE_FLAG_NONE}, // 0x09
|
||||
{ 95, DeviceType::CONTROLLER, F("HT3"), DeviceFlags::EMS_DEVICE_FLAG_NONE}, // 0x09
|
||||
{114, DeviceType::CONTROLLER, F("BC10"), DeviceFlags::EMS_DEVICE_FLAG_NONE}, // 0x09
|
||||
{125, DeviceType::CONTROLLER, F("BC25"), DeviceFlags::EMS_DEVICE_FLAG_NONE}, // 0x09
|
||||
{152, DeviceType::CONTROLLER, F("Controller"), DeviceFlags::EMS_DEVICE_FLAG_NONE}, // 0x09
|
||||
{168, DeviceType::CONTROLLER, F("Hybrid Heatpump"), DeviceFlags::EMS_DEVICE_FLAG_NONE}, // 0x09
|
||||
{169, DeviceType::CONTROLLER, F("BC40"), DeviceFlags::EMS_DEVICE_FLAG_NONE}, // 0x09
|
||||
{190, DeviceType::CONTROLLER, F("BC10"), DeviceFlags::EMS_DEVICE_FLAG_NONE}, // 0x09
|
||||
{194, DeviceType::CONTROLLER, F("BC10"), DeviceFlags::EMS_DEVICE_FLAG_NONE}, // 0x09
|
||||
{206, DeviceType::CONTROLLER, F("Ecomline"), DeviceFlags::EMS_DEVICE_FLAG_NONE}, // 0x09
|
||||
{207, DeviceType::CONTROLLER, F("Sense II/CS200"), DeviceFlags::EMS_DEVICE_FLAG_NONE}, // 0x10
|
||||
{209, DeviceType::CONTROLLER, F("ErP"), DeviceFlags::EMS_DEVICE_FLAG_NONE}, // 0x09
|
||||
{218, DeviceType::CONTROLLER, F("M200/RFM200"), DeviceFlags::EMS_DEVICE_FLAG_NONE}, // 0x50
|
||||
{224, DeviceType::CONTROLLER, F("9000i"), DeviceFlags::EMS_DEVICE_FLAG_NONE}, // 0x09
|
||||
{229, DeviceType::CONTROLLER, F("8700i"), DeviceFlags::EMS_DEVICE_FLAG_NONE}, // 0x09
|
||||
{230, DeviceType::CONTROLLER, F("BC Base"), DeviceFlags::EMS_DEVICE_FLAG_NONE}, // 0x09
|
||||
{240, DeviceType::CONTROLLER, F("Rego 3000"), DeviceFlags::EMS_DEVICE_FLAG_IVT}, // 0x09
|
||||
{241, DeviceType::CONTROLLER, F("Condens 5000i"), DeviceFlags::EMS_DEVICE_FLAG_NONE}, // 0x09
|
||||
{ 68, DeviceType::CONTROLLER, "BC10/RFM20", DeviceFlags::EMS_DEVICE_FLAG_NONE}, // 0x09
|
||||
{ 81, DeviceType::CONTROLLER, "CM10", DeviceFlags::EMS_DEVICE_FLAG_NONE},
|
||||
{ 84, DeviceType::CONTROLLER, "GB022", DeviceFlags::EMS_DEVICE_FLAG_NONE},
|
||||
{ 89, DeviceType::CONTROLLER, "BC10 GB142", DeviceFlags::EMS_DEVICE_FLAG_NONE}, // 0x09
|
||||
{ 95, DeviceType::CONTROLLER, "HT3", DeviceFlags::EMS_DEVICE_FLAG_NONE}, // 0x09
|
||||
{114, DeviceType::CONTROLLER, "BC10", DeviceFlags::EMS_DEVICE_FLAG_NONE}, // 0x09
|
||||
{121, DeviceType::CONTROLLER, "MCM10", DeviceFlags::EMS_DEVICE_FLAG_NONE},
|
||||
{125, DeviceType::CONTROLLER, "BC25", DeviceFlags::EMS_DEVICE_FLAG_NONE}, // 0x09
|
||||
{152, DeviceType::CONTROLLER, "Controller", DeviceFlags::EMS_DEVICE_FLAG_NONE}, // 0x09
|
||||
{168, DeviceType::CONTROLLER, "Hybrid Heatpump", DeviceFlags::EMS_DEVICE_FLAG_NONE}, // 0x09
|
||||
{169, DeviceType::CONTROLLER, "BC40", DeviceFlags::EMS_DEVICE_FLAG_NONE}, // 0x09
|
||||
{190, DeviceType::CONTROLLER, "BC10", DeviceFlags::EMS_DEVICE_FLAG_NONE}, // 0x09
|
||||
{194, DeviceType::CONTROLLER, "BC10", DeviceFlags::EMS_DEVICE_FLAG_NONE}, // 0x09
|
||||
{206, DeviceType::CONTROLLER, "Ecomline", DeviceFlags::EMS_DEVICE_FLAG_NONE}, // 0x09
|
||||
{207, DeviceType::CONTROLLER, "Sense II/CS200", DeviceFlags::EMS_DEVICE_FLAG_NONE}, // 0x10
|
||||
{209, DeviceType::CONTROLLER, "ErP", DeviceFlags::EMS_DEVICE_FLAG_NONE}, // 0x09
|
||||
{218, DeviceType::CONTROLLER, "M200/RFM200", DeviceFlags::EMS_DEVICE_FLAG_NONE}, // 0x50
|
||||
{220, DeviceType::CONTROLLER, "BC30", DeviceFlags::EMS_DEVICE_FLAG_NONE}, // 0x16
|
||||
{224, DeviceType::CONTROLLER, "9000i", DeviceFlags::EMS_DEVICE_FLAG_NONE}, // 0x09
|
||||
{229, DeviceType::CONTROLLER, "8700i", DeviceFlags::EMS_DEVICE_FLAG_NONE}, // 0x09
|
||||
{230, DeviceType::CONTROLLER, "BC Base", DeviceFlags::EMS_DEVICE_FLAG_NONE}, // 0x09
|
||||
{240, DeviceType::CONTROLLER, "Rego 3000", DeviceFlags::EMS_DEVICE_FLAG_IVT}, // 0x09
|
||||
{241, DeviceType::CONTROLLER, "Condens 5000i", DeviceFlags::EMS_DEVICE_FLAG_NONE}, // 0x09
|
||||
|
||||
// Thermostat - not currently supporting write operations, like the Easy/100 types - 0x18
|
||||
{202, DeviceType::THERMOSTAT, F("Logamatic TC100/Moduline Easy"), DeviceFlags::EMS_DEVICE_FLAG_EASY | DeviceFlags::EMS_DEVICE_FLAG_NO_WRITE}, // 0x18, cannot write
|
||||
{203, DeviceType::THERMOSTAT, F("EasyControl CT200"), DeviceFlags::EMS_DEVICE_FLAG_EASY | DeviceFlags::EMS_DEVICE_FLAG_NO_WRITE}, // 0x18, cannot write
|
||||
{202, DeviceType::THERMOSTAT, "Logamatic TC100/Moduline Easy", DeviceFlags::EMS_DEVICE_FLAG_EASY | DeviceFlags::EMS_DEVICE_FLAG_NO_WRITE}, // 0x18, cannot write
|
||||
{203, DeviceType::THERMOSTAT, "EasyControl CT200", DeviceFlags::EMS_DEVICE_FLAG_EASY | DeviceFlags::EMS_DEVICE_FLAG_NO_WRITE}, // 0x18, cannot write
|
||||
|
||||
// Thermostat - Buderus/Nefit/Bosch specific - 0x17 / 0x10 / 0x18 / 0x19-0x1B for hc2-4 / 0x38
|
||||
{ 65, DeviceType::THERMOSTAT, F("RC10"), DeviceFlags::EMS_DEVICE_FLAG_RC20_N},// 0x17
|
||||
{ 67, DeviceType::THERMOSTAT, F("RC30"), DeviceFlags::EMS_DEVICE_FLAG_RC30_N},// 0x10 - based on RC35
|
||||
{ 77, DeviceType::THERMOSTAT, F("RC20/Moduline 300"), DeviceFlags::EMS_DEVICE_FLAG_RC20},// 0x17
|
||||
{ 78, DeviceType::THERMOSTAT, F("Moduline 400"), DeviceFlags::EMS_DEVICE_FLAG_RC30}, // 0x10
|
||||
{ 79, DeviceType::THERMOSTAT, F("RC10/Moduline 100"), DeviceFlags::EMS_DEVICE_FLAG_RC10},// 0x17
|
||||
{ 80, DeviceType::THERMOSTAT, F("Moduline 200"), DeviceFlags::EMS_DEVICE_FLAG_RC10}, // 0x17
|
||||
{ 86, DeviceType::THERMOSTAT, F("RC35"), DeviceFlags::EMS_DEVICE_FLAG_RC35}, // 0x10
|
||||
{ 90, DeviceType::THERMOSTAT, F("RC10/Moduline 100"), DeviceFlags::EMS_DEVICE_FLAG_RC20_N}, // 0x17
|
||||
{ 93, DeviceType::THERMOSTAT, F("RC20RF"), DeviceFlags::EMS_DEVICE_FLAG_RC20}, // 0x19
|
||||
{ 94, DeviceType::THERMOSTAT, F("RFM20 Remote"), DeviceFlags::EMS_DEVICE_FLAG_NONE}, // 0x18
|
||||
{151, DeviceType::THERMOSTAT, F("RC25"), DeviceFlags::EMS_DEVICE_FLAG_RC25}, // 0x17
|
||||
{157, DeviceType::THERMOSTAT, F("RC200/CW100"), DeviceFlags::EMS_DEVICE_FLAG_RC100}, // 0x18
|
||||
{158, DeviceType::THERMOSTAT, F("RC300/RC310/Moduline 3000/1010H/CW400/Sense II"), DeviceFlags::EMS_DEVICE_FLAG_RC300}, // 0x10
|
||||
{165, DeviceType::THERMOSTAT, F("RC100/Moduline 1000/1010"), DeviceFlags::EMS_DEVICE_FLAG_RC100}, // 0x18, 0x38
|
||||
{172, DeviceType::THERMOSTAT, F("Rego 2000/3000"), DeviceFlags::EMS_DEVICE_FLAG_RC300}, // 0x10
|
||||
{216, DeviceType::THERMOSTAT, F("CRF200S"), DeviceFlags::EMS_DEVICE_FLAG_CRF | DeviceFlags::EMS_DEVICE_FLAG_NO_WRITE}, // 0x18
|
||||
{246, DeviceType::THERMOSTAT, F("Comfort+2RF"), DeviceFlags::EMS_DEVICE_FLAG_CRF | DeviceFlags::EMS_DEVICE_FLAG_NO_WRITE}, // 0x18
|
||||
{ 4, DeviceType::THERMOSTAT, "UI800", DeviceFlags::EMS_DEVICE_FLAG_RC300}, // 0x10
|
||||
{ 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
|
||||
{ 78, DeviceType::THERMOSTAT, "Moduline 400", DeviceFlags::EMS_DEVICE_FLAG_RC30}, // 0x10
|
||||
{ 79, DeviceType::THERMOSTAT, "RC10/Moduline 100", DeviceFlags::EMS_DEVICE_FLAG_RC10},// 0x17
|
||||
{ 80, DeviceType::THERMOSTAT, "Moduline 200", DeviceFlags::EMS_DEVICE_FLAG_RC10}, // 0x17
|
||||
{ 86, DeviceType::THERMOSTAT, "RC35", DeviceFlags::EMS_DEVICE_FLAG_RC35}, // 0x10
|
||||
{ 90, DeviceType::THERMOSTAT, "RC10/Moduline 100", DeviceFlags::EMS_DEVICE_FLAG_RC20_N}, // 0x17
|
||||
{ 93, DeviceType::THERMOSTAT, "RC20RF", DeviceFlags::EMS_DEVICE_FLAG_RC20}, // 0x19
|
||||
{ 94, DeviceType::THERMOSTAT, "RFM20 Remote", DeviceFlags::EMS_DEVICE_FLAG_NONE}, // 0x18
|
||||
{151, DeviceType::THERMOSTAT, "RC25", DeviceFlags::EMS_DEVICE_FLAG_RC25}, // 0x17
|
||||
{157, DeviceType::THERMOSTAT, "RC200/CW100", DeviceFlags::EMS_DEVICE_FLAG_RC100}, // 0x18
|
||||
{158, DeviceType::THERMOSTAT, "RC300/RC310/Moduline 3000/1010H/CW400/Sense II/HPC410", DeviceFlags::EMS_DEVICE_FLAG_RC300}, // 0x10
|
||||
{165, DeviceType::THERMOSTAT, "RC100/Moduline 1000/1010", DeviceFlags::EMS_DEVICE_FLAG_RC100}, // 0x18, 0x38
|
||||
{172, DeviceType::THERMOSTAT, "Rego 2000/3000", DeviceFlags::EMS_DEVICE_FLAG_RC300}, // 0x10
|
||||
{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", DeviceFlags::EMS_DEVICE_FLAG_RC300}, // 0x10
|
||||
|
||||
// Thermostat - Sieger - 0x10 / 0x17
|
||||
{ 66, DeviceType::THERMOSTAT, F("ES72/RC20"), DeviceFlags::EMS_DEVICE_FLAG_RC20_N}, // 0x17 or remote
|
||||
{ 76, DeviceType::THERMOSTAT, F("ES73"), DeviceFlags::EMS_DEVICE_FLAG_RC30_N}, // 0x10
|
||||
{113, DeviceType::THERMOSTAT, F("ES72/RC20"), DeviceFlags::EMS_DEVICE_FLAG_RC20_N}, // 0x17
|
||||
{ 66, DeviceType::THERMOSTAT, "ES72/RC20", DeviceFlags::EMS_DEVICE_FLAG_RC20_N}, // 0x17 or remote
|
||||
{ 76, DeviceType::THERMOSTAT, "ES73", DeviceFlags::EMS_DEVICE_FLAG_RC30_N}, // 0x10
|
||||
{113, DeviceType::THERMOSTAT, "ES72/RC20", DeviceFlags::EMS_DEVICE_FLAG_RC20_N}, // 0x17
|
||||
|
||||
// Thermostat - Junkers - 0x10
|
||||
{105, DeviceType::THERMOSTAT, F("FW100"), DeviceFlags::EMS_DEVICE_FLAG_JUNKERS},
|
||||
{106, DeviceType::THERMOSTAT, F("FW200"), DeviceFlags::EMS_DEVICE_FLAG_JUNKERS},
|
||||
{107, DeviceType::THERMOSTAT, F("FR100"), DeviceFlags::EMS_DEVICE_FLAG_JUNKERS | DeviceFlags::EMS_DEVICE_FLAG_JUNKERS_OLD}, // older model
|
||||
{108, DeviceType::THERMOSTAT, F("FR110"), DeviceFlags::EMS_DEVICE_FLAG_JUNKERS | DeviceFlags::EMS_DEVICE_FLAG_JUNKERS_OLD}, // older model
|
||||
{109, DeviceType::THERMOSTAT, F("FB10"), DeviceFlags::EMS_DEVICE_FLAG_JUNKERS},
|
||||
{110, DeviceType::THERMOSTAT, F("FB100"), DeviceFlags::EMS_DEVICE_FLAG_JUNKERS},
|
||||
{111, DeviceType::THERMOSTAT, F("FR10"), DeviceFlags::EMS_DEVICE_FLAG_JUNKERS | DeviceFlags::EMS_DEVICE_FLAG_JUNKERS_OLD}, // older model
|
||||
{147, DeviceType::THERMOSTAT, F("FR50"), DeviceFlags::EMS_DEVICE_FLAG_JUNKERS | DeviceFlags::EMS_DEVICE_FLAG_JUNKERS_OLD},
|
||||
{191, DeviceType::THERMOSTAT, F("FR120"), DeviceFlags::EMS_DEVICE_FLAG_JUNKERS | DeviceFlags::EMS_DEVICE_FLAG_JUNKERS_OLD}, // older model
|
||||
{192, DeviceType::THERMOSTAT, F("FW120"), DeviceFlags::EMS_DEVICE_FLAG_JUNKERS},
|
||||
{105, DeviceType::THERMOSTAT, "FW100", DeviceFlags::EMS_DEVICE_FLAG_JUNKERS},
|
||||
{106, DeviceType::THERMOSTAT, "FW200", DeviceFlags::EMS_DEVICE_FLAG_JUNKERS},
|
||||
{107, DeviceType::THERMOSTAT, "FR100", DeviceFlags::EMS_DEVICE_FLAG_JUNKERS | DeviceFlags::EMS_DEVICE_FLAG_JUNKERS_OLD}, // older model
|
||||
{108, DeviceType::THERMOSTAT, "FR110", DeviceFlags::EMS_DEVICE_FLAG_JUNKERS | DeviceFlags::EMS_DEVICE_FLAG_JUNKERS_OLD}, // older model
|
||||
{109, DeviceType::THERMOSTAT, "FB10", DeviceFlags::EMS_DEVICE_FLAG_JUNKERS},
|
||||
{110, DeviceType::THERMOSTAT, "FB100", DeviceFlags::EMS_DEVICE_FLAG_JUNKERS},
|
||||
{111, DeviceType::THERMOSTAT, "FR10", DeviceFlags::EMS_DEVICE_FLAG_JUNKERS | DeviceFlags::EMS_DEVICE_FLAG_JUNKERS_OLD}, // older model
|
||||
{116, DeviceType::THERMOSTAT, "FW500", DeviceFlags::EMS_DEVICE_FLAG_JUNKERS},
|
||||
{147, DeviceType::THERMOSTAT, "FR50", DeviceFlags::EMS_DEVICE_FLAG_JUNKERS | DeviceFlags::EMS_DEVICE_FLAG_JUNKERS_OLD},
|
||||
{191, DeviceType::THERMOSTAT, "FR120", DeviceFlags::EMS_DEVICE_FLAG_JUNKERS | DeviceFlags::EMS_DEVICE_FLAG_JUNKERS_OLD}, // older model
|
||||
{192, DeviceType::THERMOSTAT, "FW120", DeviceFlags::EMS_DEVICE_FLAG_JUNKERS},
|
||||
|
||||
// Thermostat remote - 0x38
|
||||
{200, DeviceType::THERMOSTAT, F("RC100H"), DeviceFlags::EMS_DEVICE_FLAG_RC100H},
|
||||
{ 3, DeviceType::THERMOSTAT, "RT800", DeviceFlags::EMS_DEVICE_FLAG_RC100H},
|
||||
{200, DeviceType::THERMOSTAT, "RC100H", DeviceFlags::EMS_DEVICE_FLAG_RC100H},
|
||||
{249, DeviceType::THERMOSTAT, "TR120RF", DeviceFlags::EMS_DEVICE_FLAG_RC100H},
|
||||
|
||||
// Solar Modules - 0x30 (for solar), 0x2A, 0x41 (for ww)
|
||||
{ 73, DeviceType::SOLAR, F("SM10"), DeviceFlags::EMS_DEVICE_FLAG_SM10},
|
||||
{101, DeviceType::SOLAR, F("ISM1"), DeviceFlags::EMS_DEVICE_FLAG_ISM},
|
||||
{103, DeviceType::SOLAR, F("ISM2"), DeviceFlags::EMS_DEVICE_FLAG_ISM},
|
||||
{162, DeviceType::SOLAR, F("SM50"), DeviceFlags::EMS_DEVICE_FLAG_SM100},
|
||||
{163, DeviceType::SOLAR, F("SM100/MS100"), DeviceFlags::EMS_DEVICE_FLAG_SM100},
|
||||
{164, DeviceType::SOLAR, F("SM200/MS200"), DeviceFlags::EMS_DEVICE_FLAG_SM100},
|
||||
{ 73, DeviceType::SOLAR, "SM10", DeviceFlags::EMS_DEVICE_FLAG_SM10},
|
||||
{101, DeviceType::SOLAR, "ISM1", DeviceFlags::EMS_DEVICE_FLAG_ISM},
|
||||
{103, DeviceType::SOLAR, "ISM2", DeviceFlags::EMS_DEVICE_FLAG_ISM},
|
||||
{162, DeviceType::SOLAR, "SM50", DeviceFlags::EMS_DEVICE_FLAG_SM100},
|
||||
{163, DeviceType::SOLAR, "SM100/MS100", DeviceFlags::EMS_DEVICE_FLAG_SM100},
|
||||
{164, DeviceType::SOLAR, "SM200/MS200", DeviceFlags::EMS_DEVICE_FLAG_SM100},
|
||||
|
||||
// Mixer Modules - 0x20-0x27 for HC, 0x28-0x29 for WWC and 0x11 for the MP100
|
||||
{ 69, DeviceType::MIXER, F("MM10"), DeviceFlags::EMS_DEVICE_FLAG_MM10},
|
||||
{100, DeviceType::MIXER, F("IPM"), DeviceFlags::EMS_DEVICE_FLAG_IPM},
|
||||
{102, DeviceType::MIXER, F("IPM"), DeviceFlags::EMS_DEVICE_FLAG_IPM},
|
||||
{159, DeviceType::MIXER, F("MM50"), DeviceFlags::EMS_DEVICE_FLAG_MMPLUS},
|
||||
{160, DeviceType::MIXER, F("MM100"), DeviceFlags::EMS_DEVICE_FLAG_MMPLUS},
|
||||
{161, DeviceType::MIXER, F("MM200"), DeviceFlags::EMS_DEVICE_FLAG_MMPLUS},
|
||||
{204, DeviceType::MIXER, F("MP100"), DeviceFlags::EMS_DEVICE_FLAG_MP}, // pool
|
||||
{ 69, DeviceType::MIXER, "MM10", DeviceFlags::EMS_DEVICE_FLAG_MM10},
|
||||
{100, DeviceType::MIXER, "IPM", DeviceFlags::EMS_DEVICE_FLAG_IPM},
|
||||
{102, DeviceType::MIXER, "IPM", DeviceFlags::EMS_DEVICE_FLAG_IPM},
|
||||
{159, DeviceType::MIXER, "MM50", DeviceFlags::EMS_DEVICE_FLAG_MMPLUS},
|
||||
{160, DeviceType::MIXER, "MM100", DeviceFlags::EMS_DEVICE_FLAG_MMPLUS},
|
||||
{161, DeviceType::MIXER, "MM200", DeviceFlags::EMS_DEVICE_FLAG_MMPLUS},
|
||||
{193, DeviceType::MIXER, "MZ100", DeviceFlags::EMS_DEVICE_FLAG_MMPLUS},
|
||||
{204, DeviceType::MIXER, "MP100", DeviceFlags::EMS_DEVICE_FLAG_MP}, // pool
|
||||
|
||||
// Heat Pumps - 0x38?
|
||||
{252, DeviceType::HEATPUMP, F("HP Module"), DeviceFlags::EMS_DEVICE_FLAG_NONE},
|
||||
// Heat Pumps - 0x38? This is a thermostat like RC100H
|
||||
// also prod-id of wifi module and wireless base
|
||||
{252, DeviceType::HEATPUMP, "HP Module", DeviceFlags::EMS_DEVICE_FLAG_NONE},
|
||||
|
||||
// Heat Pumps - 0x53
|
||||
{248, DeviceType::HEATPUMP, F("Hybrid Manager HM200"), DeviceFlags::EMS_DEVICE_FLAG_NONE},
|
||||
{248, DeviceType::HEATPUMP, "Hybrid Manager HM200", DeviceFlags::EMS_DEVICE_FLAG_NONE},
|
||||
|
||||
// Heatsource - 0x60
|
||||
{228, DeviceType::HEATSOURCE, "AM200", DeviceFlags::EMS_DEVICE_FLAG_NONE}, // alternative heatsource
|
||||
|
||||
// Connect devices - 0x02
|
||||
{171, DeviceType::CONNECT, F("OpenTherm Converter"), DeviceFlags::EMS_DEVICE_FLAG_NONE},
|
||||
{205, DeviceType::CONNECT, F("Moduline Easy Connect"), DeviceFlags::EMS_DEVICE_FLAG_NONE},
|
||||
{206, DeviceType::CONNECT, F("Easy Connect"), DeviceFlags::EMS_DEVICE_FLAG_NONE},
|
||||
{171, DeviceType::CONNECT, "OpenTherm Converter", DeviceFlags::EMS_DEVICE_FLAG_NONE},
|
||||
{205, DeviceType::CONNECT, "Moduline Easy Connect", DeviceFlags::EMS_DEVICE_FLAG_NONE},
|
||||
{206, DeviceType::CONNECT, "Easy Connect", DeviceFlags::EMS_DEVICE_FLAG_NONE},
|
||||
|
||||
// Wireless sensor base - 0x50
|
||||
{236, DeviceType::CONNECT, F("Wireless sensor base"), DeviceFlags::EMS_DEVICE_FLAG_NONE},
|
||||
{238, DeviceType::CONNECT, F("Wireless sensor base"), DeviceFlags::EMS_DEVICE_FLAG_NONE},
|
||||
{236, DeviceType::CONNECT, "Wireless sensor base", DeviceFlags::EMS_DEVICE_FLAG_NONE},
|
||||
{238, DeviceType::CONNECT, "Wireless sensor base", DeviceFlags::EMS_DEVICE_FLAG_NONE},
|
||||
|
||||
// Switches - 0x11
|
||||
{ 71, DeviceType::SWITCH, F("WM10"), DeviceFlags::EMS_DEVICE_FLAG_NONE},
|
||||
{ 71, DeviceType::SWITCH, "WM10", DeviceFlags::EMS_DEVICE_FLAG_NONE},
|
||||
|
||||
// PM10 Pump module - 0x15
|
||||
{ 243, DeviceType::PUMP, "PM10", DeviceFlags::EMS_DEVICE_FLAG_NONE},
|
||||
|
||||
// EM10 error contact and analog flowtemp control- 0x12
|
||||
{ 74, DeviceType::GATEWAY, F("Error Module EM10"), DeviceFlags::EMS_DEVICE_FLAG_NONE},
|
||||
{ 74, DeviceType::ALERT, "EM10", DeviceFlags::EMS_DEVICE_FLAG_NONE},
|
||||
|
||||
// Gateways - 0x48
|
||||
{189, DeviceType::GATEWAY, F("KM200/MB LAN 2"), DeviceFlags::EMS_DEVICE_FLAG_NONE},
|
||||
{189, DeviceType::GATEWAY, "KM200/MB LAN 2", DeviceFlags::EMS_DEVICE_FLAG_NONE},
|
||||
|
||||
// Generic - 0x40 or other with no product-id and no version
|
||||
{0, DeviceType::GENERIC, F("unknown"), DeviceFlags::EMS_DEVICE_FLAG_NONE}
|
||||
{0, DeviceType::GENERIC, "unknown", DeviceFlags::EMS_DEVICE_FLAG_NONE}
|
||||
|
||||
// clang-format on
|
||||
|
||||
29
src/devices/alert.cpp
Normal file
29
src/devices/alert.cpp
Normal file
@@ -0,0 +1,29 @@
|
||||
/*
|
||||
* EMS-ESP - https://github.com/emsesp/EMS-ESP
|
||||
* Copyright 2020 Paul Derbyshire
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "alert.h"
|
||||
|
||||
namespace emsesp {
|
||||
|
||||
REGISTER_FACTORY(Alert, EMSdevice::DeviceType::ALERT);
|
||||
|
||||
Alert::Alert(uint8_t device_type, uint8_t device_id, uint8_t product_id, const char * version, const char * name, uint8_t flags, uint8_t brand)
|
||||
: EMSdevice(device_type, device_id, product_id, version, name, flags, brand) {
|
||||
}
|
||||
|
||||
} // namespace emsesp
|
||||
33
src/devices/alert.h
Normal file
33
src/devices/alert.h
Normal file
@@ -0,0 +1,33 @@
|
||||
/*
|
||||
* EMS-ESP - https://github.com/emsesp/EMS-ESP
|
||||
* Copyright 2020 Paul Derbyshire
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef EMSESP_ALERT_H
|
||||
#define EMSESP_ALERT_H
|
||||
|
||||
#include "emsesp.h"
|
||||
|
||||
namespace emsesp {
|
||||
|
||||
class Alert : public EMSdevice {
|
||||
public:
|
||||
Alert(uint8_t device_type, uint8_t device_id, uint8_t product_id, const char * version, const char * name, uint8_t flags, uint8_t brand);
|
||||
};
|
||||
|
||||
} // namespace emsesp
|
||||
|
||||
#endif
|
||||
File diff suppressed because it is too large
Load Diff
@@ -25,7 +25,7 @@ namespace emsesp {
|
||||
|
||||
class Boiler : public EMSdevice {
|
||||
public:
|
||||
Boiler(uint8_t device_type, int8_t device_id, uint8_t product_id, const char * version, const std::string & name, uint8_t flags, uint8_t brand);
|
||||
Boiler(uint8_t device_type, int8_t device_id, uint8_t product_id, const char * version, const char * name, uint8_t flags, uint8_t brand);
|
||||
|
||||
private:
|
||||
static uuid::log::Logger logger_;
|
||||
@@ -64,7 +64,7 @@ class Boiler : public EMSdevice {
|
||||
uint8_t wwChargeOptimization_; // DHW charge optimization
|
||||
uint8_t wwDisinfectionTemp_; // DHW disinfection temperature to prevent infection
|
||||
uint8_t wwCircMode_; // DHW circulation pump mode
|
||||
uint8_t wwCirc_; // Circulation on/off
|
||||
uint8_t wwCirc_; // DHW circulation on/off
|
||||
uint16_t wwCurTemp_; // DHW current temperature
|
||||
uint16_t wwCurTemp2_; // DHW current temperature storage
|
||||
uint8_t wwCurFlow_; // DHW current flow temp in l/min
|
||||
@@ -90,6 +90,10 @@ class Boiler : public EMSdevice {
|
||||
uint8_t wwTapActivated_; // maintenance-mode to switch DHW off
|
||||
uint16_t wwMixerTemp_; // mixing temperature
|
||||
uint16_t wwCylMiddleTemp_; // Cyl middle temperature (TS3)
|
||||
uint16_t wwSolarTemp_;
|
||||
uint8_t wwAlternatingOper_; // alternating operation on/off
|
||||
uint8_t wwAltOpPrioHeat_; // alternating operation, prioritise heat time
|
||||
uint8_t wwAltOpPrioWw_; // alternating operation, prioritise dhw time
|
||||
|
||||
// main
|
||||
uint8_t reset_; // for reset command
|
||||
@@ -97,7 +101,7 @@ class Boiler : public EMSdevice {
|
||||
uint8_t tapwaterActive_; // Hot tap water is on/off
|
||||
uint8_t selFlowTemp_; // Selected flow temperature
|
||||
uint8_t selBurnPow_; // Burner max power % (can be > 100%)
|
||||
uint8_t heatingPump2Mod_; // heatpump modulation from 0xE3 (heatpumps)
|
||||
uint8_t absBurnPow_; // absolute burner power in % of rating plate
|
||||
uint8_t heatingPumpMod_; // Pump modulation %
|
||||
int16_t outdoorTemp_; // Outside temperature
|
||||
uint16_t curFlowTemp_; // Current flow temperature
|
||||
@@ -117,16 +121,20 @@ class Boiler : public EMSdevice {
|
||||
uint8_t heatingTemp_; // Heating temperature setting on the boiler
|
||||
uint8_t pumpModMax_; // Boiler circuit pump modulation max. power %
|
||||
uint8_t pumpModMin_; // Boiler circuit pump modulation min. power
|
||||
uint8_t pumpMode_; // pump setting proportional/deltaP
|
||||
uint8_t pumpDelay_;
|
||||
uint8_t burnMinPeriod_;
|
||||
uint8_t burnMinPower_;
|
||||
uint8_t burnMaxPower_;
|
||||
int8_t boilHystOn_;
|
||||
int8_t boilHystOff_;
|
||||
int8_t boil2HystOn_;
|
||||
int8_t boil2HystOff_;
|
||||
uint8_t setFlowTemp_; // boiler setpoint temp
|
||||
uint8_t curBurnPow_; // Burner current power %
|
||||
uint8_t setBurnPow_; // max output power in %
|
||||
uint32_t burnStarts_; // burner restarts
|
||||
uint32_t heatStarts_; // burner starts for heating
|
||||
uint32_t burnWorkMin_; // Total burner operating time
|
||||
uint32_t burn2WorkMin_; // burner stage 2 operating time
|
||||
uint32_t heatWorkMin_; // Total heat operating time
|
||||
@@ -175,8 +183,6 @@ class Boiler : public EMSdevice {
|
||||
uint8_t hpCircSpd_;
|
||||
uint16_t hpBrineIn_;
|
||||
uint16_t hpBrineOut_;
|
||||
uint16_t hpSuctionGas_;
|
||||
uint16_t hpHotGas_;
|
||||
uint8_t hpSwitchValve_;
|
||||
uint8_t hpActivity_;
|
||||
uint8_t hpHeatingOn_;
|
||||
@@ -186,6 +192,7 @@ class Boiler : public EMSdevice {
|
||||
int16_t hpTc0_;
|
||||
int16_t hpTc1_;
|
||||
int16_t hpTc3_;
|
||||
int16_t hpTr1_;
|
||||
int16_t hpTr3_;
|
||||
int16_t hpTr4_;
|
||||
int16_t hpTr5_;
|
||||
@@ -198,44 +205,58 @@ class Boiler : public EMSdevice {
|
||||
// Pool unit
|
||||
int8_t poolSetTemp_;
|
||||
|
||||
// Alternative Heatsource AM200
|
||||
int16_t cylTopTemp_; // TB1
|
||||
int16_t cylCenterTemp_; // TB2
|
||||
int16_t cylBottomTemp_; // TB3
|
||||
int16_t aFlowTemp_; // TA1
|
||||
int16_t aRetTemp_; // TR1
|
||||
uint8_t aPumpMod_; // PR1 - percent
|
||||
// uint8_t valveByPass_; // VR2
|
||||
uint8_t valveBuffer_; // VB1
|
||||
uint8_t valveReturn_; // VR1
|
||||
// uint8_t heatSource_; // OEV
|
||||
// Settings:
|
||||
uint8_t vr2Config_; // pos 12: off(00)/Keelbypass(01)/(hc1pump(02) only standalone)
|
||||
uint8_t ahsActivated_; // pos 00: Alternate heat source activation: No(00),Yes(01)
|
||||
uint8_t aPumpConfig_; // pos 04: Buffer primary pump->Config pump: No(00),Yes(01)
|
||||
uint8_t aPumpSignal_; // pos 03: Output for PR1 pump: On/Off(00),PWM(01),PWM invers(02)
|
||||
uint8_t aPumpMin_; // pos 21: Min output pump PR1 (%)
|
||||
uint8_t tempRise_; // pos 01: AHS return temp rise: No(00),Yes(01) (mixer VR1)
|
||||
uint8_t setReturnTemp_; // pos 06: Set temp return (°C) (VR1)
|
||||
uint16_t mixRuntime_; // pos 10/11?: Mixer run time (s) (VR1)
|
||||
// uint8_t setFlowTemp_; // pos 07: Set flow temp AHS (°C) (Buffer)
|
||||
uint8_t bufBypass_; // pos 02: Puffer bypass: No(00), Mischer(01), Ventil(02) (Buffer)
|
||||
uint16_t bufMixRuntime_; // pos 8/9: Bypass mixer run time: [time] (s) (Buffer)
|
||||
uint8_t bufConfig_; // pos 20: Konfig WW-Speicher Monovalent(01), Bivalent(02) (buffer)
|
||||
uint8_t blockMode_; // pos 16: Config htg. blocking mode: No(00),Automatic(01),Always block02) (blocking)
|
||||
uint8_t blockTerm_; // pos 17: Config of block terminal: NO(00), NC(01)
|
||||
int8_t blockHyst_; // pos 14?: Hyst. for bolier block (K)
|
||||
uint8_t releaseWait_; // pos 15: Boiler release wait time (min)
|
||||
// Inputs
|
||||
struct {
|
||||
uint8_t state;
|
||||
char option[12]; // logic, block_comp, block_dhw, block_heat, block_cool, overheat_protect, evu_blocktime1,2,3, block_heater, Solar
|
||||
} hpInput[4];
|
||||
|
||||
// Heater limits
|
||||
uint8_t maxHeatComp_;
|
||||
uint8_t maxHeatHeat_;
|
||||
uint8_t maxHeatDhw_;
|
||||
|
||||
uint8_t pvCooling_;
|
||||
uint8_t manDefrost_;
|
||||
uint8_t auxHeatMode_;
|
||||
uint8_t auxMaxLimit_;
|
||||
uint8_t auxLimitStart_;
|
||||
uint8_t auxHeaterOnly_;
|
||||
uint8_t auxHeaterOff_;
|
||||
uint8_t auxHeaterStatus_;
|
||||
uint16_t auxHeaterDelay_;
|
||||
uint8_t silentMode_;
|
||||
int8_t minTempSilent_;
|
||||
uint8_t silentFrom_;
|
||||
uint8_t silentTo_;
|
||||
int8_t tempParMode_;
|
||||
int8_t auxHeatMixValve_;
|
||||
uint16_t hpHystHeat_;
|
||||
uint16_t hpHystCool_;
|
||||
uint16_t hpHystPool_;
|
||||
uint8_t tempDiffHeat_;
|
||||
uint8_t tempDiffCool_;
|
||||
uint8_t hpCircPumpWw_;
|
||||
|
||||
uint8_t wwComfOffTemp_;
|
||||
uint8_t wwEcoOffTemp_;
|
||||
uint8_t wwEcoPlusOffTemp_;
|
||||
|
||||
uint8_t vp_cooling_;
|
||||
uint8_t heatCable_;
|
||||
uint8_t VC0valve_;
|
||||
uint8_t primePump_;
|
||||
uint8_t primePumpMod_;
|
||||
uint8_t hp3wayValve_;
|
||||
uint8_t elHeatStep1_;
|
||||
uint8_t elHeatStep2_;
|
||||
uint8_t elHeatStep3_;
|
||||
|
||||
/*
|
||||
* Hybrid heatpump with telegram 0xBB is readable and writeable in boiler and thermostat
|
||||
* thermostat always overwrites settings in boiler
|
||||
* enable settings here if no thermostat is used in system
|
||||
*
|
||||
// HybridHP
|
||||
// Hybrid heatpump with telegram 0xBB is readable and writeable in boiler and thermostat
|
||||
// thermostat always overwrites settings in boiler
|
||||
//enable settings here if no thermostat is used in system
|
||||
// HybridHP
|
||||
uint8_t hybridStrategy_; // cost = 2, temperature = 3, mix = 4
|
||||
int8_t switchOverTemp_; // degrees
|
||||
uint8_t energyCostRatio_; // is *10
|
||||
@@ -243,7 +264,7 @@ class Boiler : public EMSdevice {
|
||||
uint8_t electricFactor_; // is * 10
|
||||
uint8_t delayBoiler_; // minutes
|
||||
uint8_t tempDiffBoiler_; // relative temperature degrees
|
||||
*/
|
||||
*/
|
||||
|
||||
void process_UBAParameterWW(std::shared_ptr<const Telegram> telegram);
|
||||
void process_UBAMonitorFast(std::shared_ptr<const Telegram> telegram);
|
||||
@@ -271,42 +292,55 @@ class Boiler : public EMSdevice {
|
||||
void process_CascadeMessage(std::shared_ptr<const Telegram> telegram);
|
||||
void process_UBASettingsWW(std::shared_ptr<const Telegram> telegram);
|
||||
void process_HpPower(std::shared_ptr<const Telegram> telegram);
|
||||
void process_HpOutdoor(std::shared_ptr<const Telegram> telegram);
|
||||
void process_HpTemperatures(std::shared_ptr<const Telegram> telegram);
|
||||
void process_HpPool(std::shared_ptr<const Telegram> telegram);
|
||||
void process_HpInput(std::shared_ptr<const Telegram> telegram);
|
||||
void process_HpInConfig(std::shared_ptr<const Telegram> telegram);
|
||||
void process_HpCooling(std::shared_ptr<const Telegram> telegram);
|
||||
void process_HpHeaterConfig(std::shared_ptr<const Telegram> telegram);
|
||||
void process_HybridHp(std::shared_ptr<const Telegram> telegram);
|
||||
void process_amTempMessage(std::shared_ptr<const Telegram> telegram);
|
||||
void process_amStatusMessage(std::shared_ptr<const Telegram> telegram);
|
||||
void process_amSettingMessage(std::shared_ptr<const Telegram> telegram);
|
||||
void process_amCommandMessage(std::shared_ptr<const Telegram> telegram);
|
||||
void process_amExtraMessage(std::shared_ptr<const Telegram> telegram);
|
||||
void process_HpSilentMode(std::shared_ptr<const Telegram> telegram);
|
||||
void process_HpAdditionalHeater(std::shared_ptr<const Telegram> telegram);
|
||||
void process_HpValve(std::shared_ptr<const Telegram> telegram);
|
||||
void process_HpPumps(std::shared_ptr<const Telegram> telegram);
|
||||
void process_HpDhwSettings(std::shared_ptr<const Telegram> telegram);
|
||||
void process_HpSettings2(std::shared_ptr<const Telegram> telegram);
|
||||
void process_HpSettings3(std::shared_ptr<const Telegram> telegram);
|
||||
|
||||
// commands - none of these use the additional id parameter
|
||||
bool set_ww_mode(const char * value, const int8_t id);
|
||||
bool set_ww_activated(const char * value, const int8_t id);
|
||||
bool set_tapwarmwater_activated(const char * value, const int8_t id);
|
||||
bool set_ww_onetime(const char * value, const int8_t id);
|
||||
bool set_ww_disinfect(const char * value, const int8_t id);
|
||||
bool set_ww_circulation(const char * value, const int8_t id);
|
||||
bool set_ww_circulation_pump(const char * value, const int8_t id);
|
||||
bool set_ww_circulation_mode(const char * value, const int8_t id);
|
||||
bool set_ww_temp(const char * value, const int8_t id);
|
||||
bool set_ww_temp_low(const char * value, const int8_t id);
|
||||
bool set_ww_temp_single(const char * value, const int8_t id);
|
||||
bool set_ww_disinfect_temp(const char * value, const int8_t id);
|
||||
bool set_ww_maxpower(const char * value, const int8_t id);
|
||||
bool set_ww_maxtemp(const char * value, const int8_t id);
|
||||
bool set_ww_flowTempOffset(const char * value, const int8_t id);
|
||||
bool set_ww_chargeOptimization(const char * value, const int8_t id);
|
||||
bool set_flow_temp(const char * value, const int8_t id);
|
||||
bool set_burn_power(const char * value, const int8_t id);
|
||||
bool set_heating_activated(const char * value, const int8_t id);
|
||||
bool set_heating_temp(const char * value, const int8_t id);
|
||||
bool set_min_power(const char * value, const int8_t id);
|
||||
bool set_max_power(const char * value, const int8_t id);
|
||||
bool set_min_pump(const char * value, const int8_t id);
|
||||
bool set_max_pump(const char * value, const int8_t id);
|
||||
bool set_hyst_on(const char * value, const int8_t id);
|
||||
bool set_hyst_off(const char * value, const int8_t id);
|
||||
bool set_ww_mode(const char * value, const int8_t id);
|
||||
bool set_ww_activated(const char * value, const int8_t id);
|
||||
bool set_tapwarmwater_activated(const char * value, const int8_t id);
|
||||
bool set_ww_onetime(const char * value, const int8_t id);
|
||||
bool set_ww_disinfect(const char * value, const int8_t id);
|
||||
bool set_ww_circulation(const char * value, const int8_t id);
|
||||
bool set_ww_circulation_pump(const char * value, const int8_t id);
|
||||
bool set_ww_circulation_mode(const char * value, const int8_t id);
|
||||
bool set_ww_temp(const char * value, const int8_t id);
|
||||
bool set_ww_temp_low(const char * value, const int8_t id);
|
||||
bool set_ww_temp_single(const char * value, const int8_t id);
|
||||
bool set_ww_disinfect_temp(const char * value, const int8_t id);
|
||||
bool set_ww_maxpower(const char * value, const int8_t id);
|
||||
bool set_ww_maxtemp(const char * value, const int8_t id);
|
||||
bool set_ww_flowTempOffset(const char * value, const int8_t id);
|
||||
bool set_ww_chargeOptimization(const char * value, const int8_t id);
|
||||
bool set_flow_temp(const char * value, const int8_t id);
|
||||
bool set_burn_power(const char * value, const int8_t id);
|
||||
bool set_heating_activated(const char * value, const int8_t id);
|
||||
bool set_heating_temp(const char * value, const int8_t id);
|
||||
bool set_min_power(const char * value, const int8_t id);
|
||||
bool set_max_power(const char * value, const int8_t id);
|
||||
bool set_min_pump(const char * value, const int8_t id);
|
||||
bool set_max_pump(const char * value, const int8_t id);
|
||||
bool set_pumpMode(const char * value, const int8_t id);
|
||||
bool set_hyst_on(const char * value, const int8_t id);
|
||||
bool set_hyst_off(const char * value, const int8_t id);
|
||||
inline bool set_hyst2_on(const char * value, const int8_t id) {
|
||||
return set_hyst_on(value, 2);
|
||||
}
|
||||
inline bool set_hyst2_off(const char * value, const int8_t id) {
|
||||
return set_hyst_off(value, 2);
|
||||
}
|
||||
bool set_burn_period(const char * value, const int8_t id);
|
||||
bool set_pump_delay(const char * value, const int8_t id);
|
||||
bool set_reset(const char * value, const int8_t id);
|
||||
@@ -319,23 +353,100 @@ class Boiler : public EMSdevice {
|
||||
bool set_emergency_temp(const char * value, const int8_t id);
|
||||
bool set_emergency_ops(const char * value, const int8_t id);
|
||||
|
||||
bool set_vr2Config(const char * value, const int8_t id); // pos 12: off(00)/Keelbypass(01)/(hc1pump(02) only standalone)
|
||||
bool set_ahsActivated(const char * value, const int8_t id); // pos 00: Alternate heat source activation: No(00),Yes(01)
|
||||
bool set_aPumpConfig(const char * value, const int8_t id); // pos 04: Buffer primary pump->Config pump: No(00),Yes(01)
|
||||
bool set_aPumpSignal(const char * value, const int8_t id); // pos 03: Output for PR1 pump: On/Off(00),PWM(01),PWM invers(02)
|
||||
bool set_aPumpMin(const char * value, const int8_t id); // pos 21: Min output pump PR1 (%)
|
||||
bool set_tempRise(const char * value, const int8_t id); // pos 01: AHS return temp rise: No(00),Yes(01) (mixer VR1)
|
||||
bool set_setReturnTemp(const char * value, const int8_t id); // pos 06: Set temp return (°C) (VR1)
|
||||
bool set_mixRuntime(const char * value, const int8_t id); // pos 10/11?: Mixer run time (s) (VR1)
|
||||
bool set_setFlowTemp(const char * value, const int8_t id); // pos 07: Set flow temp AHS (°C) (Buffer)
|
||||
bool set_bufBypass(const char * value, const int8_t id); // pos 02: Puffer bypass: No(00), Mischer(01), Ventil(02) (Buffer)
|
||||
bool set_bufMixRuntime(const char * value, const int8_t id); // pos 8/9: Bypass mixer run time: [time] (s) (Buffer)
|
||||
bool set_bufConfig(const char * value, const int8_t id); // pos 20: Konfig WW-Speicher Monovalent(01), Bivalent(02) (buffer)
|
||||
bool set_blockMode(const char * value, const int8_t id); // pos 16: Config htg. blocking mode: No(00),Automatic(01),Always block02) (blocking)
|
||||
bool set_blockTerm(const char * value, const int8_t id); // pos 17: Config of block terminal: NO(00), NC(01)
|
||||
bool set_blockHyst(const char * value, const int8_t id); // pos 14?: Hyst. for bolier block (K)
|
||||
bool set_releaseWait(const char * value, const int8_t id); // pos 15: Boiler release wait time (min)
|
||||
bool set_HpInLogic(const char * value, const int8_t id);
|
||||
inline bool set_HpIn1Logic(const char * value, const int8_t id) {
|
||||
return set_HpInLogic(value, 1);
|
||||
}
|
||||
inline bool set_HpIn2Logic(const char * value, const int8_t id) {
|
||||
return set_HpInLogic(value, 2);
|
||||
}
|
||||
inline bool set_HpIn3Logic(const char * value, const int8_t id) {
|
||||
return set_HpInLogic(value, 3);
|
||||
}
|
||||
inline bool set_HpIn4Logic(const char * value, const int8_t id) {
|
||||
return set_HpInLogic(value, 4);
|
||||
}
|
||||
bool set_maxHeat(const char * value, const int8_t id);
|
||||
inline bool set_maxHeatComp(const char * value, const int8_t id) {
|
||||
return set_maxHeat(value, 2);
|
||||
}
|
||||
inline bool set_maxHeatHeat(const char * value, const int8_t id) {
|
||||
return set_maxHeat(value, 3);
|
||||
}
|
||||
inline bool set_maxHeatDhw(const char * value, const int8_t id) {
|
||||
return set_maxHeat(value, 4);
|
||||
}
|
||||
bool set_silentMode(const char * value, const int8_t id);
|
||||
bool set_minTempSilent(const char * value, const int8_t id);
|
||||
bool set_silentFrom(const char * value, const int8_t id);
|
||||
bool set_silentTo(const char * value, const int8_t id);
|
||||
bool set_additionalHeaterOnly(const char * value, const int8_t id);
|
||||
bool set_additionalHeater(const char * value, const int8_t id);
|
||||
bool set_additionalHeaterDelay(const char * value, const int8_t id);
|
||||
bool set_tempParMode(const char * value, const int8_t id);
|
||||
bool set_auxHeatMode(const char * value, const int8_t id);
|
||||
bool set_manDefrost(const char * value, const int8_t id);
|
||||
bool set_pvCooling(const char * value, const int8_t id);
|
||||
bool set_hpCircPumpWw(const char * value, const int8_t id);
|
||||
|
||||
bool set_auxLimit(const char * value, const int8_t id);
|
||||
inline bool set_auxMaxLimit(const char * value, const int8_t id) {
|
||||
return set_auxLimit(value, 14);
|
||||
}
|
||||
inline bool set_auxLimitStart(const char * value, const int8_t id) {
|
||||
return set_auxLimit(value, 15);
|
||||
}
|
||||
bool set_hpHyst(const char * value, const int8_t id);
|
||||
inline bool set_hpHystHeat(const char * value, const int8_t id) {
|
||||
return set_hpHyst(value, 37);
|
||||
}
|
||||
inline bool set_hpHystCool(const char * value, const int8_t id) {
|
||||
return set_hpHyst(value, 35);
|
||||
}
|
||||
inline bool set_hpHystPool(const char * value, const int8_t id) {
|
||||
return set_hpHyst(value, 33);
|
||||
}
|
||||
bool set_tempDiff(const char * value, const int8_t id);
|
||||
inline bool set_tempDiffHeat(const char * value, const int8_t id) {
|
||||
return set_tempDiff(value, 4);
|
||||
}
|
||||
inline bool set_tempDiffCool(const char * value, const int8_t id) {
|
||||
return set_tempDiff(value, 3);
|
||||
}
|
||||
bool set_wwOffTemp(const char * value, const int8_t id);
|
||||
inline bool set_wwComfOffTemp(const char * value, const int8_t id) {
|
||||
return set_wwOffTemp(value, 1);
|
||||
}
|
||||
inline bool set_wwEcoOffTemp(const char * value, const int8_t id) {
|
||||
return set_wwOffTemp(value, 0);
|
||||
}
|
||||
inline bool set_wwEcoPlusOffTemp(const char * value, const int8_t id) {
|
||||
return set_wwOffTemp(value, 5);
|
||||
}
|
||||
bool set_vp_cooling(const char * value, const int8_t id);
|
||||
bool set_heatCable(const char * value, const int8_t id);
|
||||
bool set_VC0valve(const char * value, const int8_t id);
|
||||
bool set_primePump(const char * value, const int8_t id);
|
||||
bool set_primePumpMod(const char * value, const int8_t id);
|
||||
bool set_hp3wayValve(const char * value, const int8_t id);
|
||||
bool set_elHeatStep(const char * value, const int8_t id);
|
||||
inline bool set_elHeatStep1(const char * value, const int8_t id) {
|
||||
return set_elHeatStep(value, 1);
|
||||
}
|
||||
inline bool set_elHeatStep2(const char * value, const int8_t id) {
|
||||
return set_elHeatStep(value, 2);
|
||||
}
|
||||
inline bool set_elHeatStep3(const char * value, const int8_t id) {
|
||||
return set_elHeatStep(value, 3);
|
||||
}
|
||||
bool set_wwAlternatingOper(const char * value, const int8_t id);
|
||||
bool set_wwAltOpPrio(const char * value, const int8_t id);
|
||||
inline bool set_wwAltOpPrioHeat(const char * value, const int8_t id) {
|
||||
return set_wwAltOpPrio(value, 2);
|
||||
}
|
||||
inline bool set_wwAltOpPrioWw(const char * value, const int8_t id) {
|
||||
return set_wwAltOpPrio(value, 3);
|
||||
}
|
||||
/*
|
||||
bool set_hybridStrategy(const char * value, const int8_t id);
|
||||
bool set_switchOverTemp(const char * value, const int8_t id);
|
||||
|
||||
@@ -22,7 +22,7 @@ namespace emsesp {
|
||||
|
||||
REGISTER_FACTORY(Connect, EMSdevice::DeviceType::CONNECT);
|
||||
|
||||
Connect::Connect(uint8_t device_type, uint8_t device_id, uint8_t product_id, const char * version, const std::string & name, uint8_t flags, uint8_t brand)
|
||||
Connect::Connect(uint8_t device_type, uint8_t device_id, uint8_t product_id, const char * version, const char * name, uint8_t flags, uint8_t brand)
|
||||
: EMSdevice(device_type, device_id, product_id, version, name, flags, brand) {
|
||||
}
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ namespace emsesp {
|
||||
|
||||
class Connect : public EMSdevice {
|
||||
public:
|
||||
Connect(uint8_t device_type, uint8_t device_id, uint8_t product_id, const char * version, const std::string & name, uint8_t flags, uint8_t brand);
|
||||
Connect(uint8_t device_type, uint8_t device_id, uint8_t product_id, const char * version, const char * name, uint8_t flags, uint8_t brand);
|
||||
};
|
||||
|
||||
} // namespace emsesp
|
||||
|
||||
@@ -22,12 +22,12 @@ namespace emsesp {
|
||||
|
||||
REGISTER_FACTORY(Controller, EMSdevice::DeviceType::CONTROLLER);
|
||||
|
||||
Controller::Controller(uint8_t device_type, uint8_t device_id, uint8_t product_id, const char * version, const std::string & name, uint8_t flags, uint8_t brand)
|
||||
Controller::Controller(uint8_t device_type, uint8_t device_id, uint8_t product_id, const char * version, const char * name, uint8_t flags, uint8_t brand)
|
||||
: EMSdevice(device_type, device_id, product_id, version, name, flags, brand) {
|
||||
// IVT broadcasts Thermostat time from controller (0x09) if display is off.
|
||||
if ((flags & 0x0F) == EMS_DEVICE_FLAG_IVT) {
|
||||
register_telegram_type(0x06, F("RCTime"), false, MAKE_PF_CB(process_dateTime));
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &dateTime_, DeviceValueType::STRING, nullptr, FL_(dateTime), DeviceValueUOM::NONE);
|
||||
register_telegram_type(0x06, "RCTime", false, MAKE_PF_CB(process_dateTime));
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &dateTime_, DeviceValueType::STRING, FL_(dateTime), DeviceValueUOM::NONE);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ namespace emsesp {
|
||||
|
||||
class Controller : public EMSdevice {
|
||||
public:
|
||||
Controller(uint8_t device_type, uint8_t device_id, uint8_t product_id, const char * version, const std::string & name, uint8_t flags, uint8_t brand);
|
||||
Controller(uint8_t device_type, uint8_t device_id, uint8_t product_id, const char * version, const char * name, uint8_t flags, uint8_t brand);
|
||||
|
||||
void process_dateTime(std::shared_ptr<const Telegram> telegram);
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ namespace emsesp {
|
||||
|
||||
REGISTER_FACTORY(Gateway, EMSdevice::DeviceType::GATEWAY);
|
||||
|
||||
Gateway::Gateway(uint8_t device_type, uint8_t device_id, uint8_t product_id, const char * version, const std::string & name, uint8_t flags, uint8_t brand)
|
||||
Gateway::Gateway(uint8_t device_type, uint8_t device_id, uint8_t product_id, const char * version, const char * name, uint8_t flags, uint8_t brand)
|
||||
: EMSdevice(device_type, device_id, product_id, version, name, flags, brand) {
|
||||
}
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ namespace emsesp {
|
||||
|
||||
class Gateway : public EMSdevice {
|
||||
public:
|
||||
Gateway(uint8_t device_type, uint8_t device_id, uint8_t product_id, const char * version, const std::string & name, uint8_t flags, uint8_t brand);
|
||||
Gateway(uint8_t device_type, uint8_t device_id, uint8_t product_id, const char * version, const char * name, uint8_t flags, uint8_t brand);
|
||||
};
|
||||
|
||||
} // namespace emsesp
|
||||
|
||||
@@ -24,18 +24,8 @@ REGISTER_FACTORY(Generic, EMSdevice::DeviceType::GENERIC);
|
||||
|
||||
uuid::log::Logger Generic::logger_{F_(generic), uuid::log::Facility::CONSOLE};
|
||||
|
||||
Generic::Generic(uint8_t device_type, uint8_t device_id, uint8_t product_id, const char * version, const std::string & name, uint8_t flags, uint8_t brand)
|
||||
Generic::Generic(uint8_t device_type, uint8_t device_id, uint8_t product_id, const char * version, const char * name, uint8_t flags, uint8_t brand)
|
||||
: EMSdevice(device_type, device_id, product_id, version, name, flags, brand) {
|
||||
// RF-Sensor 0x40 sending temperature in telegram 0x435, see https://github.com/emsesp/EMS-ESP32/issues/103
|
||||
if (device_id == 0x40) {
|
||||
register_telegram_type(0x435, F("RFSensorMessage"), false, MAKE_PF_CB(process_RFSensorMessage));
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &rfTemp_, DeviceValueType::SHORT, FL_(div10), FL_(RFTemp), DeviceValueUOM::DEGREES);
|
||||
}
|
||||
}
|
||||
|
||||
// type 0x435 rf remote sensor
|
||||
void Generic::process_RFSensorMessage(std::shared_ptr<const Telegram> telegram) {
|
||||
has_update(telegram, rfTemp_, 0); // is * 10
|
||||
}
|
||||
|
||||
} // namespace emsesp
|
||||
|
||||
@@ -25,14 +25,10 @@ namespace emsesp {
|
||||
|
||||
class Generic : public EMSdevice {
|
||||
public:
|
||||
Generic(uint8_t device_type, uint8_t device_id, uint8_t product_id, const char * version, const std::string & name, uint8_t flags, uint8_t brand);
|
||||
Generic(uint8_t device_type, uint8_t device_id, uint8_t product_id, const char * version, const char * name, uint8_t flags, uint8_t brand);
|
||||
|
||||
private:
|
||||
static uuid::log::Logger logger_;
|
||||
|
||||
int16_t rfTemp_;
|
||||
|
||||
void process_RFSensorMessage(std::shared_ptr<const Telegram> telegram);
|
||||
};
|
||||
|
||||
} // namespace emsesp
|
||||
|
||||
@@ -22,15 +22,116 @@ namespace emsesp {
|
||||
|
||||
REGISTER_FACTORY(Heatpump, EMSdevice::DeviceType::HEATPUMP);
|
||||
|
||||
Heatpump::Heatpump(uint8_t device_type, uint8_t device_id, uint8_t product_id, const char * version, const std::string & name, uint8_t flags, uint8_t brand)
|
||||
Heatpump::Heatpump(uint8_t device_type, uint8_t device_id, uint8_t product_id, const char * version, const char * name, uint8_t flags, uint8_t brand)
|
||||
: EMSdevice(device_type, device_id, product_id, version, name, flags, brand) {
|
||||
// telegram handlers
|
||||
register_telegram_type(0x042B, F("HP1"), false, MAKE_PF_CB(process_HPMonitor1));
|
||||
register_telegram_type(0x047B, F("HP2"), false, MAKE_PF_CB(process_HPMonitor2));
|
||||
// register_telegram_type(0x042B, "HP1", false, MAKE_PF_CB(process_HPMonitor1));
|
||||
register_telegram_type(0x047B, "HP2", false, MAKE_PF_CB(process_HPMonitor2));
|
||||
|
||||
register_telegram_type(0x998, "HPSettings", true, MAKE_PF_CB(process_HPSettings));
|
||||
register_telegram_type(0x999, "HPFunctionTest", true, MAKE_PF_CB(process_HPFunctionTest));
|
||||
register_telegram_type(0x9A0, "HPTemperature", false, MAKE_PF_CB(process_HPTemperature));
|
||||
register_telegram_type(0x99B, "HPFlowTemp", false, MAKE_PF_CB(process_HPFlowTemp));
|
||||
|
||||
// device values
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &airHumidity_, DeviceValueType::UINT, nullptr, FL_(airHumidity), DeviceValueUOM::PERCENT);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &dewTemperature_, DeviceValueType::UINT, nullptr, FL_(dewTemperature), DeviceValueUOM::DEGREES);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &airHumidity_, DeviceValueType::UINT, FL_(airHumidity), DeviceValueUOM::PERCENT);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &dewTemperature_, DeviceValueType::UINT, FL_(dewTemperature), DeviceValueUOM::DEGREES);
|
||||
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &flowTemp_, DeviceValueType::UINT, FL_(curFlowTemp), DeviceValueUOM::DEGREES);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &retTemp_, DeviceValueType::UINT, FL_(retTemp), DeviceValueUOM::DEGREES);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &sysRetTemp_, DeviceValueType::UINT, FL_(sysRetTemp), DeviceValueUOM::DEGREES);
|
||||
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &hpTa4_, DeviceValueType::SHORT, DeviceValueNumOp::DV_NUMOP_DIV10, FL_(hpTa4), DeviceValueUOM::DEGREES);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &hpTr1_, DeviceValueType::SHORT, DeviceValueNumOp::DV_NUMOP_DIV10, FL_(hpTr1), DeviceValueUOM::DEGREES);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &hpTr3_, DeviceValueType::SHORT, DeviceValueNumOp::DV_NUMOP_DIV10, FL_(hpTr3), DeviceValueUOM::DEGREES);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &hpTr4_, DeviceValueType::SHORT, DeviceValueNumOp::DV_NUMOP_DIV10, FL_(hpTr4), DeviceValueUOM::DEGREES);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &hpTr5_, DeviceValueType::SHORT, DeviceValueNumOp::DV_NUMOP_DIV10, FL_(hpTr5), DeviceValueUOM::DEGREES);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &hpTr6_, DeviceValueType::SHORT, DeviceValueNumOp::DV_NUMOP_DIV10, FL_(hpTr6), DeviceValueUOM::DEGREES);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &hpTl2_, DeviceValueType::SHORT, DeviceValueNumOp::DV_NUMOP_DIV10, FL_(hpTl2), DeviceValueUOM::DEGREES);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &hpJr0_, DeviceValueType::SHORT, DeviceValueNumOp::DV_NUMOP_DIV10, FL_(hpPl1), DeviceValueUOM::DEGREES);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &hpJr1_, DeviceValueType::SHORT, DeviceValueNumOp::DV_NUMOP_DIV10, FL_(hpPh1), DeviceValueUOM::DEGREES);
|
||||
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA,
|
||||
&controlStrategy_,
|
||||
DeviceValueType::ENUM,
|
||||
FL_(enum_hybridStrategy1),
|
||||
FL_(hybridStrategy),
|
||||
DeviceValueUOM::NONE,
|
||||
MAKE_CF_CB(set_controlStrategy));
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA,
|
||||
&lowNoiseMode_,
|
||||
DeviceValueType::ENUM,
|
||||
FL_(enum_lowNoiseMode),
|
||||
FL_(lowNoiseMode),
|
||||
DeviceValueUOM::NONE,
|
||||
MAKE_CF_CB(set_lowNoiseMode));
|
||||
register_device_value(
|
||||
DeviceValueTAG::TAG_DEVICE_DATA, &lowNoiseStart_, DeviceValueType::UINT, FL_(lowNoiseStart), DeviceValueUOM::NONE, MAKE_CF_CB(set_lowNoiseStart), 0, 23);
|
||||
register_device_value(
|
||||
DeviceValueTAG::TAG_DEVICE_DATA, &lowNoiseStop_, DeviceValueType::UINT, FL_(lowNoiseStop), DeviceValueUOM::NONE, MAKE_CF_CB(set_lowNoiseStop), 0, 23);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA,
|
||||
&hybridDHW_,
|
||||
DeviceValueType::ENUM,
|
||||
FL_(enum_comfort2),
|
||||
FL_(hybridDHW),
|
||||
DeviceValueUOM::NONE,
|
||||
MAKE_CF_CB(set_hybridDHW));
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA,
|
||||
&energyPriceGas_,
|
||||
DeviceValueType::UINT,
|
||||
FL_(energyPriceGas),
|
||||
DeviceValueUOM::NONE,
|
||||
MAKE_CF_CB(set_energyPriceGas));
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA,
|
||||
&energyPriceEl_,
|
||||
DeviceValueType::UINT,
|
||||
FL_(energyPriceEl),
|
||||
DeviceValueUOM::NONE,
|
||||
MAKE_CF_CB(set_energyPriceEl));
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA,
|
||||
&energyPricePV_,
|
||||
DeviceValueType::UINT,
|
||||
FL_(energyPricePV),
|
||||
DeviceValueUOM::NONE,
|
||||
MAKE_CF_CB(set_energyPricePV));
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA,
|
||||
&switchOverTemp_,
|
||||
DeviceValueType::INT,
|
||||
FL_(switchOverTemp),
|
||||
DeviceValueUOM::NONE,
|
||||
MAKE_CF_CB(set_switchOverTemp));
|
||||
// Function test
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA,
|
||||
&airPurgeMode_,
|
||||
DeviceValueType::BOOL,
|
||||
FL_(airPurgeMode),
|
||||
DeviceValueUOM::NONE,
|
||||
MAKE_CF_CB(set_airPurgeMode));
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA,
|
||||
&heatPumpOutput_,
|
||||
DeviceValueType::UINT,
|
||||
FL_(heatPumpOutput),
|
||||
DeviceValueUOM::PERCENT,
|
||||
MAKE_CF_CB(set_heatPumpOutput));
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA,
|
||||
&coolingCircuit_,
|
||||
DeviceValueType::BOOL,
|
||||
FL_(coolingCircuit),
|
||||
DeviceValueUOM::NONE,
|
||||
MAKE_CF_CB(set_coolingCircuit));
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA,
|
||||
&compStartMod_,
|
||||
DeviceValueType::UINT,
|
||||
FL_(compStartMod),
|
||||
DeviceValueUOM::PERCENT,
|
||||
MAKE_CF_CB(set_compStartMod));
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA,
|
||||
&heatDrainPan_,
|
||||
DeviceValueType::BOOL,
|
||||
FL_(heatDrainPan),
|
||||
DeviceValueUOM::NONE,
|
||||
MAKE_CF_CB(set_heatDrainPan));
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &heatCable_, DeviceValueType::BOOL, FL_(heatCable), DeviceValueUOM::NONE, MAKE_CF_CB(set_heatCable));
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -55,4 +156,197 @@ void Heatpump::process_HPMonitor1(std::shared_ptr<const Telegram> telegram) {
|
||||
|
||||
#pragma GCC diagnostic pop
|
||||
|
||||
// 0x09A0
|
||||
// Heatpump(0x53) -> All(0x00), ?(0x09A0), data: 02 23 01 3E 01 39 00 5D 01 DE 01 38 00 40 00 5E 00 58 00 3F 01 34 00 02
|
||||
void Heatpump::process_HPTemperature(std::shared_ptr<const Telegram> telegram) {
|
||||
has_update(telegram, hpTc3_, 2); // condenser temp.
|
||||
has_update(telegram, hpTr1_, 8); // compressor temp.
|
||||
has_update(telegram, hpTr3_, 10); // cond. temp. heating
|
||||
has_update(telegram, hpTr4_, 12); // cond. temp. clg
|
||||
has_update(telegram, hpTr5_, 14); // suction line temp.
|
||||
has_update(telegram, hpTr6_, 0); // hot gas temp.
|
||||
has_update(telegram, hpTl2_, 6); // inlet air temperature
|
||||
has_update(telegram, hpTa4_, 16); // drain pan temp.
|
||||
has_update(telegram, hpJr0_, 18); // low pressure sensor
|
||||
has_update(telegram, hpJr1_, 20); // high pressure sensor
|
||||
}
|
||||
|
||||
// 0x099B
|
||||
// Heatpump(0x53) -> All(0x00), ?(0x099B), data: 80 00 80 00 01 3C 01 38 80 00 80 00 80 00 01 37 00 00 00 00 64
|
||||
void Heatpump::process_HPFlowTemp(std::shared_ptr<const Telegram> telegram) {
|
||||
has_update(telegram, flowTemp_, 4);
|
||||
has_update(telegram, retTemp_, 6);
|
||||
has_update(telegram, sysRetTemp_, 14);
|
||||
}
|
||||
|
||||
// 0x0998 HPSettings
|
||||
// [emsesp] Heatpump(0x53) -> Me(0x0B), ?(0x0998), data: 00 00 0B 00 00 1F 01 00 01 01 16 06 00 04 02 FF 00 01 7C 01
|
||||
void Heatpump::process_HPSettings(std::shared_ptr<const Telegram> telegram) {
|
||||
has_update(telegram, controlStrategy_, 0);
|
||||
has_update(telegram, hybridDHW_, 1);
|
||||
has_update(telegram, energyPriceGas_, 2);
|
||||
has_update(telegram, energyPriceEl_, 5);
|
||||
has_update(telegram, energyPricePV_, 6);
|
||||
has_update(telegram, lowNoiseMode_, 9);
|
||||
has_update(telegram, lowNoiseStart_, 10);
|
||||
has_update(telegram, lowNoiseStop_, 11);
|
||||
has_update(telegram, switchOverTemp_, 14);
|
||||
}
|
||||
|
||||
void Heatpump::process_HPFunctionTest(std::shared_ptr<const Telegram> telegram) {
|
||||
has_update(telegram, airPurgeMode_, 0);
|
||||
has_update(telegram, heatPumpOutput_, 2);
|
||||
has_update(telegram, coolingCircuit_, 6);
|
||||
has_update(telegram, compStartMod_, 7);
|
||||
has_update(telegram, heatDrainPan_, 9);
|
||||
has_update(telegram, heatCable_, 10);
|
||||
}
|
||||
|
||||
/*
|
||||
* Broadcast (0x099A), data: 05 00 00 00 00 00 00 37 00 00 1D 00 00 52 00 00 13 01 00 01 7C
|
||||
* Broadcast (0x099B), data: 80 00 80 00 01 3C 01 38 80 00 80 00 80 00 01 37 00 00 00 00 64
|
||||
* Broadcast (0x099C), data: 00 04 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 02 76 00 00
|
||||
data: 00 2B 00 03 04 13 00 00 00 00 00 02 02 02 (offset 24)
|
||||
* Broadcast (0x099D), data: 02 02 00 00 02 00 01 38 00 00 63 03 E8 00 00 00 00
|
||||
* Broadcast (0x099E), data: 03
|
||||
* Broadcast (0x099F), data 05 4E 20 00 00 00 00 02 00 01 34 00 00 3F 00 00 5C 00 01 DD 00 01 37 00
|
||||
data 00 3F 00 00 5D 00 00 57 00 02 23 00 01 3D 02 80 00 5A 01 86 01 68 00 00 C0 (offset 24)
|
||||
data 00 00 00 00 (offset 49)
|
||||
* Broadcast (0x09A0), data: 02 23 01 3E 01 39 00 5D 01 DE 01 38 00 40 00 5E 00 58 00 3F 01 34 00 02
|
||||
* Broadcast (0x09A2), data: 00 00 00 00
|
||||
* Broadcast (0x09A3), data: 01 01 01 00 0A 01 0A 00 00 00 00 00 00 01 01 00 00 (offset 2)
|
||||
* Broadcast (0x09A4), data: 00 35 00 00 01 42 00 00 00 00 30 01 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
data: 02 (offset 25)
|
||||
* Broadcast (0x09A5), data: 00 00 00 00 00 00 00 00 0A 01 00 01 03 03 00 5A 00 00 00 00 00 00 00 00 14
|
||||
data: 00 00 00 (offset 25)
|
||||
* Broadcast (0x09A6), data: 05 01 00 01 F4 1F 01 1F 01 01 03 00 3F 00 00 00 19 64 00 3C 00 01 01 19
|
||||
data: 02 EC 01 19 00 (offset 24)
|
||||
* Broadcast (0x09A8), data: 01 18 01 00 01 17 00 06 00 00 86 06 00 2E 07 D0 00 00 00 45 00 04
|
||||
|
||||
* Broadcast (0x04AA), data: 00 00
|
||||
|
||||
*/
|
||||
|
||||
bool Heatpump::set_controlStrategy(const char * value, const int8_t id) {
|
||||
uint8_t v;
|
||||
if (!Helpers::value2enum(value, v, FL_(enum_hybridStrategy1))) {
|
||||
return false;
|
||||
}
|
||||
write_command(0x998, 0, v, 0x998);
|
||||
return true;
|
||||
}
|
||||
bool Heatpump::set_lowNoiseMode(const char * value, const int8_t id) {
|
||||
uint8_t v;
|
||||
if (!Helpers::value2enum(value, v, FL_(enum_lowNoiseMode))) {
|
||||
return false;
|
||||
}
|
||||
write_command(0x998, 9, v, 0x998);
|
||||
return true;
|
||||
}
|
||||
bool Heatpump::set_lowNoiseStart(const char * value, const int8_t id) {
|
||||
int v;
|
||||
if (!Helpers::value2number(value, v, 0, 23)) {
|
||||
return false;
|
||||
}
|
||||
write_command(0x998, 10, v, 0x998);
|
||||
return true;
|
||||
}
|
||||
bool Heatpump::set_lowNoiseStop(const char * value, const int8_t id) {
|
||||
int v;
|
||||
if (!Helpers::value2number(value, v, 0, 23)) {
|
||||
return false;
|
||||
}
|
||||
write_command(0x998, 11, v, 0x998);
|
||||
return true;
|
||||
}
|
||||
bool Heatpump::set_hybridDHW(const char * value, const int8_t id) {
|
||||
uint8_t v;
|
||||
if (!Helpers::value2enum(value, v, FL_(enum_comfort2))) {
|
||||
return false;
|
||||
}
|
||||
write_command(0x998, 1, v, 0x998);
|
||||
return true;
|
||||
}
|
||||
bool Heatpump::set_energyPriceGas(const char * value, const int8_t id) {
|
||||
int v;
|
||||
if (!Helpers::value2number(value, v)) {
|
||||
return false;
|
||||
}
|
||||
write_command(0x998, 2, v, 0x998);
|
||||
return true;
|
||||
}
|
||||
bool Heatpump::set_energyPriceEl(const char * value, const int8_t id) {
|
||||
int v;
|
||||
if (!Helpers::value2number(value, v)) {
|
||||
return false;
|
||||
}
|
||||
write_command(0x998, 5, v, 0x998);
|
||||
return true;
|
||||
}
|
||||
bool Heatpump::set_energyPricePV(const char * value, const int8_t id) {
|
||||
int v;
|
||||
if (!Helpers::value2number(value, v)) {
|
||||
return false;
|
||||
}
|
||||
write_command(0x998, 6, v, 0x998);
|
||||
return true;
|
||||
}
|
||||
bool Heatpump::set_switchOverTemp(const char * value, const int8_t id) {
|
||||
int v;
|
||||
if (!Helpers::value2number(value, v)) {
|
||||
return false;
|
||||
}
|
||||
write_command(0x998, 14, v, 0x998);
|
||||
return true;
|
||||
}
|
||||
// Function tests:
|
||||
bool Heatpump::set_airPurgeMode(const char * value, const int8_t id) {
|
||||
bool v;
|
||||
if (!Helpers::value2bool(value, v)) {
|
||||
return false;
|
||||
}
|
||||
write_command(0x999, 0, v, 0x999);
|
||||
return true;
|
||||
}
|
||||
bool Heatpump::set_heatPumpOutput(const char * value, const int8_t id) {
|
||||
int v;
|
||||
if (!Helpers::value2number(value, v, 0, 100)) {
|
||||
return false;
|
||||
}
|
||||
write_command(0x999, 2, v, 0x999);
|
||||
return true;
|
||||
}
|
||||
bool Heatpump::set_coolingCircuit(const char * value, const int8_t id) {
|
||||
bool v;
|
||||
if (!Helpers::value2bool(value, v)) {
|
||||
return false;
|
||||
}
|
||||
write_command(0x999, 6, v, 0x999);
|
||||
return true;
|
||||
}
|
||||
bool Heatpump::set_compStartMod(const char * value, const int8_t id) {
|
||||
int v;
|
||||
if (!Helpers::value2number(value, v, 0, 100)) {
|
||||
return false;
|
||||
}
|
||||
write_command(0x999, 7, v, 0x999);
|
||||
return true;
|
||||
}
|
||||
bool Heatpump::set_heatDrainPan(const char * value, const int8_t id) {
|
||||
bool v;
|
||||
if (!Helpers::value2bool(value, v)) {
|
||||
return false;
|
||||
}
|
||||
write_command(0x999, 9, v, 0x999);
|
||||
return true;
|
||||
}
|
||||
bool Heatpump::set_heatCable(const char * value, const int8_t id) {
|
||||
bool v;
|
||||
if (!Helpers::value2bool(value, v)) {
|
||||
return false;
|
||||
}
|
||||
write_command(0x999, 10, v, 0x999);
|
||||
return true;
|
||||
}
|
||||
|
||||
} // namespace emsesp
|
||||
|
||||
@@ -25,14 +25,68 @@ namespace emsesp {
|
||||
|
||||
class Heatpump : public EMSdevice {
|
||||
public:
|
||||
Heatpump(uint8_t device_type, uint8_t device_id, uint8_t product_id, const char * version, const std::string & name, uint8_t flags, uint8_t brand);
|
||||
Heatpump(uint8_t device_type, uint8_t device_id, uint8_t product_id, const char * version, const char * name, uint8_t flags, uint8_t brand);
|
||||
|
||||
private:
|
||||
uint8_t airHumidity_;
|
||||
uint8_t dewTemperature_;
|
||||
|
||||
// HM200
|
||||
uint8_t controlStrategy_;
|
||||
uint8_t lowNoiseMode_;
|
||||
uint8_t lowNoiseStart_;
|
||||
uint8_t lowNoiseStop_;
|
||||
uint8_t hybridDHW_;
|
||||
uint8_t energyPriceGas_;
|
||||
uint8_t energyPriceEl_;
|
||||
uint8_t energyPricePV_;
|
||||
int8_t switchOverTemp_;
|
||||
|
||||
// Function test
|
||||
uint8_t airPurgeMode_;
|
||||
uint8_t heatPumpOutput_;
|
||||
uint8_t coolingCircuit_;
|
||||
uint8_t compStartMod_;
|
||||
uint8_t heatDrainPan_;
|
||||
uint8_t heatCable_;
|
||||
|
||||
// HM200 temperature
|
||||
int16_t flowTemp_;
|
||||
int16_t retTemp_;
|
||||
int16_t sysRetTemp_;
|
||||
int16_t hpTc3_; // condenser temp.
|
||||
int16_t hpTr1_; // compressor temp.
|
||||
int16_t hpTr3_; // cond. temp. heating
|
||||
int16_t hpTr4_; // cond. temp. clg
|
||||
int16_t hpTr5_; // suction line temp.
|
||||
int16_t hpTr6_; // hot gas temp.
|
||||
int16_t hpTl2_; // inlet air temperature
|
||||
int16_t hpTa4_; // drain pan temp.
|
||||
int16_t hpJr0_; // low pressure sensor
|
||||
int16_t hpJr1_; // high pressure sensor
|
||||
|
||||
void process_HPMonitor1(std::shared_ptr<const Telegram> telegram);
|
||||
void process_HPMonitor2(std::shared_ptr<const Telegram> telegram);
|
||||
void process_HPSettings(std::shared_ptr<const Telegram> telegram);
|
||||
void process_HPFunctionTest(std::shared_ptr<const Telegram> telegram);
|
||||
void process_HPTemperature(std::shared_ptr<const Telegram> telegram);
|
||||
void process_HPFlowTemp(std::shared_ptr<const Telegram> telegram);
|
||||
bool set_controlStrategy(const char * value, const int8_t id);
|
||||
bool set_lowNoiseMode(const char * value, const int8_t id);
|
||||
bool set_lowNoiseStart(const char * value, const int8_t id);
|
||||
bool set_lowNoiseStop(const char * value, const int8_t id);
|
||||
bool set_hybridDHW(const char * value, const int8_t id);
|
||||
bool set_energyPriceGas(const char * value, const int8_t id);
|
||||
bool set_energyPriceEl(const char * value, const int8_t id);
|
||||
bool set_energyPricePV(const char * value, const int8_t id);
|
||||
bool set_switchOverTemp(const char * value, const int8_t id);
|
||||
|
||||
bool set_airPurgeMode(const char * value, const int8_t id);
|
||||
bool set_heatPumpOutput(const char * value, const int8_t id);
|
||||
bool set_coolingCircuit(const char * value, const int8_t id);
|
||||
bool set_compStartMod(const char * value, const int8_t id);
|
||||
bool set_heatDrainPan(const char * value, const int8_t id);
|
||||
bool set_heatCable(const char * value, const int8_t id);
|
||||
};
|
||||
|
||||
} // namespace emsesp
|
||||
|
||||
478
src/devices/heatsource.cpp
Normal file
478
src/devices/heatsource.cpp
Normal file
@@ -0,0 +1,478 @@
|
||||
/*
|
||||
* EMS-ESP - https://github.com/emsesp/EMS-ESP
|
||||
* Copyright 2020 Paul Derbyshire
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "heatsource.h"
|
||||
|
||||
namespace emsesp {
|
||||
|
||||
REGISTER_FACTORY(Heatsource, EMSdevice::DeviceType::HEATSOURCE);
|
||||
|
||||
Heatsource::Heatsource(uint8_t device_type, uint8_t device_id, uint8_t product_id, const char * version, const char * name, uint8_t flags, uint8_t brand)
|
||||
: EMSdevice(device_type, device_id, product_id, version, name, flags, brand) {
|
||||
if (device_id >= EMSdevice::EMS_DEVICE_ID_AHS1 && device_id < EMSdevice::EMS_DEVICE_ID_HS1) {
|
||||
uint8_t ahs = device_id - EMSdevice::EMS_DEVICE_ID_AHS1; // heating source id, count from 0
|
||||
register_telegram_type(0x54D, "AmTemperatures", false, MAKE_PF_CB(process_amTempMessage));
|
||||
register_telegram_type(0x54E, "AmStatus", false, MAKE_PF_CB(process_amStatusMessage));
|
||||
register_telegram_type(0x54F, "AmCommand", false, MAKE_PF_CB(process_amCommandMessage)); // not broadcasted, but actually not used
|
||||
register_telegram_type(0x550, "AmExtra", false, MAKE_PF_CB(process_amExtraMessage));
|
||||
register_telegram_type(0x54C, "AmSettings", true, MAKE_PF_CB(process_amSettingMessage)); // not broadcasted
|
||||
|
||||
register_device_value(DeviceValueTAG::TAG_AHS1 + ahs,
|
||||
&curFlowTemp_,
|
||||
DeviceValueType::SHORT,
|
||||
DeviceValueNumOp::DV_NUMOP_DIV10,
|
||||
FL_(sysFlowTemp),
|
||||
DeviceValueUOM::DEGREES);
|
||||
register_device_value(DeviceValueTAG::TAG_AHS1 + ahs,
|
||||
&retTemp_,
|
||||
DeviceValueType::SHORT,
|
||||
DeviceValueNumOp::DV_NUMOP_DIV10,
|
||||
FL_(sysRetTemp),
|
||||
DeviceValueUOM::DEGREES);
|
||||
register_device_value(DeviceValueTAG::TAG_AHS1 + ahs,
|
||||
&aFlowTemp_,
|
||||
DeviceValueType::SHORT,
|
||||
DeviceValueNumOp::DV_NUMOP_DIV10,
|
||||
FL_(aFlowTemp),
|
||||
DeviceValueUOM::DEGREES);
|
||||
register_device_value(DeviceValueTAG::TAG_AHS1 + ahs,
|
||||
&aRetTemp_,
|
||||
DeviceValueType::SHORT,
|
||||
DeviceValueNumOp::DV_NUMOP_DIV10,
|
||||
FL_(aRetTemp),
|
||||
DeviceValueUOM::DEGREES);
|
||||
register_device_value(DeviceValueTAG::TAG_AHS1 + ahs,
|
||||
&cylTopTemp_,
|
||||
DeviceValueType::SHORT,
|
||||
DeviceValueNumOp::DV_NUMOP_DIV10,
|
||||
FL_(aCylTopTemp),
|
||||
DeviceValueUOM::DEGREES);
|
||||
register_device_value(DeviceValueTAG::TAG_AHS1 + ahs,
|
||||
&cylCenterTemp_,
|
||||
DeviceValueType::SHORT,
|
||||
DeviceValueNumOp::DV_NUMOP_DIV10,
|
||||
FL_(aCylCenterTemp),
|
||||
DeviceValueUOM::DEGREES);
|
||||
register_device_value(DeviceValueTAG::TAG_AHS1 + ahs,
|
||||
&cylBottomTemp_,
|
||||
DeviceValueType::SHORT,
|
||||
DeviceValueNumOp::DV_NUMOP_DIV10,
|
||||
FL_(aCylBottomTemp),
|
||||
DeviceValueUOM::DEGREES);
|
||||
register_device_value(DeviceValueTAG::TAG_AHS1 + ahs,
|
||||
&flueGasTemp_,
|
||||
DeviceValueType::SHORT,
|
||||
DeviceValueNumOp::DV_NUMOP_DIV10,
|
||||
FL_(flueGasTemp),
|
||||
DeviceValueUOM::DEGREES);
|
||||
// register_device_value(DeviceValueTAG::TAG_AHS1 + ahs, &valveByPass_, DeviceValueType::BOOL, nullptr, FL_(valveByPass), DeviceValueUOM::NONE);
|
||||
register_device_value(DeviceValueTAG::TAG_AHS1 + ahs, &valveBuffer_, DeviceValueType::UINT, FL_(valveBuffer), DeviceValueUOM::PERCENT);
|
||||
register_device_value(DeviceValueTAG::TAG_AHS1 + ahs, &valveReturn_, DeviceValueType::UINT, FL_(valveReturn), DeviceValueUOM::PERCENT);
|
||||
register_device_value(DeviceValueTAG::TAG_AHS1 + ahs, &aPumpMod_, DeviceValueType::UINT, FL_(aPumpMod), DeviceValueUOM::PERCENT);
|
||||
// register_device_value(DeviceValueTAG::TAG_AHS1 + ahs, &heatSource_, DeviceValueType::BOOL, nullptr, FL_(heatSource), DeviceValueUOM::NONE);
|
||||
// Settings:
|
||||
register_device_value(DeviceValueTAG::TAG_AHS1 + ahs,
|
||||
&vr2Config_,
|
||||
DeviceValueType::ENUM,
|
||||
FL_(enum_vr2Config),
|
||||
FL_(vr2Config),
|
||||
DeviceValueUOM::NONE,
|
||||
MAKE_CF_CB(set_vr2Config));
|
||||
register_device_value(DeviceValueTAG::TAG_AHS1 + ahs,
|
||||
&ahsActivated_,
|
||||
DeviceValueType::BOOL,
|
||||
FL_(ahsActivated),
|
||||
DeviceValueUOM::NONE,
|
||||
MAKE_CF_CB(set_ahsActivated));
|
||||
register_device_value(DeviceValueTAG::TAG_AHS1 + ahs,
|
||||
&aPumpConfig_,
|
||||
DeviceValueType::BOOL,
|
||||
FL_(aPumpConfig),
|
||||
DeviceValueUOM::NONE,
|
||||
MAKE_CF_CB(set_aPumpConfig));
|
||||
register_device_value(DeviceValueTAG::TAG_AHS1 + ahs,
|
||||
&aPumpSignal_,
|
||||
DeviceValueType::ENUM,
|
||||
FL_(enum_aPumpSignal),
|
||||
FL_(aPumpSignal),
|
||||
DeviceValueUOM::NONE,
|
||||
MAKE_CF_CB(set_aPumpSignal));
|
||||
register_device_value(
|
||||
DeviceValueTAG::TAG_AHS1 + ahs, &aPumpMin_, DeviceValueType::UINT, FL_(aPumpMin), DeviceValueUOM::PERCENT, MAKE_CF_CB(set_aPumpMin), 12, 50);
|
||||
register_device_value(DeviceValueTAG::TAG_AHS1 + ahs, &tempRise_, DeviceValueType::BOOL, FL_(tempRise), DeviceValueUOM::NONE, MAKE_CF_CB(set_tempRise));
|
||||
register_device_value(DeviceValueTAG::TAG_AHS1 + ahs,
|
||||
&setReturnTemp_,
|
||||
DeviceValueType::UINT,
|
||||
FL_(setReturnTemp),
|
||||
DeviceValueUOM::DEGREES,
|
||||
MAKE_CF_CB(set_setReturnTemp),
|
||||
40,
|
||||
75);
|
||||
register_device_value(
|
||||
DeviceValueTAG::TAG_AHS1 + ahs, &mixRuntime_, DeviceValueType::USHORT, FL_(mixRuntime), DeviceValueUOM::SECONDS, MAKE_CF_CB(set_mixRuntime), 0, 600);
|
||||
register_device_value(
|
||||
DeviceValueTAG::TAG_AHS1 + ahs, &setFlowTemp_, DeviceValueType::UINT, FL_(setFlowTemp), DeviceValueUOM::DEGREES, MAKE_CF_CB(set_setFlowTemp), 40, 75);
|
||||
register_device_value(DeviceValueTAG::TAG_AHS1 + ahs,
|
||||
&bufBypass_,
|
||||
DeviceValueType::ENUM,
|
||||
FL_(enum_bufBypass),
|
||||
FL_(bufBypass),
|
||||
DeviceValueUOM::NONE,
|
||||
MAKE_CF_CB(set_bufBypass));
|
||||
register_device_value(DeviceValueTAG::TAG_AHS1 + ahs,
|
||||
&bufMixRuntime_,
|
||||
DeviceValueType::USHORT,
|
||||
FL_(bufMixRuntime),
|
||||
DeviceValueUOM::SECONDS,
|
||||
MAKE_CF_CB(set_bufMixRuntime),
|
||||
0,
|
||||
600);
|
||||
register_device_value(DeviceValueTAG::TAG_AHS1 + ahs,
|
||||
&bufConfig_,
|
||||
DeviceValueType::ENUM,
|
||||
FL_(enum_bufConfig),
|
||||
FL_(bufConfig),
|
||||
DeviceValueUOM::NONE,
|
||||
MAKE_CF_CB(set_bufConfig));
|
||||
register_device_value(DeviceValueTAG::TAG_AHS1 + ahs,
|
||||
&blockMode_,
|
||||
DeviceValueType::ENUM,
|
||||
FL_(enum_blockMode),
|
||||
FL_(blockMode),
|
||||
DeviceValueUOM::NONE,
|
||||
MAKE_CF_CB(set_blockMode));
|
||||
register_device_value(DeviceValueTAG::TAG_AHS1 + ahs,
|
||||
&blockTerm_,
|
||||
DeviceValueType::ENUM,
|
||||
FL_(enum_blockTerm),
|
||||
FL_(blockTerm),
|
||||
DeviceValueUOM::NONE,
|
||||
MAKE_CF_CB(set_blockTerm));
|
||||
register_device_value(
|
||||
DeviceValueTAG::TAG_AHS1 + ahs, &blockHyst_, DeviceValueType::INT, FL_(blockHyst), DeviceValueUOM::DEGREES_R, MAKE_CF_CB(set_blockHyst), 0, 50);
|
||||
register_device_value(
|
||||
DeviceValueTAG::TAG_AHS1 + ahs, &releaseWait_, DeviceValueType::UINT, FL_(releaseWait), DeviceValueUOM::MINUTES, MAKE_CF_CB(set_releaseWait), 0, 240);
|
||||
|
||||
register_device_value(DeviceValueTAG::TAG_AHS1 + ahs, &burner_, DeviceValueType::BOOL, FL_(burner), DeviceValueUOM::NONE);
|
||||
register_device_value(DeviceValueTAG::TAG_AHS1 + ahs, &aPump_, DeviceValueType::BOOL, FL_(aPump), DeviceValueUOM::NONE);
|
||||
register_device_value(DeviceValueTAG::TAG_AHS1 + ahs, &heatRequest_, DeviceValueType::UINT, FL_(heatRequest), DeviceValueUOM::PERCENT);
|
||||
register_device_value(DeviceValueTAG::TAG_AHS1 + ahs, &blockRemain_, DeviceValueType::UINT, FL_(blockRemain), DeviceValueUOM::MINUTES);
|
||||
register_device_value(DeviceValueTAG::TAG_AHS1 + ahs, &blockRemainWw_, DeviceValueType::UINT, FL_(blockRemainWw), DeviceValueUOM::MINUTES);
|
||||
}
|
||||
|
||||
// cascaded heating sources, only some values per individual heatsource (hs)
|
||||
if (device_id >= EMSdevice::EMS_DEVICE_ID_HS1) {
|
||||
uint8_t hs = device_id - EMSdevice::EMS_DEVICE_ID_HS1; // heating source id, count from 0
|
||||
// Runtime of each heatingsource in 0x06DC, ff
|
||||
register_telegram_type(0x6DC + hs, "CascadeMessage", false, MAKE_PF_CB(process_CascadeMessage));
|
||||
register_device_value(DeviceValueTAG::TAG_HS1 + hs, &burnWorkMin_, DeviceValueType::TIME, FL_(burnWorkMin), DeviceValueUOM::MINUTES);
|
||||
// selBurnpower in D2 and E4
|
||||
// register_telegram_type(0xD2, "CascadePowerMessage", false, MAKE_PF_CB(process_CascadePowerMessage));
|
||||
// individual Flowtemps and powervalues for each heatingsource in E4
|
||||
register_telegram_type(0xE4, "UBAMonitorFastPlus", false, MAKE_PF_CB(process_UBAMonitorFastPlus));
|
||||
register_device_value(DeviceValueTAG::TAG_HS1 + hs, &setFlowTemp_, DeviceValueType::UINT, FL_(setFlowTemp), DeviceValueUOM::DEGREES);
|
||||
register_device_value(DeviceValueTAG::TAG_HS1 + hs, &selBurnPow_, DeviceValueType::UINT, FL_(selBurnPow), DeviceValueUOM::PERCENT);
|
||||
register_device_value(DeviceValueTAG::TAG_HS1 + hs,
|
||||
&curFlowTemp_,
|
||||
DeviceValueType::USHORT,
|
||||
DeviceValueNumOp::DV_NUMOP_DIV10,
|
||||
FL_(curFlowTemp),
|
||||
DeviceValueUOM::DEGREES);
|
||||
register_device_value(DeviceValueTAG::TAG_HS1 + hs, &curBurnPow_, DeviceValueType::UINT, FL_(curBurnPow), DeviceValueUOM::PERCENT);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* heatingsources (boilers)
|
||||
*/
|
||||
|
||||
// 0x6DC, ff for cascaded heatsources (hs)
|
||||
void Heatsource::process_CascadeMessage(std::shared_ptr<const Telegram> telegram) {
|
||||
telegram->read_value(burnWorkMin_, 3); // this is in seconds
|
||||
burnWorkMin_ /= 60;
|
||||
has_update(burnWorkMin_);
|
||||
}
|
||||
|
||||
// UBAMonitorFastPlus - type 0xE4 - central heating monitor EMS+
|
||||
void Heatsource::process_UBAMonitorFastPlus(std::shared_ptr<const Telegram> telegram) {
|
||||
has_update(telegram, setFlowTemp_, 6);
|
||||
has_update(telegram, curBurnPow_, 10);
|
||||
has_update(telegram, selBurnPow_, 9);
|
||||
has_update(telegram, curFlowTemp_, 7);
|
||||
}
|
||||
|
||||
/*
|
||||
* alternative heatingsource AM200
|
||||
*/
|
||||
// 0x054D AM200 temperatures
|
||||
// Rx: 60 00 FF 00 04 4D 0103 0108 8000 00C6 0127 0205 8000 0200 0000 8000 6C
|
||||
// TB4 TR2 TA1 TR1 TB1 TB2* TB3
|
||||
void Heatsource::process_amTempMessage(std::shared_ptr<const Telegram> telegram) {
|
||||
has_update(telegram, curFlowTemp_, 0); // TB4
|
||||
has_update(telegram, retTemp_, 2); // TR2
|
||||
has_update(telegram, flueGasTemp_, 4);
|
||||
has_update(telegram, aFlowTemp_, 6);
|
||||
has_update(telegram, aRetTemp_, 8);
|
||||
has_update(telegram, cylTopTemp_, 10);
|
||||
has_update(telegram, cylCenterTemp_, 12);
|
||||
has_update(telegram, cylBottomTemp_, 14);
|
||||
}
|
||||
|
||||
// 0x054E AM200 status (6 bytes long)
|
||||
// Rx: 60 00 FF 00 04 4E 00 00 00 00 00 00 86
|
||||
void Heatsource::process_amStatusMessage(std::shared_ptr<const Telegram> telegram) {
|
||||
has_update(telegram, aPumpMod_, 0); // PR1
|
||||
// offset 1: bitfield 01-pump on, 02-VR1 opening, 04-VR1 closing, 08-VB1 opening, 10-VB1 closing
|
||||
// actually we dont know the offset of VR2
|
||||
// has_update(telegram, valveBypass_, ?); // VR2
|
||||
has_bitupdate(telegram, burner_, 1, 5);
|
||||
has_bitupdate(telegram, aPump_, 1, 0);
|
||||
has_update(telegram, heatRequest_, 2); // percent
|
||||
has_update(telegram, valveReturn_, 4); // VR1, percent
|
||||
has_update(telegram, valveBuffer_, 5); // VB1, percent
|
||||
}
|
||||
|
||||
// 0x054C AM200 not broadcasted message, 23 bytes long
|
||||
// data: 00 01 01 00 01 00 41 4B 00 5A 00 5A 00 01 05 3C 00 00 5A 00 01 23 00
|
||||
void Heatsource::process_amSettingMessage(std::shared_ptr<const Telegram> telegram) {
|
||||
has_update(telegram, vr2Config_, 12); // pos 12: off(00)/bypass(01)
|
||||
has_update(telegram, ahsActivated_, 0); // pos 00: Alternate heat source activation: No(00),Yes(01)
|
||||
has_update(telegram, aPumpConfig_, 4); // pos 04: Buffer primary pump->Config pump: No(00),Yes(01)
|
||||
has_update(telegram, aPumpSignal_, 3); // pos 03: Output for PR1 pump: On/Off(00),PWM(01),PWM invers(02)
|
||||
has_update(telegram, aPumpMin_, 21); // pos 21: Min output pump PR1 (%)
|
||||
has_update(telegram, tempRise_, 1); // pos 01: AHS return temp rise: No(00),Yes(01) (mixer VR1)
|
||||
has_update(telegram, setReturnTemp_, 6); // pos 06: Set temp return (°C) (VR1)
|
||||
has_update(telegram, mixRuntime_, 8); // pos 8/9: Mixer run time (s) (VR1)
|
||||
has_update(telegram, setFlowTemp_, 7); // pos 07: Set flow temp AHS (°C) (Buffer)
|
||||
has_update(telegram, bufBypass_, 2); // pos 02: Puffer bypass: No(00), Mischer(01), Ventil(02) (Buffer)
|
||||
has_update(telegram, bufMixRuntime_, 10); // pos 10/11: Bypass mixer run time: [time] (s) (Buffer)
|
||||
has_update(telegram, bufConfig_, 20); // pos 20: Konfig WW-Speicher Monovalent(01), Bivalent(02) (buffer)
|
||||
has_update(telegram, blockMode_, 16); // pos 16: Config htg. blocking mode: No(00),Automatic(01),Always block02) (blocking)
|
||||
has_update(telegram, blockTerm_, 17); // pos 17: Config of block terminal: NO(00), NC(01)
|
||||
has_update(telegram, blockHyst_, 14); // pos 14?: Hyst. for bolier block (K)
|
||||
has_update(telegram, releaseWait_, 15); // pos 15: Boiler release wait time (min)
|
||||
}
|
||||
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wunused-parameter"
|
||||
|
||||
// 0x054F AM200 not broadcasted message, 7 bytes long
|
||||
// Boiler(0x60) -> Me(0x0B), amCommand(0x054F), data: 00 00 00 00 00 00 00
|
||||
void Heatsource::process_amCommandMessage(std::shared_ptr<const Telegram> telegram) {
|
||||
// pos 0: return pump in percent
|
||||
// pos 3: setValveBuffer VB1 0-off, 1-open, 2-close
|
||||
// pos 2: setValveReturn VR1 0-off, 1-open, 2-close
|
||||
// pos 6: boiler blocking 0-off, 1-on
|
||||
}
|
||||
|
||||
// 0x0550 AM200 broadcasted message, all 27 bytes unkown
|
||||
// Rx: 60 00 FF 00 04 50 00 FF 00 FF FF 00 0D 00 01 00 00 00 00 01 03 01 00 03 00 2D 19 C8 02 94 00 4A
|
||||
// Rx: 60 00 FF 19 04 50 00 FF FF 39
|
||||
void Heatsource::process_amExtraMessage(std::shared_ptr<const Telegram> telegram) {
|
||||
has_update(telegram, blockRemain_, 24); // minutes
|
||||
has_update(telegram, blockRemainWw_, 25); // minutes
|
||||
}
|
||||
|
||||
#pragma GCC diagnostic pop
|
||||
|
||||
// Settings AM200
|
||||
|
||||
// pos 12: off(00)/Keelbypass(01)/(hc1pump(02) only standalone)
|
||||
bool Heatsource::set_vr2Config(const char * value, const int8_t id) {
|
||||
uint8_t v;
|
||||
if (!Helpers::value2enum(value, v, FL_(enum_vr2Config))) {
|
||||
return false;
|
||||
}
|
||||
write_command(0x54C, 12, v, 0x54C);
|
||||
return true;
|
||||
}
|
||||
|
||||
// pos 00: Alternate heat source activation: No(00),Yes(01)
|
||||
bool Heatsource::set_ahsActivated(const char * value, const int8_t id) {
|
||||
bool v;
|
||||
if (!Helpers::value2bool(value, v)) {
|
||||
return false;
|
||||
}
|
||||
write_command(0x54C, 0, v, 0x54C);
|
||||
return true;
|
||||
}
|
||||
|
||||
// pos 04: Buffer primary pump->Config pump: No(00),Yes(01)
|
||||
bool Heatsource::set_aPumpConfig(const char * value, const int8_t id) {
|
||||
bool v;
|
||||
if (!Helpers::value2bool(value, v)) {
|
||||
return false;
|
||||
}
|
||||
write_command(0x54C, 4, v, 0x54C);
|
||||
return true;
|
||||
}
|
||||
|
||||
// pos 03: Output for PR1 pump: On/Off(00),PWM(01),PWM invers(02)
|
||||
bool Heatsource::set_aPumpSignal(const char * value, const int8_t id) {
|
||||
uint8_t v;
|
||||
if (!Helpers::value2enum(value, v, FL_(enum_aPumpSignal))) {
|
||||
return false;
|
||||
}
|
||||
write_command(0x54C, 3, v, 0x54C);
|
||||
return true;
|
||||
}
|
||||
|
||||
// pos 21: Min output pump PR1 (%)
|
||||
bool Heatsource::set_aPumpMin(const char * value, const int8_t id) {
|
||||
int v;
|
||||
if (!Helpers::value2number(value, v)) {
|
||||
return false;
|
||||
}
|
||||
write_command(0x54C, 21, v, 0x54C);
|
||||
return true;
|
||||
}
|
||||
|
||||
// pos 01: AHS return temp rise: No(00),Yes(01) (mixer VR1)
|
||||
bool Heatsource::set_tempRise(const char * value, const int8_t id) {
|
||||
bool v;
|
||||
if (!Helpers::value2bool(value, v)) {
|
||||
return false;
|
||||
}
|
||||
write_command(0x54C, 1, v, 0x54C);
|
||||
return true;
|
||||
}
|
||||
|
||||
// pos 06: Set temp return (°C) (VR1)
|
||||
bool Heatsource::set_setReturnTemp(const char * value, const int8_t id) {
|
||||
int v;
|
||||
if (!Helpers::value2temperature(value, v)) {
|
||||
return false;
|
||||
}
|
||||
write_command(0x54C, 6, v, 0x54C);
|
||||
return true;
|
||||
}
|
||||
|
||||
// pos 10/11?: Mixer run time (s) (VR1)
|
||||
bool Heatsource::set_mixRuntime(const char * value, const int8_t id) {
|
||||
int v;
|
||||
if (!Helpers::value2number(value, v)) {
|
||||
return false;
|
||||
}
|
||||
uint8_t data[2] = {(uint8_t)(v >> 8), (uint8_t)v};
|
||||
write_command(0x54C, 8, data, 2, 0x54C);
|
||||
return true;
|
||||
}
|
||||
|
||||
// pos 07: Set flow temp AHS (°C) (Buffer)
|
||||
bool Heatsource::set_setFlowTemp(const char * value, const int8_t id) {
|
||||
int v;
|
||||
if (!Helpers::value2number(value, v)) {
|
||||
return false;
|
||||
}
|
||||
write_command(0x54C, 7, v, 0x54C);
|
||||
return true;
|
||||
}
|
||||
|
||||
// pos 02: Puffer bypass: No(00), Mischer(01), Ventil(02) (Buffer)
|
||||
bool Heatsource::set_bufBypass(const char * value, const int8_t id) {
|
||||
uint8_t v;
|
||||
if (!Helpers::value2enum(value, v, FL_(enum_bufBypass))) {
|
||||
return false;
|
||||
}
|
||||
write_command(0x54C, 2, v, 0x54C);
|
||||
return true;
|
||||
}
|
||||
|
||||
// pos 8/9: Bypass mixer run time: [time] (s) (Buffer)
|
||||
bool Heatsource::set_bufMixRuntime(const char * value, const int8_t id) {
|
||||
int v;
|
||||
if (!Helpers::value2number(value, v)) {
|
||||
return false;
|
||||
}
|
||||
uint8_t data[2] = {(uint8_t)(v >> 8), (uint8_t)v};
|
||||
write_command(0x54C, 10, data, 2, 0x54C);
|
||||
return true;
|
||||
}
|
||||
|
||||
// pos 20: Konfig WW-Speicher Monovalent(01), Bivalent(02) (buffer)
|
||||
bool Heatsource::set_bufConfig(const char * value, const int8_t id) {
|
||||
uint8_t v;
|
||||
if (!Helpers::value2enum(value, v, FL_(enum_bufConfig))) {
|
||||
return false;
|
||||
}
|
||||
write_command(0x54C, 20, v, 0x54C);
|
||||
return true;
|
||||
}
|
||||
|
||||
// pos 16: Config htg. blocking mode: No(00),Automatic(01),Always block02) (blocking)
|
||||
bool Heatsource::set_blockMode(const char * value, const int8_t id) {
|
||||
uint8_t v;
|
||||
if (!Helpers::value2enum(value, v, FL_(enum_blockMode))) {
|
||||
return false;
|
||||
}
|
||||
write_command(0x54C, 16, v, 0x54C);
|
||||
return true;
|
||||
}
|
||||
|
||||
// pos 17: Config of block terminal: NO(00), NC(01)
|
||||
bool Heatsource::set_blockTerm(const char * value, const int8_t id) {
|
||||
uint8_t v;
|
||||
if (!Helpers::value2enum(value, v, FL_(enum_blockTerm))) {
|
||||
return false;
|
||||
}
|
||||
write_command(0x54C, 17, v, 0x54C);
|
||||
return true;
|
||||
}
|
||||
|
||||
// pos 14?: Hyst. for bolier block (K)
|
||||
bool Heatsource::set_blockHyst(const char * value, const int8_t id) {
|
||||
int v;
|
||||
if (!Helpers::value2temperature(value, v, true)) {
|
||||
return false;
|
||||
}
|
||||
write_command(0x54C, 14, v, 0x54C);
|
||||
return true;
|
||||
}
|
||||
|
||||
// pos 15: Boiler release wait time (min)
|
||||
bool Heatsource::set_releaseWait(const char * value, const int8_t id) {
|
||||
int v;
|
||||
if (!Helpers::value2number(value, v)) {
|
||||
return false;
|
||||
}
|
||||
write_command(0x54C, 15, v, 0x54C);
|
||||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
bool Heatsource::set_valveBuffer(const char * value, const int8_t id) {
|
||||
uint8_t v;
|
||||
if (!Helpers::value2enum(value, v, FL_(enum_am200valve))) {
|
||||
return false;
|
||||
}
|
||||
write_command(0x54F, 3, v, 0x54F);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Heatsource::set_valveReturn(const char * value, const int8_t id) {
|
||||
uint8_t v;
|
||||
if (!Helpers::value2enum(value, v, FL_(enum_am200valve))) {
|
||||
return false;
|
||||
}
|
||||
write_command(0x54F, 2, v, 0x54F);
|
||||
return true;
|
||||
}
|
||||
*/
|
||||
|
||||
} // namespace emsesp
|
||||
108
src/devices/heatsource.h
Normal file
108
src/devices/heatsource.h
Normal file
@@ -0,0 +1,108 @@
|
||||
/*
|
||||
* EMS-ESP - https://github.com/emsesp/EMS-ESP
|
||||
* Copyright 2020 Paul Derbyshire
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef EMSESP_HEATSOURCE_H
|
||||
#define EMSESP_HEATSOURCE_H
|
||||
|
||||
#include "emsesp.h"
|
||||
|
||||
namespace emsesp {
|
||||
|
||||
class Heatsource : public EMSdevice {
|
||||
public:
|
||||
Heatsource(uint8_t device_type, uint8_t device_id, uint8_t product_id, const char * version, const char * name, uint8_t flags, uint8_t brand);
|
||||
|
||||
private:
|
||||
// hs1 .. hs16
|
||||
uint32_t burnWorkMin_;
|
||||
uint8_t selBurnPow_;
|
||||
uint8_t curBurnPow_;
|
||||
|
||||
// ahs
|
||||
uint16_t curFlowTemp_; // Current flow temperature
|
||||
uint16_t retTemp_; // Return temperature
|
||||
int16_t cylTopTemp_; // TB1
|
||||
int16_t cylCenterTemp_; // TB2
|
||||
int16_t cylBottomTemp_; // TB3
|
||||
int16_t aFlowTemp_; // TA1
|
||||
int16_t aRetTemp_; // TR1
|
||||
uint8_t aPumpMod_; // PR1 - percent
|
||||
uint8_t valveBuffer_; // VB1
|
||||
uint8_t valveReturn_; // VR1
|
||||
uint16_t flueGasTemp_;
|
||||
// uint8_t valveBypass_; // VR2 position unknown
|
||||
// uint8_t heatSource_; // OEV
|
||||
|
||||
uint8_t burner_; // bit 5, offset 1, 54E
|
||||
uint8_t aPump_; // bit 0, offset 1, 54E
|
||||
uint8_t heatRequest_; // offset 2, percent
|
||||
uint8_t blockRemain_; // offset 24, 550 min
|
||||
uint8_t blockRemainWw_; // offset 25, 550 min
|
||||
|
||||
// Settings:
|
||||
uint8_t vr2Config_; // pos 12: off(00)/Keelbypass(01)/(hc1pump(02) only standalone)
|
||||
uint8_t ahsActivated_; // pos 00: Alternate heat source activation: No(00),Yes(01)
|
||||
uint8_t aPumpConfig_; // pos 04: Buffer primary pump->Config pump: No(00),Yes(01)
|
||||
uint8_t aPumpSignal_; // pos 03: Output for PR1 pump: On/Off(00),PWM(01),PWM invers(02)
|
||||
uint8_t aPumpMin_; // pos 21: Min output pump PR1 (%)
|
||||
uint8_t tempRise_; // pos 01: AHS return temp rise: No(00),Yes(01) (mixer VR1)
|
||||
uint8_t setReturnTemp_; // pos 06: Set temp return (°C) (VR1)
|
||||
uint16_t mixRuntime_; // pos 10/11?: Mixer run time (s) (VR1)
|
||||
uint8_t setFlowTemp_; // pos 07: Set flow temp AHS (°C) (Buffer)
|
||||
uint8_t bufBypass_; // pos 02: Puffer bypass: No(00), Mischer(01), Ventil(02) (Buffer)
|
||||
uint16_t bufMixRuntime_; // pos 8/9: Bypass mixer run time: [time] (s) (Buffer)
|
||||
uint8_t bufConfig_; // pos 20: Konfig WW-Speicher Monovalent(01), Bivalent(02) (buffer)
|
||||
uint8_t blockMode_; // pos 16: Config htg. blocking mode: No(00),Automatic(01),Always block02) (blocking)
|
||||
uint8_t blockTerm_; // pos 17: Config of block terminal: NO(00), NC(01)
|
||||
int8_t blockHyst_; // pos 14?: Hyst. for bolier block (K)
|
||||
uint8_t releaseWait_; // pos 15: Boiler release wait time (min)
|
||||
|
||||
void process_CascadeMessage(std::shared_ptr<const Telegram> telegram);
|
||||
void process_UBAMonitorFastPlus(std::shared_ptr<const Telegram> telegram);
|
||||
|
||||
void process_amTempMessage(std::shared_ptr<const Telegram> telegram);
|
||||
void process_amStatusMessage(std::shared_ptr<const Telegram> telegram);
|
||||
void process_amSettingMessage(std::shared_ptr<const Telegram> telegram);
|
||||
void process_amCommandMessage(std::shared_ptr<const Telegram> telegram);
|
||||
void process_amExtraMessage(std::shared_ptr<const Telegram> telegram);
|
||||
|
||||
|
||||
bool set_vr2Config(const char * value, const int8_t id); // pos 12: off(00)/Keelbypass(01)/(hc1pump(02) only standalone)
|
||||
bool set_ahsActivated(const char * value, const int8_t id); // pos 00: Alternate heat source activation: No(00),Yes(01)
|
||||
bool set_aPumpConfig(const char * value, const int8_t id); // pos 04: Buffer primary pump->Config pump: No(00),Yes(01)
|
||||
bool set_aPumpSignal(const char * value, const int8_t id); // pos 03: Output for PR1 pump: On/Off(00),PWM(01),PWM invers(02)
|
||||
bool set_aPumpMin(const char * value, const int8_t id); // pos 21: Min output pump PR1 (%)
|
||||
bool set_tempRise(const char * value, const int8_t id); // pos 01: AHS return temp rise: No(00),Yes(01) (mixer VR1)
|
||||
bool set_setReturnTemp(const char * value, const int8_t id); // pos 06: Set temp return (°C) (VR1)
|
||||
bool set_mixRuntime(const char * value, const int8_t id); // pos 10/11?: Mixer run time (s) (VR1)
|
||||
bool set_setFlowTemp(const char * value, const int8_t id); // pos 07: Set flow temp AHS (°C) (Buffer)
|
||||
bool set_bufBypass(const char * value, const int8_t id); // pos 02: Puffer bypass: No(00), Mischer(01), Ventil(02) (Buffer)
|
||||
bool set_bufMixRuntime(const char * value, const int8_t id); // pos 8/9: Bypass mixer run time: [time] (s) (Buffer)
|
||||
bool set_bufConfig(const char * value, const int8_t id); // pos 20: Konfig WW-Speicher Monovalent(01), Bivalent(02) (buffer)
|
||||
bool set_blockMode(const char * value, const int8_t id); // pos 16: Config htg. blocking mode: No(00),Automatic(01),Always block02) (blocking)
|
||||
bool set_blockTerm(const char * value, const int8_t id); // pos 17: Config of block terminal: NO(00), NC(01)
|
||||
bool set_blockHyst(const char * value, const int8_t id); // pos 14?: Hyst. for bolier block (K)
|
||||
bool set_releaseWait(const char * value, const int8_t id); // pos 15: Boiler release wait time (min)
|
||||
|
||||
bool set_valveBuffer(const char * value, const int8_t id);
|
||||
bool set_valveReturn(const char * value, const int8_t id);
|
||||
};
|
||||
|
||||
} // namespace emsesp
|
||||
|
||||
#endif
|
||||
@@ -24,55 +24,58 @@ REGISTER_FACTORY(Mixer, EMSdevice::DeviceType::MIXER);
|
||||
|
||||
uuid::log::Logger Mixer::logger_{F_(mixer), uuid::log::Facility::CONSOLE};
|
||||
|
||||
Mixer::Mixer(uint8_t device_type, uint8_t device_id, uint8_t product_id, const char * version, const std::string & name, uint8_t flags, uint8_t brand)
|
||||
Mixer::Mixer(uint8_t device_type, uint8_t device_id, uint8_t product_id, const char * version, const char * name, uint8_t flags, uint8_t brand)
|
||||
: EMSdevice(device_type, device_id, product_id, version, name, flags, brand) {
|
||||
// Pool module
|
||||
if (flags == EMSdevice::EMS_DEVICE_FLAG_MP) {
|
||||
register_telegram_type(0x5BA, F("HpPoolStatus"), true, MAKE_PF_CB(process_HpPoolStatus));
|
||||
register_telegram_type(0x5BA, "HpPoolStatus", true, MAKE_PF_CB(process_HpPoolStatus));
|
||||
type_ = Type::MP;
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &poolTemp_, DeviceValueType::SHORT, FL_(div10), FL_(poolTemp), DeviceValueUOM::DEGREES);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA,
|
||||
&poolTemp_,
|
||||
DeviceValueType::SHORT,
|
||||
DeviceValueNumOp::DV_NUMOP_DIV10,
|
||||
FL_(poolTemp),
|
||||
DeviceValueUOM::DEGREES);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &poolShuntStatus_, DeviceValueType::ENUM, FL_(enum_shunt), FL_(poolShuntStatus), DeviceValueUOM::NONE);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &poolShunt_, DeviceValueType::UINT, nullptr, FL_(poolShunt), DeviceValueUOM::PERCENT);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &poolShunt_, DeviceValueType::UINT, FL_(poolShunt), DeviceValueUOM::PERCENT);
|
||||
}
|
||||
|
||||
// EMS+
|
||||
if (flags == EMSdevice::EMS_DEVICE_FLAG_MMPLUS) {
|
||||
if (device_id >= 0x20 && device_id <= 0x27) {
|
||||
register_telegram_type(device_id - 0x20 + 0x02D7, F("MMPLUSStatusMessage_HC"), false, MAKE_PF_CB(process_MMPLUSStatusMessage_HC));
|
||||
// register_telegram_type(device_id - 0x20 + 0x02E1, F("MMPLUSStetMessage_HC"), true, MAKE_PF_CB(process_MMPLUSSetMessage_HC));
|
||||
register_telegram_type(device_id - 0x20 + 0x02D7, "MMPLUSStatusMessage_HC", false, MAKE_PF_CB(process_MMPLUSStatusMessage_HC));
|
||||
// register_telegram_type(device_id - 0x20 + 0x02E1, "MMPLUSStetMessage_HC", true, MAKE_PF_CB(process_MMPLUSSetMessage_HC));
|
||||
type_ = Type::HC;
|
||||
hc_ = device_id - 0x20 + 1;
|
||||
uint8_t tag = DeviceValueTAG::TAG_HC1 + hc_ - 1;
|
||||
register_device_value(tag, &flowTempHc_, DeviceValueType::USHORT, FL_(div10), FL_(flowTempHc), DeviceValueUOM::DEGREES);
|
||||
register_device_value(tag, &status_, DeviceValueType::INT, nullptr, FL_(mixerStatus), DeviceValueUOM::PERCENT);
|
||||
register_device_value(tag, &flowSetTemp_, DeviceValueType::UINT, nullptr, FL_(flowSetTemp), DeviceValueUOM::DEGREES, MAKE_CF_CB(set_flowSetTemp));
|
||||
register_device_value(tag, &pumpStatus_, DeviceValueType::BOOL, nullptr, FL_(pumpStatus), DeviceValueUOM::NONE, MAKE_CF_CB(set_pump));
|
||||
register_device_value(tag, &flowTempHc_, DeviceValueType::USHORT, DeviceValueNumOp::DV_NUMOP_DIV10, FL_(flowTempHc), DeviceValueUOM::DEGREES);
|
||||
register_device_value(tag, &status_, DeviceValueType::INT, FL_(mixerStatus), DeviceValueUOM::PERCENT);
|
||||
register_device_value(tag, &flowSetTemp_, DeviceValueType::UINT, FL_(flowSetTemp), DeviceValueUOM::DEGREES, MAKE_CF_CB(set_flowSetTemp));
|
||||
register_device_value(tag, &pumpStatus_, DeviceValueType::BOOL, FL_(pumpStatus), DeviceValueUOM::NONE, MAKE_CF_CB(set_pump));
|
||||
} else if (device_id >= 0x28 && device_id <= 0x29) {
|
||||
register_telegram_type(device_id - 0x28 + 0x0331, F("MMPLUSStatusMessage_WWC"), false, MAKE_PF_CB(process_MMPLUSStatusMessage_WWC));
|
||||
register_telegram_type(device_id - 0x28 + 0x0313, F("MMPLUSConfigMessage_WWC"), true, MAKE_PF_CB(process_MMPLUSConfigMessage_WWC));
|
||||
// register_telegram_type(device_id - 0x28 + 0x033B, F("MMPLUSSetMessage_WWC"), true, MAKE_PF_CB(process_MMPLUSSetMessage_WWC));
|
||||
register_telegram_type(device_id - 0x28 + 0x0331, "MMPLUSStatusMessage_WWC", false, MAKE_PF_CB(process_MMPLUSStatusMessage_WWC));
|
||||
register_telegram_type(device_id - 0x28 + 0x0313, "MMPLUSConfigMessage_WWC", true, MAKE_PF_CB(process_MMPLUSConfigMessage_WWC));
|
||||
// register_telegram_type(device_id - 0x28 + 0x033B, "MMPLUSSetMessage_WWC", true, MAKE_PF_CB(process_MMPLUSSetMessage_WWC));
|
||||
type_ = Type::WWC;
|
||||
hc_ = device_id - 0x28 + 1;
|
||||
uint8_t tag = DeviceValueTAG::TAG_WWC1 + hc_ - 1;
|
||||
register_device_value(tag, &flowTempHc_, DeviceValueType::USHORT, FL_(div10), FL_(wwTemp), DeviceValueUOM::DEGREES);
|
||||
register_device_value(tag, &pumpStatus_, DeviceValueType::BOOL, nullptr, FL_(wwPumpStatus), DeviceValueUOM::NONE);
|
||||
register_device_value(tag, &status_, DeviceValueType::INT, nullptr, FL_(wwTempStatus), DeviceValueUOM::NONE);
|
||||
register_device_value(tag, &flowTempHc_, DeviceValueType::USHORT, DeviceValueNumOp::DV_NUMOP_DIV10, FL_(wwTemp), DeviceValueUOM::DEGREES);
|
||||
register_device_value(tag, &pumpStatus_, DeviceValueType::BOOL, FL_(wwPumpStatus), DeviceValueUOM::NONE);
|
||||
register_device_value(tag, &status_, DeviceValueType::INT, FL_(wwTempStatus), DeviceValueUOM::NONE);
|
||||
|
||||
register_device_value(tag, &wwMaxTemp_, DeviceValueType::UINT, nullptr, FL_(wwMaxTemp), DeviceValueUOM::DEGREES, MAKE_CF_CB(set_wwMaxTemp));
|
||||
register_device_value(tag, &wwDiffTemp_, DeviceValueType::INT, nullptr, FL_(wwDiffTemp), DeviceValueUOM::DEGREES_R, MAKE_CF_CB(set_wwDiffTemp));
|
||||
register_device_value(tag, &wwMaxTemp_, DeviceValueType::UINT, FL_(wwMaxTemp), DeviceValueUOM::DEGREES, MAKE_CF_CB(set_wwMaxTemp));
|
||||
register_device_value(tag, &wwDiffTemp_, DeviceValueType::INT, FL_(wwDiffTemp), DeviceValueUOM::DEGREES_R, MAKE_CF_CB(set_wwDiffTemp));
|
||||
register_device_value(tag,
|
||||
&wwDisinfectionTemp_,
|
||||
DeviceValueType::UINT,
|
||||
nullptr,
|
||||
FL_(wwDisinfectionTemp),
|
||||
DeviceValueUOM::DEGREES,
|
||||
MAKE_CF_CB(set_wwDisinfectionTemp));
|
||||
register_device_value(tag, &wwReducedTemp_, DeviceValueType::UINT, nullptr, FL_(wwRedTemp), DeviceValueUOM::DEGREES, MAKE_CF_CB(set_wwReducedTemp));
|
||||
register_device_value(tag, &wwRequiredTemp_, DeviceValueType::UINT, nullptr, FL_(wwRequiredTemp), DeviceValueUOM::DEGREES, MAKE_CF_CB(set_wwRequiredTemp));
|
||||
register_device_value(tag, &wwReducedTemp_, DeviceValueType::UINT, FL_(wwRedTemp), DeviceValueUOM::DEGREES, MAKE_CF_CB(set_wwReducedTemp));
|
||||
register_device_value(tag, &wwRequiredTemp_, DeviceValueType::UINT, FL_(wwRequiredTemp), DeviceValueUOM::DEGREES, MAKE_CF_CB(set_wwRequiredTemp));
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA_WW,
|
||||
&wwCircPump_,
|
||||
DeviceValueType::BOOL,
|
||||
nullptr,
|
||||
FL_(wwCircPump),
|
||||
DeviceValueUOM::NONE,
|
||||
MAKE_CF_CB(set_wwCircPump));
|
||||
@@ -82,67 +85,71 @@ Mixer::Mixer(uint8_t device_type, uint8_t device_id, uint8_t product_id, const c
|
||||
|
||||
// EMS 1.0
|
||||
if (flags == EMSdevice::EMS_DEVICE_FLAG_MM10) {
|
||||
register_telegram_type(0x00AA, F("MMConfigMessage"), true, MAKE_PF_CB(process_MMConfigMessage));
|
||||
register_telegram_type(0x00AB, F("MMStatusMessage"), false, MAKE_PF_CB(process_MMStatusMessage));
|
||||
register_telegram_type(0x00AC, F("MMSetMessage"), false, MAKE_PF_CB(process_MMSetMessage));
|
||||
register_telegram_type(0x00AA, "MMConfigMessage", true, MAKE_PF_CB(process_MMConfigMessage));
|
||||
register_telegram_type(0x00AB, "MMStatusMessage", false, MAKE_PF_CB(process_MMStatusMessage));
|
||||
register_telegram_type(0x00AC, "MMSetMessage", false, MAKE_PF_CB(process_MMSetMessage));
|
||||
type_ = Type::HC;
|
||||
hc_ = device_id - 0x20 + 1;
|
||||
uint8_t tag = DeviceValueTAG::TAG_HC1 + hc_ - 1;
|
||||
register_device_value(tag, &flowTempHc_, DeviceValueType::USHORT, FL_(div10), FL_(flowTempHc), DeviceValueUOM::DEGREES);
|
||||
register_device_value(tag, &status_, DeviceValueType::INT, nullptr, FL_(mixerStatus), DeviceValueUOM::PERCENT);
|
||||
register_device_value(tag, &flowSetTemp_, DeviceValueType::UINT, nullptr, FL_(flowSetTemp), DeviceValueUOM::DEGREES, MAKE_CF_CB(set_flowSetTemp));
|
||||
register_device_value(tag, &pumpStatus_, DeviceValueType::BOOL, nullptr, FL_(pumpStatus), DeviceValueUOM::NONE, MAKE_CF_CB(set_pump));
|
||||
register_device_value(tag, &activated_, DeviceValueType::BOOL, nullptr, FL_(activated), DeviceValueUOM::NONE, MAKE_CF_CB(set_activated));
|
||||
register_device_value(
|
||||
tag, &setValveTime_, DeviceValueType::UINT, FL_(mul10), FL_(mixerSetTime), DeviceValueUOM::SECONDS, MAKE_CF_CB(set_setValveTime), 10, 120);
|
||||
register_device_value(tag, &flowTempHc_, DeviceValueType::USHORT, DeviceValueNumOp::DV_NUMOP_DIV10, FL_(flowTempHc), DeviceValueUOM::DEGREES);
|
||||
register_device_value(tag, &status_, DeviceValueType::INT, FL_(mixerStatus), DeviceValueUOM::PERCENT);
|
||||
register_device_value(tag, &flowSetTemp_, DeviceValueType::UINT, FL_(flowSetTemp), DeviceValueUOM::DEGREES, MAKE_CF_CB(set_flowSetTemp));
|
||||
register_device_value(tag, &pumpStatus_, DeviceValueType::BOOL, FL_(pumpStatus), DeviceValueUOM::NONE, MAKE_CF_CB(set_pump));
|
||||
register_device_value(tag, &activated_, DeviceValueType::BOOL, FL_(activated), DeviceValueUOM::NONE, MAKE_CF_CB(set_activated));
|
||||
register_device_value(tag,
|
||||
&setValveTime_,
|
||||
DeviceValueType::UINT,
|
||||
DeviceValueNumOp::DV_NUMOP_MUL10,
|
||||
FL_(mixerSetTime),
|
||||
DeviceValueUOM::SECONDS,
|
||||
MAKE_CF_CB(set_setValveTime),
|
||||
10,
|
||||
120);
|
||||
}
|
||||
|
||||
// HT3
|
||||
if (flags == EMSdevice::EMS_DEVICE_FLAG_IPM) {
|
||||
if (device_id >= 0x40) { // special DHW pos 10
|
||||
register_telegram_type(0x34, F("UBAMonitorWW"), false, MAKE_PF_CB(process_IPMMonitorWW));
|
||||
register_telegram_type(0x1E, F("HydrTemp"), false, MAKE_PF_CB(process_IPMHydrTemp));
|
||||
register_telegram_type(0x33, F("UBAParameterWW"), true, MAKE_PF_CB(process_IPMParameterWW));
|
||||
// register_telegram_type(0x10D, F("wwNTCStatus"), false, MAKE_PF_CB(process_wwNTCStatus));
|
||||
register_telegram_type(0x34, "UBAMonitorWW", false, MAKE_PF_CB(process_IPMMonitorWW));
|
||||
register_telegram_type(0x1E, "HydrTemp", false, MAKE_PF_CB(process_IPMHydrTemp));
|
||||
register_telegram_type(0x33, "UBAParameterWW", true, MAKE_PF_CB(process_IPMParameterWW));
|
||||
// register_telegram_type(0x10D, "wwNTCStatus", false, MAKE_PF_CB(process_wwNTCStatus));
|
||||
type_ = Type::WWC;
|
||||
hc_ = device_id - 0x40 + 1;
|
||||
uint8_t tag = DeviceValueTAG::TAG_WWC9 + hc_ - 1;
|
||||
register_device_value(tag, &wwSelTemp_, DeviceValueType::UINT, nullptr, FL_(wwSelTemp), DeviceValueUOM::DEGREES, MAKE_CF_CB(set_wwSelTemp));
|
||||
register_device_value(tag, &wwCurTemp_1_, DeviceValueType::USHORT, FL_(div10), FL_(wwCurTemp), DeviceValueUOM::DEGREES);
|
||||
register_device_value(tag, &wwCurTemp_2_, DeviceValueType::USHORT, FL_(div10), FL_(wwCurTemp2), DeviceValueUOM::DEGREES);
|
||||
register_device_value(tag, &HydrTemp_, DeviceValueType::USHORT, FL_(div10), FL_(hydrTemp), DeviceValueUOM::DEGREES);
|
||||
register_device_value(tag, &pumpStatus_, DeviceValueType::BOOL, nullptr, FL_(pumpStatus), DeviceValueUOM::NONE);
|
||||
register_device_value(
|
||||
tag, &wwFlowTempOffset_, DeviceValueType::UINT, nullptr, FL_(wwFlowTempOffset), DeviceValueUOM::DEGREES_R, MAKE_CF_CB(set_wwFlowTempOffset));
|
||||
register_device_value(tag, &wwHystOn_, DeviceValueType::INT, nullptr, FL_(wwHystOn), DeviceValueUOM::DEGREES_R, MAKE_CF_CB(set_wwHystOn));
|
||||
register_device_value(tag, &wwHystOff_, DeviceValueType::INT, nullptr, FL_(wwHystOff), DeviceValueUOM::DEGREES_R, MAKE_CF_CB(set_wwHystOff));
|
||||
register_device_value(tag, &wwSelTemp_, DeviceValueType::UINT, FL_(wwSelTemp), DeviceValueUOM::DEGREES, MAKE_CF_CB(set_wwSelTemp));
|
||||
register_device_value(tag, &wwCurTemp_1_, DeviceValueType::USHORT, DeviceValueNumOp::DV_NUMOP_DIV10, FL_(wwCurTemp), DeviceValueUOM::DEGREES);
|
||||
register_device_value(tag, &wwCurTemp_2_, DeviceValueType::USHORT, DeviceValueNumOp::DV_NUMOP_DIV10, FL_(wwCurTemp2), DeviceValueUOM::DEGREES);
|
||||
register_device_value(tag, &HydrTemp_, DeviceValueType::USHORT, DeviceValueNumOp::DV_NUMOP_DIV10, FL_(hydrTemp), DeviceValueUOM::DEGREES);
|
||||
register_device_value(tag, &pumpStatus_, DeviceValueType::BOOL, FL_(pumpStatus), DeviceValueUOM::NONE);
|
||||
register_device_value(tag, &wwFlowTempOffset_, DeviceValueType::UINT, FL_(wwFlowTempOffset), DeviceValueUOM::DEGREES_R, MAKE_CF_CB(set_wwFlowTempOffset));
|
||||
register_device_value(tag, &wwHystOn_, DeviceValueType::INT, FL_(wwHystOn), DeviceValueUOM::DEGREES_R, MAKE_CF_CB(set_wwHystOn));
|
||||
register_device_value(tag, &wwHystOff_, DeviceValueType::INT, FL_(wwHystOff), DeviceValueUOM::DEGREES_R, MAKE_CF_CB(set_wwHystOff));
|
||||
register_device_value(tag,
|
||||
&wwDisinfectionTemp_,
|
||||
DeviceValueType::UINT,
|
||||
nullptr,
|
||||
FL_(wwDisinfectionTemp),
|
||||
DeviceValueUOM::DEGREES,
|
||||
MAKE_CF_CB(set_wwDisinfectionTemp));
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA_WW,
|
||||
&wwCircPump_,
|
||||
DeviceValueType::BOOL,
|
||||
nullptr,
|
||||
FL_(wwCircPump),
|
||||
DeviceValueUOM::NONE,
|
||||
MAKE_CF_CB(set_wwCircPump));
|
||||
register_device_value(tag, &wwCircMode_, DeviceValueType::ENUM, FL_(enum_wwCircMode), FL_(wwCircMode), DeviceValueUOM::NONE, MAKE_CF_CB(set_wwCircMode));
|
||||
} else {
|
||||
register_telegram_type(0x010C, F("IPMStatusMessage"), false, MAKE_PF_CB(process_IPMStatusMessage));
|
||||
register_telegram_type(0x011E, F("IPMTempMessage"), false, MAKE_PF_CB(process_IPMTempMessage));
|
||||
// register_telegram_type(0x0123, F("IPMSetMessage"), false, MAKE_PF_CB(process_IPMSetMessage));
|
||||
register_telegram_type(0x010C, "IPMStatusMessage", false, MAKE_PF_CB(process_IPMStatusMessage));
|
||||
register_telegram_type(0x011E, "IPMTempMessage", false, MAKE_PF_CB(process_IPMTempMessage));
|
||||
// register_telegram_type(0x0123, "IPMSetMessage", false, MAKE_PF_CB(process_IPMSetMessage));
|
||||
type_ = Type::HC;
|
||||
hc_ = device_id - 0x20 + 1;
|
||||
uint8_t tag = DeviceValueTAG::TAG_HC1 + hc_ - 1;
|
||||
register_device_value(tag, &flowTempHc_, DeviceValueType::USHORT, FL_(div10), FL_(flowTempHc), DeviceValueUOM::DEGREES);
|
||||
register_device_value(tag, &status_, DeviceValueType::INT, nullptr, FL_(mixerStatus), DeviceValueUOM::PERCENT);
|
||||
register_device_value(tag, &flowSetTemp_, DeviceValueType::UINT, nullptr, FL_(flowSetTemp), DeviceValueUOM::DEGREES, MAKE_CF_CB(set_flowSetTemp));
|
||||
register_device_value(tag, &pumpStatus_, DeviceValueType::BOOL, nullptr, FL_(pumpStatus), DeviceValueUOM::NONE, MAKE_CF_CB(set_pump));
|
||||
register_device_value(tag, &flowTempVf_, DeviceValueType::USHORT, FL_(div10), FL_(flowTempVf), DeviceValueUOM::DEGREES);
|
||||
register_device_value(tag, &flowTempHc_, DeviceValueType::USHORT, DeviceValueNumOp::DV_NUMOP_DIV10, FL_(flowTempHc), DeviceValueUOM::DEGREES);
|
||||
register_device_value(tag, &status_, DeviceValueType::INT, FL_(mixerStatus), DeviceValueUOM::PERCENT);
|
||||
register_device_value(tag, &flowSetTemp_, DeviceValueType::UINT, FL_(flowSetTemp), DeviceValueUOM::DEGREES, MAKE_CF_CB(set_flowSetTemp));
|
||||
register_device_value(tag, &pumpStatus_, DeviceValueType::BOOL, FL_(pumpStatus), DeviceValueUOM::NONE, MAKE_CF_CB(set_pump));
|
||||
register_device_value(tag, &flowTempVf_, DeviceValueType::USHORT, DeviceValueNumOp::DV_NUMOP_DIV10, FL_(flowTempVf), DeviceValueUOM::DEGREES);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -382,7 +389,7 @@ bool Mixer::set_setValveTime(const char * value, const int8_t id) {
|
||||
|
||||
bool Mixer::set_wwMaxTemp(const char * value, const int8_t id) {
|
||||
uint8_t wwc = device_id() - 0x28;
|
||||
float v = 0;
|
||||
float v;
|
||||
if (!Helpers::value2temperature(value, v)) {
|
||||
return false;
|
||||
}
|
||||
@@ -392,7 +399,7 @@ bool Mixer::set_wwMaxTemp(const char * value, const int8_t id) {
|
||||
|
||||
bool Mixer::set_wwDiffTemp(const char * value, const int8_t id) {
|
||||
uint8_t wwc = device_id() - 0x28;
|
||||
float v = 0;
|
||||
float v;
|
||||
if (!Helpers::value2temperature(value, v)) {
|
||||
return false;
|
||||
}
|
||||
@@ -402,7 +409,7 @@ bool Mixer::set_wwDiffTemp(const char * value, const int8_t id) {
|
||||
|
||||
bool Mixer::set_wwReducedTemp(const char * value, const int8_t id) {
|
||||
uint8_t wwc = device_id() - 0x28;
|
||||
float v = 0;
|
||||
float v;
|
||||
if (!Helpers::value2temperature(value, v)) {
|
||||
return false;
|
||||
}
|
||||
@@ -412,7 +419,7 @@ bool Mixer::set_wwReducedTemp(const char * value, const int8_t id) {
|
||||
|
||||
bool Mixer::set_wwRequiredTemp(const char * value, const int8_t id) {
|
||||
uint8_t wwc = device_id() - 0x28;
|
||||
float v = 0;
|
||||
float v;
|
||||
if (!Helpers::value2temperature(value, v)) {
|
||||
return false;
|
||||
}
|
||||
@@ -421,7 +428,7 @@ bool Mixer::set_wwRequiredTemp(const char * value, const int8_t id) {
|
||||
}
|
||||
|
||||
bool Mixer::set_wwDisinfectionTemp(const char * value, const int8_t id) {
|
||||
float v = 0;
|
||||
float v;
|
||||
if (!Helpers::value2temperature(value, v)) {
|
||||
return false;
|
||||
}
|
||||
@@ -435,7 +442,7 @@ bool Mixer::set_wwDisinfectionTemp(const char * value, const int8_t id) {
|
||||
}
|
||||
|
||||
bool Mixer::set_wwCircPump(const char * value, const int8_t id) {
|
||||
bool v = false;
|
||||
bool v;
|
||||
if (!Helpers::value2bool(value, v)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ namespace emsesp {
|
||||
|
||||
class Mixer : public EMSdevice {
|
||||
public:
|
||||
Mixer(uint8_t device_type, uint8_t device_id, uint8_t product_id, const char * version, const std::string & name, uint8_t flags, uint8_t brand);
|
||||
Mixer(uint8_t device_type, uint8_t device_id, uint8_t product_id, const char * version, const char * name, uint8_t flags, uint8_t brand);
|
||||
|
||||
private:
|
||||
static uuid::log::Logger logger_;
|
||||
|
||||
29
src/devices/pump.cpp
Normal file
29
src/devices/pump.cpp
Normal file
@@ -0,0 +1,29 @@
|
||||
/*
|
||||
* EMS-ESP - https://github.com/emsesp/EMS-ESP
|
||||
* Copyright 2020 Paul Derbyshire
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "pump.h"
|
||||
|
||||
namespace emsesp {
|
||||
|
||||
REGISTER_FACTORY(Pump, EMSdevice::DeviceType::PUMP);
|
||||
|
||||
Pump::Pump(uint8_t device_type, uint8_t device_id, uint8_t product_id, const char * version, const char * name, uint8_t flags, uint8_t brand)
|
||||
: EMSdevice(device_type, device_id, product_id, version, name, flags, brand) {
|
||||
}
|
||||
|
||||
} // namespace emsesp
|
||||
33
src/devices/pump.h
Normal file
33
src/devices/pump.h
Normal file
@@ -0,0 +1,33 @@
|
||||
/*
|
||||
* EMS-ESP - https://github.com/emsesp/EMS-ESP
|
||||
* Copyright 2020 Paul Derbyshire
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef EMSESP_PUMP_H
|
||||
#define EMSESP_PUMP_H
|
||||
|
||||
#include "emsesp.h"
|
||||
|
||||
namespace emsesp {
|
||||
|
||||
class Pump : public EMSdevice {
|
||||
public:
|
||||
Pump(uint8_t device_type, uint8_t device_id, uint8_t product_id, const char * version, const char * name, uint8_t flags, uint8_t brand);
|
||||
};
|
||||
|
||||
} // namespace emsesp
|
||||
|
||||
#endif
|
||||
@@ -24,95 +24,115 @@ REGISTER_FACTORY(Solar, EMSdevice::DeviceType::SOLAR);
|
||||
|
||||
uuid::log::Logger Solar::logger_{F_(solar), uuid::log::Facility::CONSOLE};
|
||||
|
||||
Solar::Solar(uint8_t device_type, uint8_t device_id, uint8_t product_id, const char * version, const std::string & name, uint8_t flags, uint8_t brand)
|
||||
Solar::Solar(uint8_t device_type, uint8_t device_id, uint8_t product_id, const char * version, const char * name, uint8_t flags, uint8_t brand)
|
||||
: EMSdevice(device_type, device_id, product_id, version, name, flags, brand) {
|
||||
// telegram handlers
|
||||
if (flags == EMSdevice::EMS_DEVICE_FLAG_SM10) {
|
||||
register_telegram_type(0x97, F("SM10Monitor"), false, MAKE_PF_CB(process_SM10Monitor));
|
||||
register_telegram_type(0x96, F("SM10Config"), true, MAKE_PF_CB(process_SM10Config));
|
||||
register_telegram_type(0x97, "SM10Monitor", false, MAKE_PF_CB(process_SM10Monitor));
|
||||
register_telegram_type(0x96, "SM10Config", true, MAKE_PF_CB(process_SM10Config));
|
||||
EMSESP::send_read_request(0x97, device_id);
|
||||
}
|
||||
|
||||
if (flags == EMSdevice::EMS_DEVICE_FLAG_SM100) {
|
||||
if (device_id == 0x2A) { // SM100 DHW
|
||||
register_telegram_type(0x07D6, F("SM100wwTemperature"), false, MAKE_PF_CB(process_SM100wwTemperature));
|
||||
register_telegram_type(0x07AA, F("SM100wwStatus"), false, MAKE_PF_CB(process_SM100wwStatus));
|
||||
register_telegram_type(0x07AB, F("SM100wwCommand"), false, MAKE_PF_CB(process_SM100wwCommand));
|
||||
register_telegram_type(0x07A5, F("SM100wwCirc"), true, MAKE_PF_CB(process_SM100wwCirc));
|
||||
register_telegram_type(0x07A6, F("SM100wwParam"), true, MAKE_PF_CB(process_SM100wwParam));
|
||||
register_telegram_type(0x07AE, F("SM100wwKeepWarm"), true, MAKE_PF_CB(process_SM100wwKeepWarm));
|
||||
register_telegram_type(0x07E0, F("SM100wwStatus2"), true, MAKE_PF_CB(process_SM100wwStatus2));
|
||||
register_telegram_type(0x07D6, "SM100wwTemperature", false, MAKE_PF_CB(process_SM100wwTemperature));
|
||||
register_telegram_type(0x07AA, "SM100wwStatus", false, MAKE_PF_CB(process_SM100wwStatus));
|
||||
register_telegram_type(0x07AB, "SM100wwCommand", false, MAKE_PF_CB(process_SM100wwCommand));
|
||||
register_telegram_type(0x07A5, "SM100wwCirc", true, MAKE_PF_CB(process_SM100wwCirc));
|
||||
register_telegram_type(0x07A6, "SM100wwParam", true, MAKE_PF_CB(process_SM100wwParam));
|
||||
register_telegram_type(0x07AE, "SM100wwKeepWarm", true, MAKE_PF_CB(process_SM100wwKeepWarm));
|
||||
register_telegram_type(0x07E0, "SM100wwStatus2", true, MAKE_PF_CB(process_SM100wwStatus2));
|
||||
} else {
|
||||
// F9 is not a telegram type, it's a flag for configure
|
||||
// register_telegram_type(0xF9, F("ParamCfg"), false, MAKE_PF_CB(process_SM100ParamCfg));
|
||||
register_telegram_type(0x0358, F("SM100SystemConfig"), true, MAKE_PF_CB(process_SM100SystemConfig));
|
||||
register_telegram_type(0x035A, F("SM100CircuitConfig"), true, MAKE_PF_CB(process_SM100CircuitConfig));
|
||||
register_telegram_type(0x035D, F("SM100Circuit2Config"), true, MAKE_PF_CB(process_SM100Circuit2Config));
|
||||
register_telegram_type(0x0362, F("SM100Monitor"), false, MAKE_PF_CB(process_SM100Monitor));
|
||||
register_telegram_type(0x0363, F("SM100Monitor2"), false, MAKE_PF_CB(process_SM100Monitor2));
|
||||
register_telegram_type(0x0366, F("SM100Config"), false, MAKE_PF_CB(process_SM100Config));
|
||||
register_telegram_type(0x0364, F("SM100Status"), false, MAKE_PF_CB(process_SM100Status));
|
||||
register_telegram_type(0x036A, F("SM100Status2"), false, MAKE_PF_CB(process_SM100Status2));
|
||||
register_telegram_type(0x0380, F("SM100CollectorConfig"), true, MAKE_PF_CB(process_SM100CollectorConfig));
|
||||
register_telegram_type(0x038E, F("SM100Energy"), true, MAKE_PF_CB(process_SM100Energy));
|
||||
register_telegram_type(0x0391, F("SM100Time"), true, MAKE_PF_CB(process_SM100Time));
|
||||
register_telegram_type(0x035F, F("SM100Config1"), true, MAKE_PF_CB(process_SM100Config1));
|
||||
register_telegram_type(0x035C, F("SM100HeatAssist"), true, MAKE_PF_CB(process_SM100HeatAssist));
|
||||
register_telegram_type(0x0361, F("SM100Differential"), true, MAKE_PF_CB(process_SM100Differential));
|
||||
// register_telegram_type(0xF9, "ParamCfg", false, MAKE_PF_CB(process_SM100ParamCfg));
|
||||
register_telegram_type(0x0358, "SM100SystemConfig", true, MAKE_PF_CB(process_SM100SystemConfig));
|
||||
register_telegram_type(0x035A, "SM100CircuitConfig", true, MAKE_PF_CB(process_SM100CircuitConfig));
|
||||
register_telegram_type(0x035D, "SM100Circuit2Config", true, MAKE_PF_CB(process_SM100Circuit2Config));
|
||||
register_telegram_type(0x0362, "SM100Monitor", false, MAKE_PF_CB(process_SM100Monitor));
|
||||
register_telegram_type(0x0363, "SM100Monitor2", false, MAKE_PF_CB(process_SM100Monitor2));
|
||||
register_telegram_type(0x0366, "SM100Config", false, MAKE_PF_CB(process_SM100Config));
|
||||
register_telegram_type(0x0364, "SM100Status", false, MAKE_PF_CB(process_SM100Status));
|
||||
register_telegram_type(0x036A, "SM100Status2", false, MAKE_PF_CB(process_SM100Status2));
|
||||
register_telegram_type(0x0380, "SM100CollectorConfig", true, MAKE_PF_CB(process_SM100CollectorConfig));
|
||||
register_telegram_type(0x038E, "SM100Energy", true, MAKE_PF_CB(process_SM100Energy));
|
||||
register_telegram_type(0x0391, "SM100Time", true, MAKE_PF_CB(process_SM100Time));
|
||||
register_telegram_type(0x035F, "SM100Config1", true, MAKE_PF_CB(process_SM100Config1));
|
||||
register_telegram_type(0x035C, "SM100HeatAssist", true, MAKE_PF_CB(process_SM100HeatAssist));
|
||||
register_telegram_type(0x0361, "SM100Differential", true, MAKE_PF_CB(process_SM100Differential));
|
||||
}
|
||||
}
|
||||
|
||||
if (flags == EMSdevice::EMS_DEVICE_FLAG_ISM) {
|
||||
register_telegram_type(0x0103, F("ISM1StatusMessage"), true, MAKE_PF_CB(process_ISM1StatusMessage));
|
||||
register_telegram_type(0x0101, F("ISM1Set"), true, MAKE_PF_CB(process_ISM1Set));
|
||||
register_telegram_type(0x0104, F("ISM2StatusMessage"), false, MAKE_PF_CB(process_ISM2StatusMessage));
|
||||
register_telegram_type(0x0103, "ISM1StatusMessage", true, MAKE_PF_CB(process_ISM1StatusMessage));
|
||||
register_telegram_type(0x0101, "ISM1Set", true, MAKE_PF_CB(process_ISM1Set));
|
||||
register_telegram_type(0x0104, "ISM2StatusMessage", false, MAKE_PF_CB(process_ISM2StatusMessage));
|
||||
}
|
||||
|
||||
// device values...
|
||||
// special case for a SM100 DHW device_id with 0x2A where it's not actual a solar module
|
||||
if (device_id == 0x2A) {
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA_WW, &wwTemp_1_, DeviceValueType::USHORT, FL_(div10), FL_(wwTemp1), DeviceValueUOM::DEGREES);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA_WW, &wwTemp_3_, DeviceValueType::USHORT, FL_(div10), FL_(wwTemp3), DeviceValueUOM::DEGREES);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA_WW, &wwTemp_4_, DeviceValueType::USHORT, FL_(div10), FL_(wwTemp4), DeviceValueUOM::DEGREES);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA_WW, &wwTemp_5_, DeviceValueType::USHORT, FL_(div10), FL_(wwTemp5), DeviceValueUOM::DEGREES);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA_WW, &wwTemp_7_, DeviceValueType::USHORT, FL_(div10), FL_(wwTemp7), DeviceValueUOM::DEGREES);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA_WW, &wwPump_, DeviceValueType::BOOL, nullptr, FL_(wwPump), DeviceValueUOM::NONE);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA_WW,
|
||||
&wwTemp_1_,
|
||||
DeviceValueType::USHORT,
|
||||
DeviceValueNumOp::DV_NUMOP_DIV10,
|
||||
FL_(wwTemp1),
|
||||
DeviceValueUOM::DEGREES);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA_WW,
|
||||
&wwTemp_3_,
|
||||
DeviceValueType::USHORT,
|
||||
DeviceValueNumOp::DV_NUMOP_DIV10,
|
||||
FL_(wwTemp3),
|
||||
DeviceValueUOM::DEGREES);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA_WW,
|
||||
&wwTemp_4_,
|
||||
DeviceValueType::USHORT,
|
||||
DeviceValueNumOp::DV_NUMOP_DIV10,
|
||||
FL_(wwTemp4),
|
||||
DeviceValueUOM::DEGREES);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA_WW,
|
||||
&wwTemp_5_,
|
||||
DeviceValueType::USHORT,
|
||||
DeviceValueNumOp::DV_NUMOP_DIV10,
|
||||
FL_(wwTemp5),
|
||||
DeviceValueUOM::DEGREES);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA_WW,
|
||||
&wwTemp_7_,
|
||||
DeviceValueType::USHORT,
|
||||
DeviceValueNumOp::DV_NUMOP_DIV10,
|
||||
FL_(wwTemp7),
|
||||
DeviceValueUOM::DEGREES);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA_WW, &wwPump_, DeviceValueType::BOOL, FL_(wwPump), DeviceValueUOM::NONE);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA_WW,
|
||||
&wwMaxTemp_,
|
||||
DeviceValueType::UINT,
|
||||
nullptr,
|
||||
FL_(wwMaxTemp),
|
||||
DeviceValueUOM::DEGREES,
|
||||
MAKE_CF_CB(set_wwMaxTemp));
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA_WW,
|
||||
&wwSelTemp_,
|
||||
DeviceValueType::UINT,
|
||||
nullptr,
|
||||
FL_(wwSelTemp),
|
||||
DeviceValueUOM::DEGREES,
|
||||
MAKE_CF_CB(set_wwSelTemp));
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA_WW,
|
||||
&wwRedTemp_,
|
||||
DeviceValueType::UINT,
|
||||
nullptr,
|
||||
FL_(wwRedTemp),
|
||||
DeviceValueUOM::DEGREES,
|
||||
MAKE_CF_CB(set_wwRedTemp));
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA_WW,
|
||||
&wwDailyTemp_,
|
||||
DeviceValueType::UINT,
|
||||
nullptr,
|
||||
FL_(wwDailyTemp),
|
||||
DeviceValueUOM::DEGREES,
|
||||
MAKE_CF_CB(set_wwDailyTemp));
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA_WW,
|
||||
&wwDisinfectionTemp_,
|
||||
DeviceValueType::UINT,
|
||||
nullptr,
|
||||
FL_(wwDisinfectionTemp),
|
||||
DeviceValueUOM::DEGREES,
|
||||
MAKE_CF_CB(set_wwDisinfectionTemp));
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA_WW, &wwCirc_, DeviceValueType::BOOL, nullptr, FL_(wwCirc), DeviceValueUOM::NONE, MAKE_CF_CB(set_wwCirc));
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA_WW, &wwCirc_, DeviceValueType::BOOL, FL_(wwCirc), DeviceValueUOM::NONE, MAKE_CF_CB(set_wwCirc));
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA_WW,
|
||||
&wwCircMode_,
|
||||
DeviceValueType::ENUM,
|
||||
@@ -123,181 +143,238 @@ Solar::Solar(uint8_t device_type, uint8_t device_id, uint8_t product_id, const c
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA_WW,
|
||||
&wwKeepWarm_,
|
||||
DeviceValueType::BOOL,
|
||||
nullptr,
|
||||
FL_(wwKeepWarm),
|
||||
DeviceValueUOM::NONE,
|
||||
MAKE_CF_CB(set_wwKeepWarm));
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA_WW, &wwStatus2_, DeviceValueType::ENUM, FL_(enum_wwStatus2), FL_(wwStatus2), DeviceValueUOM::NONE);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA_WW, &wwPumpMod_, DeviceValueType::UINT, nullptr, FL_(wwPumpMod), DeviceValueUOM::PERCENT);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA_WW, &wwFlow_, DeviceValueType::UINT, FL_(div10), FL_(wwFlow), DeviceValueUOM::LMIN);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA_WW, &wwPumpMod_, DeviceValueType::UINT, FL_(wwPumpMod), DeviceValueUOM::PERCENT);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA_WW,
|
||||
&wwFlow_,
|
||||
DeviceValueType::UINT,
|
||||
DeviceValueNumOp::DV_NUMOP_DIV10,
|
||||
FL_(wwFlow),
|
||||
DeviceValueUOM::LMIN);
|
||||
return;
|
||||
}
|
||||
|
||||
// common solar values for all modules (except dhw)
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &collectorTemp_, DeviceValueType::SHORT, FL_(div10), FL_(collectorTemp), DeviceValueUOM::DEGREES);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &cylBottomTemp_, DeviceValueType::SHORT, FL_(div10), FL_(cylBottomTemp), DeviceValueUOM::DEGREES);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &solarPump_, DeviceValueType::BOOL, nullptr, FL_(solarPump), DeviceValueUOM::NONE);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &pumpWorkTime_, DeviceValueType::TIME, nullptr, FL_(pumpWorkTime), DeviceValueUOM::MINUTES);
|
||||
register_device_value(
|
||||
DeviceValueTAG::TAG_DEVICE_DATA, &cylMaxTemp_, DeviceValueType::UINT, nullptr, FL_(cylMaxTemp), DeviceValueUOM::DEGREES, MAKE_CF_CB(set_cylMaxTemp));
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &collectorShutdown_, DeviceValueType::BOOL, nullptr, FL_(collectorShutdown), DeviceValueUOM::NONE);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &cylHeated_, DeviceValueType::BOOL, nullptr, FL_(cylHeated), DeviceValueUOM::NONE);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA,
|
||||
&collectorTemp_,
|
||||
DeviceValueType::SHORT,
|
||||
DeviceValueNumOp::DV_NUMOP_DIV10,
|
||||
FL_(collectorTemp),
|
||||
DeviceValueUOM::DEGREES);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA,
|
||||
&cylBottomTemp_,
|
||||
DeviceValueType::SHORT,
|
||||
DeviceValueNumOp::DV_NUMOP_DIV10,
|
||||
FL_(cylBottomTemp),
|
||||
DeviceValueUOM::DEGREES);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &solarPump_, DeviceValueType::BOOL, FL_(solarPump), DeviceValueUOM::NONE);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &pumpWorkTime_, DeviceValueType::TIME, FL_(pumpWorkTime), DeviceValueUOM::MINUTES);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &cylMaxTemp_, DeviceValueType::UINT, FL_(cylMaxTemp), DeviceValueUOM::DEGREES, MAKE_CF_CB(set_cylMaxTemp));
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &collectorShutdown_, DeviceValueType::BOOL, FL_(collectorShutdown), DeviceValueUOM::NONE);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &cylHeated_, DeviceValueType::BOOL, FL_(cylHeated), DeviceValueUOM::NONE);
|
||||
|
||||
// values per device flag
|
||||
if (flags == EMSdevice::EMS_DEVICE_FLAG_SM10) {
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &solarPumpMod_, DeviceValueType::UINT, nullptr, FL_(solarPumpMod), DeviceValueUOM::PERCENT);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &solarPumpMod_, DeviceValueType::UINT, FL_(solarPumpMod), DeviceValueUOM::PERCENT);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA,
|
||||
&solarPumpMinMod_,
|
||||
DeviceValueType::UINT,
|
||||
nullptr,
|
||||
FL_(pumpMinMod),
|
||||
DeviceValueUOM::PERCENT,
|
||||
MAKE_CF_CB(set_PumpMinMod));
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA,
|
||||
&solarPumpTurnonDiff_,
|
||||
DeviceValueType::UINT,
|
||||
nullptr,
|
||||
FL_(solarPumpTurnonDiff),
|
||||
DeviceValueUOM::DEGREES_R,
|
||||
MAKE_CF_CB(set_TurnonDiff));
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA,
|
||||
&solarPumpTurnoffDiff_,
|
||||
DeviceValueType::UINT,
|
||||
nullptr,
|
||||
FL_(solarPumpTurnoffDiff),
|
||||
DeviceValueUOM::DEGREES_R,
|
||||
MAKE_CF_CB(set_TurnoffDiff));
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &solarPower_, DeviceValueType::SHORT, nullptr, FL_(solarPower), DeviceValueUOM::W);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &energyLastHour_, DeviceValueType::ULONG, FL_(div10), FL_(energyLastHour), DeviceValueUOM::WH);
|
||||
register_device_value(
|
||||
DeviceValueTAG::TAG_DEVICE_DATA, &maxFlow_, DeviceValueType::UINT, FL_(div10), FL_(maxFlow), DeviceValueUOM::LMIN, MAKE_CF_CB(set_SM10MaxFlow));
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &solarPower_, DeviceValueType::SHORT, FL_(solarPower), DeviceValueUOM::W);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA,
|
||||
&energyLastHour_,
|
||||
DeviceValueType::ULONG,
|
||||
DeviceValueNumOp::DV_NUMOP_DIV10,
|
||||
FL_(energyLastHour),
|
||||
DeviceValueUOM::WH);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA,
|
||||
&maxFlow_,
|
||||
DeviceValueType::UINT,
|
||||
DeviceValueNumOp::DV_NUMOP_DIV10,
|
||||
FL_(maxFlow),
|
||||
DeviceValueUOM::LMIN,
|
||||
MAKE_CF_CB(set_SM10MaxFlow));
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA_WW,
|
||||
&wwMinTemp_,
|
||||
DeviceValueType::UINT,
|
||||
nullptr,
|
||||
FL_(wwMinTemp),
|
||||
DeviceValueUOM::DEGREES,
|
||||
MAKE_CF_CB(set_wwMinTemp));
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA,
|
||||
&solarIsEnabled_,
|
||||
DeviceValueType::BOOL,
|
||||
nullptr,
|
||||
FL_(solarIsEnabled),
|
||||
DeviceValueUOM::NONE,
|
||||
MAKE_CF_CB(set_solarEnabled));
|
||||
|
||||
/* unknown values for testing and logging. Used by MichaelDvP
|
||||
/*
|
||||
// unknown values for testing and logging. Used by MichaelDvP
|
||||
register_device_value(
|
||||
DeviceValueTAG::TAG_DEVICE_DATA, &setting3_, DeviceValueType::UINT, nullptr, FL_(setting3), DeviceValueUOM::NONE, MAKE_CF_CB(set_CollectorMaxTemp));
|
||||
DeviceValueTAG::TAG_DEVICE_DATA, &setting3_, DeviceValueType::UINT, FL_(setting3), DeviceValueUOM::NONE, MAKE_CF_CB(set_CollectorMaxTemp));
|
||||
register_device_value(
|
||||
DeviceValueTAG::TAG_DEVICE_DATA, &setting4_, DeviceValueType::UINT, nullptr, FL_(setting4), DeviceValueUOM::NONE, MAKE_CF_CB(set_CollectorMinTemp));
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &data11_, DeviceValueType::UINT, nullptr, FL_(data11), DeviceValueUOM::NONE);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &data12_, DeviceValueType::UINT, nullptr, FL_(data12), DeviceValueUOM::NONE);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &data1_, DeviceValueType::UINT, nullptr, FL_(data1), DeviceValueUOM::NONE);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &data0_, DeviceValueType::UINT, nullptr, FL_(data0), DeviceValueUOM::NONE);
|
||||
DeviceValueTAG::TAG_DEVICE_DATA, &setting4_, DeviceValueType::UINT, FL_(setting4), DeviceValueUOM::NONE, MAKE_CF_CB(set_CollectorMinTemp));
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &data11_, DeviceValueType::UINT, FL_(data11), DeviceValueUOM::NONE);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &data12_, DeviceValueType::UINT, FL_(data12), DeviceValueUOM::NONE);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &data1_, DeviceValueType::UINT, FL_(data1), DeviceValueUOM::NONE);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &data0_, DeviceValueType::UINT, FL_(data0), DeviceValueUOM::NONE);
|
||||
*/
|
||||
}
|
||||
if (flags == EMSdevice::EMS_DEVICE_FLAG_ISM) {
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &cylMiddleTemp_, DeviceValueType::SHORT, FL_(div10), FL_(cylMiddleTemp), DeviceValueUOM::DEGREES);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &retHeatAssist_, DeviceValueType::SHORT, FL_(div10), FL_(retHeatAssist), DeviceValueUOM::DEGREES);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &m1Valve_, DeviceValueType::BOOL, nullptr, FL_(m1Valve), DeviceValueUOM::NONE);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &energyLastHour_, DeviceValueType::ULONG, FL_(div10), FL_(energyLastHour), DeviceValueUOM::WH);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA,
|
||||
&cylMiddleTemp_,
|
||||
DeviceValueType::SHORT,
|
||||
DeviceValueNumOp::DV_NUMOP_DIV10,
|
||||
FL_(cylMiddleTemp),
|
||||
DeviceValueUOM::DEGREES);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA,
|
||||
&retHeatAssist_,
|
||||
DeviceValueType::SHORT,
|
||||
DeviceValueNumOp::DV_NUMOP_DIV10,
|
||||
FL_(retHeatAssist),
|
||||
DeviceValueUOM::DEGREES);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &m1Valve_, DeviceValueType::BOOL, FL_(m1Valve), DeviceValueUOM::NONE);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA,
|
||||
&energyLastHour_,
|
||||
DeviceValueType::ULONG,
|
||||
DeviceValueNumOp::DV_NUMOP_DIV10,
|
||||
FL_(energyLastHour),
|
||||
DeviceValueUOM::WH);
|
||||
}
|
||||
|
||||
if (flags == EMSdevice::EMS_DEVICE_FLAG_SM100) {
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &solarPumpMod_, DeviceValueType::UINT, nullptr, FL_(solarPumpMod), DeviceValueUOM::PERCENT);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &solarPumpMod_, DeviceValueType::UINT, FL_(solarPumpMod), DeviceValueUOM::PERCENT);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA,
|
||||
&solarPumpMinMod_,
|
||||
DeviceValueType::UINT,
|
||||
FL_(mul5),
|
||||
DeviceValueNumOp::DV_NUMOP_MUL5,
|
||||
FL_(pumpMinMod),
|
||||
DeviceValueUOM::PERCENT,
|
||||
MAKE_CF_CB(set_PumpMinMod));
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA,
|
||||
&solarPumpTurnonDiff_,
|
||||
DeviceValueType::UINT,
|
||||
FL_(div10),
|
||||
DeviceValueNumOp::DV_NUMOP_DIV10,
|
||||
FL_(solarPumpTurnonDiff),
|
||||
DeviceValueUOM::DEGREES,
|
||||
MAKE_CF_CB(set_TurnonDiff));
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA,
|
||||
&solarPumpTurnoffDiff_,
|
||||
DeviceValueType::UINT,
|
||||
FL_(div10),
|
||||
DeviceValueNumOp::DV_NUMOP_DIV10,
|
||||
FL_(solarPumpTurnoffDiff),
|
||||
DeviceValueUOM::DEGREES,
|
||||
MAKE_CF_CB(set_TurnoffDiff));
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &collector2Temp_, DeviceValueType::SHORT, FL_(div10), FL_(collector2Temp), DeviceValueUOM::DEGREES);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &cylMiddleTemp_, DeviceValueType::SHORT, FL_(div10), FL_(cylMiddleTemp), DeviceValueUOM::DEGREES);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &retHeatAssist_, DeviceValueType::SHORT, FL_(div10), FL_(retHeatAssist), DeviceValueUOM::DEGREES);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &m1Valve_, DeviceValueType::BOOL, nullptr, FL_(m1Valve), DeviceValueUOM::NONE);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &m1Power_, DeviceValueType::UINT, nullptr, FL_(m1Power), DeviceValueUOM::PERCENT);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &solarPump2_, DeviceValueType::BOOL, nullptr, FL_(solarPump2), DeviceValueUOM::NONE);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &solarPump2Mod_, DeviceValueType::UINT, nullptr, FL_(solarPump2Mod), DeviceValueUOM::PERCENT);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &cylBottomTemp2_, DeviceValueType::SHORT, FL_(div10), FL_(cyl2BottomTemp), DeviceValueUOM::DEGREES);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA,
|
||||
&collector2Temp_,
|
||||
DeviceValueType::SHORT,
|
||||
DeviceValueNumOp::DV_NUMOP_DIV10,
|
||||
FL_(collector2Temp),
|
||||
DeviceValueUOM::DEGREES);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA,
|
||||
&cylMiddleTemp_,
|
||||
DeviceValueType::SHORT,
|
||||
DeviceValueNumOp::DV_NUMOP_DIV10,
|
||||
FL_(cylMiddleTemp),
|
||||
DeviceValueUOM::DEGREES);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA,
|
||||
&retHeatAssist_,
|
||||
DeviceValueType::SHORT,
|
||||
DeviceValueNumOp::DV_NUMOP_DIV10,
|
||||
FL_(retHeatAssist),
|
||||
DeviceValueUOM::DEGREES);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &m1Valve_, DeviceValueType::BOOL, FL_(m1Valve), DeviceValueUOM::NONE);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &m1Power_, DeviceValueType::UINT, FL_(m1Power), DeviceValueUOM::PERCENT);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &solarPump2_, DeviceValueType::BOOL, FL_(solarPump2), DeviceValueUOM::NONE);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &solarPump2Mod_, DeviceValueType::UINT, FL_(solarPump2Mod), DeviceValueUOM::PERCENT);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA,
|
||||
&cylBottomTemp2_,
|
||||
DeviceValueType::SHORT,
|
||||
DeviceValueNumOp::DV_NUMOP_DIV10,
|
||||
FL_(cyl2BottomTemp),
|
||||
DeviceValueUOM::DEGREES);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA,
|
||||
&heatExchangerTemp_,
|
||||
DeviceValueType::SHORT,
|
||||
FL_(div10),
|
||||
DeviceValueNumOp::DV_NUMOP_DIV10,
|
||||
FL_(heatExchangerTemp),
|
||||
DeviceValueUOM::DEGREES);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &cylPumpMod_, DeviceValueType::UINT, nullptr, FL_(cylPumpMod), DeviceValueUOM::PERCENT);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &valveStatus_, DeviceValueType::BOOL, nullptr, FL_(valveStatus), DeviceValueUOM::NONE);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &cylHeated_, DeviceValueType::BOOL, nullptr, FL_(cylHeated), DeviceValueUOM::NONE);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &collectorShutdown_, DeviceValueType::BOOL, nullptr, FL_(collectorShutdown), DeviceValueUOM::NONE);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &cylPumpMod_, DeviceValueType::UINT, FL_(cylPumpMod), DeviceValueUOM::PERCENT);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &valveStatus_, DeviceValueType::BOOL, FL_(valveStatus), DeviceValueUOM::NONE);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &cylHeated_, DeviceValueType::BOOL, FL_(cylHeated), DeviceValueUOM::NONE);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &collectorShutdown_, DeviceValueType::BOOL, FL_(collectorShutdown), DeviceValueUOM::NONE);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA,
|
||||
&collectorMaxTemp_,
|
||||
DeviceValueType::UINT,
|
||||
nullptr,
|
||||
FL_(collectorMaxTemp),
|
||||
DeviceValueUOM::DEGREES,
|
||||
MAKE_CF_CB(set_CollectorMaxTemp));
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA,
|
||||
&collectorMinTemp_,
|
||||
DeviceValueType::UINT,
|
||||
nullptr,
|
||||
FL_(collectorMinTemp),
|
||||
DeviceValueUOM::DEGREES,
|
||||
MAKE_CF_CB(set_CollectorMinTemp));
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &energyLastHour_, DeviceValueType::ULONG, FL_(div10), FL_(energyLastHour), DeviceValueUOM::WH);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &energyToday_, DeviceValueType::ULONG, nullptr, FL_(energyToday), DeviceValueUOM::WH);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &energyTotal_, DeviceValueType::ULONG, FL_(div10), FL_(energyTotal), DeviceValueUOM::KWH);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &pump2WorkTime_, DeviceValueType::TIME, nullptr, FL_(pump2WorkTime), DeviceValueUOM::MINUTES);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &m1WorkTime_, DeviceValueType::TIME, nullptr, FL_(m1WorkTime), DeviceValueUOM::MINUTES);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA,
|
||||
&energyLastHour_,
|
||||
DeviceValueType::ULONG,
|
||||
DeviceValueNumOp::DV_NUMOP_DIV10,
|
||||
FL_(energyLastHour),
|
||||
DeviceValueUOM::WH);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &energyToday_, DeviceValueType::ULONG, FL_(energyToday), DeviceValueUOM::WH);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA,
|
||||
&energyTotal_,
|
||||
DeviceValueType::ULONG,
|
||||
DeviceValueNumOp::DV_NUMOP_DIV10,
|
||||
FL_(energyTotal),
|
||||
DeviceValueUOM::KWH);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &pump2WorkTime_, DeviceValueType::TIME, FL_(pump2WorkTime), DeviceValueUOM::MINUTES);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &m1WorkTime_, DeviceValueType::TIME, FL_(m1WorkTime), DeviceValueUOM::MINUTES);
|
||||
// register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &cyl2MaxTemp_, DeviceValueType::UINT, nullptr, FL_(cyl2MaxTemp), DeviceValueUOM::DEGREES, MAKE_CF_CB(set_cyl2MaxTemp));
|
||||
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA,
|
||||
&heatTransferSystem_,
|
||||
DeviceValueType::BOOL,
|
||||
nullptr,
|
||||
FL_(heatTransferSystem),
|
||||
DeviceValueUOM::NONE,
|
||||
MAKE_CF_CB(set_heatTransferSystem));
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA,
|
||||
&externalCyl_,
|
||||
DeviceValueType::BOOL,
|
||||
nullptr,
|
||||
FL_(externalCyl),
|
||||
DeviceValueUOM::NONE,
|
||||
MAKE_CF_CB(set_externalCyl));
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA,
|
||||
&thermalDisinfect_,
|
||||
DeviceValueType::BOOL,
|
||||
nullptr,
|
||||
FL_(thermalDisinfect),
|
||||
DeviceValueUOM::NONE,
|
||||
MAKE_CF_CB(set_thermalDisinfect));
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA,
|
||||
&heatMetering_,
|
||||
DeviceValueType::BOOL,
|
||||
nullptr,
|
||||
FL_(heatMetering),
|
||||
DeviceValueUOM::NONE,
|
||||
MAKE_CF_CB(set_heatMetering));
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA,
|
||||
&solarIsEnabled_,
|
||||
DeviceValueType::BOOL,
|
||||
nullptr,
|
||||
FL_(activated),
|
||||
DeviceValueUOM::NONE,
|
||||
MAKE_CF_CB(set_solarEnabled));
|
||||
@@ -314,7 +391,6 @@ Solar::Solar(uint8_t device_type, uint8_t device_id, uint8_t product_id, const c
|
||||
DeviceValueTAG::TAG_DEVICE_DATA,
|
||||
&solarPumpKick_,
|
||||
DeviceValueType::BOOL,
|
||||
nullptr,
|
||||
FL_(solarPumpKick),
|
||||
DeviceValueUOM::NONE,
|
||||
MAKE_CF_CB(set_solarPumpKick));
|
||||
@@ -322,7 +398,6 @@ Solar::Solar(uint8_t device_type, uint8_t device_id, uint8_t product_id, const c
|
||||
DeviceValueTAG::TAG_DEVICE_DATA,
|
||||
&plainWaterMode_,
|
||||
DeviceValueType::BOOL,
|
||||
nullptr,
|
||||
FL_(plainWaterMode),
|
||||
DeviceValueUOM::NONE,
|
||||
MAKE_CF_CB(set_plainWaterMode));
|
||||
@@ -330,7 +405,6 @@ Solar::Solar(uint8_t device_type, uint8_t device_id, uint8_t product_id, const c
|
||||
DeviceValueTAG::TAG_DEVICE_DATA,
|
||||
&doubleMatchFlow_,
|
||||
DeviceValueType::BOOL,
|
||||
nullptr,
|
||||
FL_(doubleMatchFlow),
|
||||
DeviceValueUOM::NONE,
|
||||
MAKE_CF_CB(set_doubleMatchFlow));
|
||||
@@ -338,21 +412,20 @@ Solar::Solar(uint8_t device_type, uint8_t device_id, uint8_t product_id, const c
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA,
|
||||
&solarPump2MinMod_,
|
||||
DeviceValueType::UINT,
|
||||
nullptr,
|
||||
FL_(pump2MinMod),
|
||||
DeviceValueUOM::PERCENT,
|
||||
MAKE_CF_CB(set_Pump2MinMod));
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA,
|
||||
&solarPump2TurnonDiff_,
|
||||
DeviceValueType::UINT,
|
||||
FL_(div10),
|
||||
DeviceValueNumOp::DV_NUMOP_DIV10,
|
||||
FL_(solarPump2TurnonDiff),
|
||||
DeviceValueUOM::DEGREES,
|
||||
MAKE_CF_CB(set_TurnonDiff2));
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA,
|
||||
&solarPump2TurnoffDiff_,
|
||||
DeviceValueType::UINT,
|
||||
FL_(div10),
|
||||
DeviceValueNumOp::DV_NUMOP_DIV10,
|
||||
FL_(solarPump2TurnoffDiff),
|
||||
DeviceValueUOM::DEGREES,
|
||||
MAKE_CF_CB(set_TurnoffDiff2));
|
||||
@@ -360,7 +433,6 @@ Solar::Solar(uint8_t device_type, uint8_t device_id, uint8_t product_id, const c
|
||||
DeviceValueTAG::TAG_DEVICE_DATA,
|
||||
&solarPump2Kick_,
|
||||
DeviceValueType::BOOL,
|
||||
nullptr,
|
||||
FL_(solarPump2Kick),
|
||||
DeviceValueUOM::NONE,
|
||||
MAKE_CF_CB(set_solarPump2Kick));
|
||||
@@ -369,14 +441,13 @@ Solar::Solar(uint8_t device_type, uint8_t device_id, uint8_t product_id, const c
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA,
|
||||
&climateZone_,
|
||||
DeviceValueType::UINT,
|
||||
nullptr,
|
||||
FL_(climateZone),
|
||||
DeviceValueUOM::NONE,
|
||||
MAKE_CF_CB(set_climateZone)); // climate zone identifier
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA,
|
||||
&collector1Area_,
|
||||
DeviceValueType::USHORT,
|
||||
FL_(div10),
|
||||
DeviceValueNumOp::DV_NUMOP_DIV10,
|
||||
FL_(collector1Area),
|
||||
DeviceValueUOM::SQM,
|
||||
MAKE_CF_CB(set_collector1Area)); // Area of collector field 1
|
||||
@@ -390,7 +461,7 @@ Solar::Solar(uint8_t device_type, uint8_t device_id, uint8_t product_id, const c
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA,
|
||||
&collector2Area_,
|
||||
DeviceValueType::USHORT,
|
||||
FL_(div10),
|
||||
DeviceValueNumOp::DV_NUMOP_DIV10,
|
||||
FL_(collector2Area),
|
||||
DeviceValueUOM::SQM,
|
||||
MAKE_CF_CB(set_collector2Area)); // Area of collector field 2
|
||||
@@ -408,11 +479,31 @@ Solar::Solar(uint8_t device_type, uint8_t device_id, uint8_t product_id, const c
|
||||
FL_(cylPriority),
|
||||
DeviceValueUOM::NONE,
|
||||
MAKE_CF_CB(set_cylPriority));
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &heatCntFlowTemp_, DeviceValueType::USHORT, FL_(div10), FL_(heatCntFlowTemp), DeviceValueUOM::DEGREES);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &heatCntRetTemp_, DeviceValueType::USHORT, FL_(div10), FL_(heatCntRetTemp), DeviceValueUOM::DEGREES);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &heatCnt_, DeviceValueType::UINT, nullptr, FL_(heatCnt), DeviceValueUOM::NONE);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &swapFlowTemp_, DeviceValueType::USHORT, FL_(div10), FL_(swapFlowTemp), DeviceValueUOM::DEGREES);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &swapRetTemp_, DeviceValueType::USHORT, FL_(div10), FL_(swapRetTemp), DeviceValueUOM::DEGREES);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA,
|
||||
&heatCntFlowTemp_,
|
||||
DeviceValueType::USHORT,
|
||||
DeviceValueNumOp::DV_NUMOP_DIV10,
|
||||
FL_(heatCntFlowTemp),
|
||||
DeviceValueUOM::DEGREES);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA,
|
||||
&heatCntRetTemp_,
|
||||
DeviceValueType::USHORT,
|
||||
DeviceValueNumOp::DV_NUMOP_DIV10,
|
||||
FL_(heatCntRetTemp),
|
||||
DeviceValueUOM::DEGREES);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &heatCnt_, DeviceValueType::UINT, FL_(heatCnt), DeviceValueUOM::NONE);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA,
|
||||
&swapFlowTemp_,
|
||||
DeviceValueType::USHORT,
|
||||
DeviceValueNumOp::DV_NUMOP_DIV10,
|
||||
FL_(swapFlowTemp),
|
||||
DeviceValueUOM::DEGREES);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA,
|
||||
&swapRetTemp_,
|
||||
DeviceValueType::USHORT,
|
||||
DeviceValueNumOp::DV_NUMOP_DIV10,
|
||||
FL_(swapRetTemp),
|
||||
DeviceValueUOM::DEGREES);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -573,7 +664,7 @@ void Solar::process_SM100ParamCfg(std::shared_ptr<const Telegram> telegram) {
|
||||
telegram->read_value(max, 13);
|
||||
telegram->read_value(cur, 17);
|
||||
|
||||
// LOG_DEBUG(F("SM100ParamCfg param=0x%04X, offset=%d, min=%d, default=%d, max=%d, current=%d"), t_id, of, min, def, max, cur));
|
||||
// LOG_DEBUG("SM100ParamCfg param=0x%04X, offset=%d, min=%d, default=%d, max=%d, current=%d", t_id, of, min, def, max, cur));
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -25,7 +25,7 @@ namespace emsesp {
|
||||
|
||||
class Solar : public EMSdevice {
|
||||
public:
|
||||
Solar(uint8_t device_type, uint8_t device_id, uint8_t product_id, const char * version, const std::string & name, uint8_t flags, uint8_t brand);
|
||||
Solar(uint8_t device_type, uint8_t device_id, uint8_t product_id, const char * version, const char * name, uint8_t flags, uint8_t brand);
|
||||
|
||||
private:
|
||||
static uuid::log::Logger logger_;
|
||||
|
||||
@@ -22,16 +22,21 @@ namespace emsesp {
|
||||
|
||||
REGISTER_FACTORY(Switch, EMSdevice::DeviceType::SWITCH);
|
||||
|
||||
Switch::Switch(uint8_t device_type, uint8_t device_id, uint8_t product_id, const char * version, const std::string & name, uint8_t flags, uint8_t brand)
|
||||
Switch::Switch(uint8_t device_type, uint8_t device_id, uint8_t product_id, const char * version, const char * name, uint8_t flags, uint8_t brand)
|
||||
: EMSdevice(device_type, device_id, product_id, version, name, flags, brand) {
|
||||
// WM10 module, device_id 0x11
|
||||
register_telegram_type(0x9C, F("WM10MonitorMessage"), false, MAKE_PF_CB(process_WM10MonitorMessage));
|
||||
register_telegram_type(0x9D, F("WM10SetMessage"), false, MAKE_PF_CB(process_WM10SetMessage));
|
||||
register_telegram_type(0x1E, F("WM10TempMessage"), false, MAKE_PF_CB(process_WM10TempMessage));
|
||||
register_telegram_type(0x9C, "WM10MonitorMessage", false, MAKE_PF_CB(process_WM10MonitorMessage));
|
||||
register_telegram_type(0x9D, "WM10SetMessage", false, MAKE_PF_CB(process_WM10SetMessage));
|
||||
register_telegram_type(0x1E, "WM10TempMessage", false, MAKE_PF_CB(process_WM10TempMessage));
|
||||
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &activated_, DeviceValueType::BOOL, nullptr, FL_(activated), DeviceValueUOM::NONE);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &flowTempHc_, DeviceValueType::USHORT, FL_(div10), FL_(flowTempHc), DeviceValueUOM::DEGREES);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &status_, DeviceValueType::INT, nullptr, FL_(status), DeviceValueUOM::NONE);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &activated_, DeviceValueType::BOOL, FL_(activated), DeviceValueUOM::NONE);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA,
|
||||
&flowTempHc_,
|
||||
DeviceValueType::USHORT,
|
||||
DeviceValueNumOp::DV_NUMOP_DIV10,
|
||||
FL_(flowTempHc),
|
||||
DeviceValueUOM::DEGREES);
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &status_, DeviceValueType::INT, FL_(status), DeviceValueUOM::NONE);
|
||||
}
|
||||
|
||||
// message 0x9D switch on/off
|
||||
|
||||
@@ -25,7 +25,7 @@ namespace emsesp {
|
||||
|
||||
class Switch : public EMSdevice {
|
||||
public:
|
||||
Switch(uint8_t device_type, uint8_t device_id, uint8_t product_id, const char * version, const std::string & name, uint8_t flags, uint8_t brand);
|
||||
Switch(uint8_t device_type, uint8_t device_id, uint8_t product_id, const char * version, const char * name, uint8_t flags, uint8_t brand);
|
||||
|
||||
private:
|
||||
void process_WM10SetMessage(std::shared_ptr<const Telegram> telegram);
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -25,7 +25,7 @@ namespace emsesp {
|
||||
|
||||
class Thermostat : public EMSdevice {
|
||||
public:
|
||||
Thermostat(uint8_t device_type, uint8_t device_id, uint8_t product_id, const char * version, const std::string & name, uint8_t flags, uint8_t brand);
|
||||
Thermostat(uint8_t device_type, uint8_t device_id, uint8_t product_id, const char * version, const char * name, uint8_t flags, uint8_t brand);
|
||||
class HeatingCircuit {
|
||||
public:
|
||||
HeatingCircuit(const uint8_t hc_num, const uint8_t model)
|
||||
@@ -84,10 +84,11 @@ class Thermostat : public EMSdevice {
|
||||
uint8_t climate;
|
||||
uint8_t switchonoptimization;
|
||||
uint8_t statusbyte; // from RC300monitor
|
||||
|
||||
// RC 10
|
||||
uint8_t reducehours; // night reduce duration
|
||||
uint16_t reduceminutes; // remaining minutes to night->day
|
||||
// FW100 temperature
|
||||
uint8_t roomsensor; // 1-intern, 2-extern, 3-autoselect the lower value
|
||||
|
||||
uint8_t hc_num() const {
|
||||
return hc_num_;
|
||||
@@ -149,8 +150,6 @@ class Thermostat : public EMSdevice {
|
||||
uint8_t model_; // the model type
|
||||
};
|
||||
|
||||
static std::string mode_tostring(uint8_t mode);
|
||||
|
||||
private:
|
||||
static uuid::log::Logger logger_;
|
||||
|
||||
@@ -192,7 +191,6 @@ class Thermostat : public EMSdevice {
|
||||
int8_t brightness_; // Screen brightness 0F=dark F1=light
|
||||
uint8_t preheating_; // Preheating in the clock program: (0x00 = off, 0xFF = on)
|
||||
uint8_t autodst_; // Automatic change Daylight Saving time: (0x00 = off, 0xFF = on)
|
||||
uint8_t offtemp_; // Set Temperature when mode is Off / 10 (e.g.: 0x0F = 7.5 degrees Celsius)
|
||||
uint8_t mixingvalves_; // Number of Mixing Valves: (0x00=0, 0x01=1, 0x02=2)
|
||||
|
||||
int8_t dampedoutdoortemp_;
|
||||
@@ -237,9 +235,12 @@ class Thermostat : public EMSdevice {
|
||||
uint8_t delayBoiler_; // minutes
|
||||
uint8_t tempDiffBoiler_; // relative temperature degrees
|
||||
|
||||
std::vector<std::shared_ptr<HeatingCircuit>> heating_circuits_; // each thermostat can have multiple heating circuits
|
||||
// PV
|
||||
uint8_t pvEnableWw_;
|
||||
uint8_t pvRaiseHeat_;
|
||||
uint8_t pvLowerCool_;
|
||||
|
||||
uint8_t zero_value_ = 0; // for fixing current room temperature to 0 for HA
|
||||
std::vector<std::shared_ptr<HeatingCircuit>> heating_circuits_; // each thermostat can have multiple heating circuits
|
||||
|
||||
// Generic Types
|
||||
static constexpr uint16_t EMS_TYPE_RCTime = 0x06; // time
|
||||
@@ -253,6 +254,7 @@ class Thermostat : public EMSdevice {
|
||||
static constexpr uint8_t EMS_OFFSET_RC20StatusMessage_setpoint = 1; // setpoint temp
|
||||
static constexpr uint8_t EMS_OFFSET_RC20StatusMessage_curr = 2; // current temp
|
||||
static constexpr uint8_t EMS_OFFSET_RC20Set_mode = 23; // position of thermostat mode
|
||||
static constexpr uint8_t EMS_OFFSET_RC20Set_temp_off = 24; // position of thermostat setpoint mode:off
|
||||
static constexpr uint8_t EMS_OFFSET_RC20Set_temp_auto = 28; // position of thermostat setpoint temperature
|
||||
static constexpr uint8_t EMS_OFFSET_RC20Set_temp_manual = 29; // position of thermostat setpoint temperature
|
||||
|
||||
@@ -263,7 +265,9 @@ class Thermostat : public EMSdevice {
|
||||
static constexpr uint8_t EMS_OFFSET_RC30StatusMessage_setpoint = 1; // setpoint temp
|
||||
static constexpr uint8_t EMS_OFFSET_RC30StatusMessage_curr = 2; // current temp
|
||||
static constexpr uint8_t EMS_OFFSET_RC30Set_mode = 23; // position of thermostat mode
|
||||
static constexpr uint8_t EMS_OFFSET_RC30Set_temp = 28; // position of thermostat setpoint temperature
|
||||
static constexpr uint8_t EMS_OFFSET_RC30Set_temp_off = 24; // position of thermostat setpoint mode:off
|
||||
static constexpr uint8_t EMS_OFFSET_RC30Set_temp_auto = 28; // position of thermostat setpoint temperature
|
||||
static constexpr uint8_t EMS_OFFSET_RC30Set_temp_manual = 29; // position of thermostat setpoint temperature for manual mode
|
||||
static constexpr uint8_t EMS_OFFSET_RC30Temp_temp_night = 3; // position of thermostat setpoint temperature for night time (T1)
|
||||
static constexpr uint8_t EMS_OFFSET_RC30Temp_temp_daylow = 4; // position of thermostat setpoint temperature for daylow time (T2)
|
||||
static constexpr uint8_t EMS_OFFSET_RC30Temp_temp_daymid = 5; // position of thermostat setpoint temperature for daymid time (T3)
|
||||
@@ -353,7 +357,6 @@ class Thermostat : public EMSdevice {
|
||||
void process_RC30Set(std::shared_ptr<const Telegram> telegram);
|
||||
void process_RC30Temp(std::shared_ptr<const Telegram> telegram);
|
||||
void process_RC30wwSettings(std::shared_ptr<const Telegram> telegram);
|
||||
void process_RC30Timer(std::shared_ptr<const Telegram> telegram);
|
||||
void process_RC20Monitor(std::shared_ptr<const Telegram> telegram);
|
||||
void process_RC20Set(std::shared_ptr<const Telegram> telegram);
|
||||
void process_RC20Temp(std::shared_ptr<const Telegram> telegram);
|
||||
@@ -382,8 +385,10 @@ class Thermostat : public EMSdevice {
|
||||
void process_JunkersSet2(std::shared_ptr<const Telegram> telegram);
|
||||
void process_EasyMonitor(std::shared_ptr<const Telegram> telegram);
|
||||
void process_JunkersRemoteMonitor(std::shared_ptr<const Telegram> telegram);
|
||||
void process_JunkersHybridSettings(std::shared_ptr<const Telegram> telegram);
|
||||
void process_HybridSettings(std::shared_ptr<const Telegram> telegram);
|
||||
void process_PVSettings(std::shared_ptr<const Telegram> telegram);
|
||||
void process_JunkersSetMixer(std::shared_ptr<const Telegram> telegram);
|
||||
void process_JunkersWW(std::shared_ptr<const Telegram> telegram);
|
||||
void process_RemoteTemp(std::shared_ptr<const Telegram> telegram);
|
||||
void process_RemoteHumidity(std::shared_ptr<const Telegram> telegram);
|
||||
void process_RemoteCorrection(std::shared_ptr<const Telegram> telegram);
|
||||
@@ -396,42 +401,19 @@ class Thermostat : public EMSdevice {
|
||||
bool set_switchtime(const char * value, const uint16_t type_id, char * out, size_t len);
|
||||
|
||||
// set functions - these use the id/hc
|
||||
bool set_mode(const char * value, const int8_t id);
|
||||
bool set_control(const char * value, const int8_t id);
|
||||
bool set_holiday(const char * value, const int8_t id, const bool vacation = false);
|
||||
bool set_vacation(const char * value, const int8_t id) {
|
||||
bool set_mode(const char * value, const int8_t id);
|
||||
bool set_control(const char * value, const int8_t id);
|
||||
bool set_holiday(const char * value, const int8_t id, const bool vacation = false);
|
||||
inline bool set_vacation(const char * value, const int8_t id) {
|
||||
return set_holiday(value, id, true);
|
||||
}
|
||||
bool set_pause(const char * value, const int8_t id);
|
||||
bool set_party(const char * value, const int8_t id);
|
||||
bool set_summermode(const char * value, const int8_t id);
|
||||
|
||||
bool set_temp(const char * value, const int8_t id);
|
||||
bool set_nighttemp(const char * value, const int8_t id);
|
||||
bool set_daytemp(const char * value, const int8_t id);
|
||||
bool set_daylowtemp(const char * value, const int8_t id);
|
||||
bool set_daymidtemp(const char * value, const int8_t id);
|
||||
bool set_comforttemp(const char * value, const int8_t id);
|
||||
bool set_nofrosttemp(const char * value, const int8_t id);
|
||||
bool set_ecotemp(const char * value, const int8_t id);
|
||||
bool set_heattemp(const char * value, const int8_t id);
|
||||
bool set_summertemp(const char * value, const int8_t id);
|
||||
bool set_designtemp(const char * value, const int8_t id);
|
||||
bool set_offsettemp(const char * value, const int8_t id);
|
||||
bool set_holidaytemp(const char * value, const int8_t id);
|
||||
bool set_manualtemp(const char * value, const int8_t id);
|
||||
bool set_tempautotemp(const char * value, const int8_t id);
|
||||
bool set_noreducetemp(const char * value, const int8_t id);
|
||||
bool set_reducetemp(const char * value, const int8_t id);
|
||||
bool set_vacreducetemp(const char * value, const int8_t id);
|
||||
bool set_vacreducemode(const char * value, const int8_t id);
|
||||
bool set_nofrostmode(const char * value, const int8_t id);
|
||||
bool set_remotetemp(const char * value, const int8_t id);
|
||||
bool set_roominfluence(const char * value, const int8_t id);
|
||||
bool set_roominfl_factor(const char * value, const int8_t id);
|
||||
bool set_flowtempoffset(const char * value, const int8_t id);
|
||||
bool set_minflowtemp(const char * value, const int8_t id);
|
||||
bool set_maxflowtemp(const char * value, const int8_t id);
|
||||
bool set_reducemode(const char * value, const int8_t id);
|
||||
bool set_switchtime1(const char * value, const int8_t id);
|
||||
bool set_switchtime2(const char * value, const int8_t id);
|
||||
@@ -440,31 +422,103 @@ class Thermostat : public EMSdevice {
|
||||
bool set_wwprio(const char * value, const int8_t id);
|
||||
bool set_fastheatup(const char * value, const int8_t id);
|
||||
bool set_switchonoptimization(const char * value, const int8_t id);
|
||||
bool set_remoteseltemp(const char * value, const int8_t id);
|
||||
|
||||
inline bool set_temp(const char * value, const int8_t id) {
|
||||
return set_temperature_value(value, id, HeatingCircuit::Mode::AUTO);
|
||||
}
|
||||
inline bool set_nighttemp(const char * value, const int8_t id) {
|
||||
return set_temperature_value(value, id, HeatingCircuit::Mode::NIGHT);
|
||||
}
|
||||
inline bool set_daytemp(const char * value, const int8_t id) {
|
||||
return set_temperature_value(value, id, HeatingCircuit::Mode::DAY);
|
||||
}
|
||||
inline bool set_daylowtemp(const char * value, const int8_t id) {
|
||||
return set_temperature_value(value, id, HeatingCircuit::Mode::DAYLOW);
|
||||
}
|
||||
inline bool set_daymidtemp(const char * value, const int8_t id) {
|
||||
return set_temperature_value(value, id, HeatingCircuit::Mode::DAYMID);
|
||||
}
|
||||
inline bool set_comforttemp(const char * value, const int8_t id) {
|
||||
return set_temperature_value(value, id, HeatingCircuit::Mode::COMFORT);
|
||||
}
|
||||
inline bool set_nofrosttemp(const char * value, const int8_t id) {
|
||||
return set_temperature_value(value, id, HeatingCircuit::Mode::NOFROST);
|
||||
}
|
||||
inline bool set_ecotemp(const char * value, const int8_t id) {
|
||||
return set_temperature_value(value, id, HeatingCircuit::Mode::ECO);
|
||||
}
|
||||
inline bool set_heattemp(const char * value, const int8_t id) {
|
||||
return set_temperature_value(value, id, HeatingCircuit::Mode::HEAT);
|
||||
}
|
||||
inline bool set_summertemp(const char * value, const int8_t id) {
|
||||
return set_temperature_value(value, id, HeatingCircuit::Mode::SUMMER);
|
||||
}
|
||||
inline bool set_designtemp(const char * value, const int8_t id) {
|
||||
return set_temperature_value(value, id, HeatingCircuit::Mode::DESIGN);
|
||||
}
|
||||
inline bool set_offsettemp(const char * value, const int8_t id) {
|
||||
return set_temperature_value(value, id, HeatingCircuit::Mode::OFFSET);
|
||||
}
|
||||
inline bool set_holidaytemp(const char * value, const int8_t id) {
|
||||
return set_temperature_value(value, id, HeatingCircuit::Mode::HOLIDAY);
|
||||
}
|
||||
inline bool set_offtemp(const char * value, const int8_t id) {
|
||||
return set_temperature_value(value, id, HeatingCircuit::Mode::OFF);
|
||||
}
|
||||
inline bool set_manualtemp(const char * value, const int8_t id) {
|
||||
return set_temperature_value(value, id, HeatingCircuit::Mode::MANUAL);
|
||||
}
|
||||
inline bool set_tempautotemp(const char * value, const int8_t id) {
|
||||
return set_temperature_value(value, id, HeatingCircuit::Mode::TEMPAUTO);
|
||||
}
|
||||
inline bool set_noreducetemp(const char * value, const int8_t id) {
|
||||
return set_temperature_value(value, id, HeatingCircuit::Mode::NOREDUCE);
|
||||
}
|
||||
inline bool set_reducetemp(const char * value, const int8_t id) {
|
||||
return set_temperature_value(value, id, HeatingCircuit::Mode::REDUCE);
|
||||
}
|
||||
inline bool set_vacreducetemp(const char * value, const int8_t id) {
|
||||
return set_temperature_value(value, id, HeatingCircuit::Mode::VACREDUCE);
|
||||
}
|
||||
inline bool set_flowtempoffset(const char * value, const int8_t id) {
|
||||
return set_temperature_value(value, id, HeatingCircuit::Mode::FLOWOFFSET, true);
|
||||
}
|
||||
inline bool set_maxflowtemp(const char * value, const int8_t id) {
|
||||
return set_temperature_value(value, id, HeatingCircuit::Mode::MAXFLOW);
|
||||
}
|
||||
inline bool set_minflowtemp(const char * value, const int8_t id) {
|
||||
return set_temperature_value(value, id, HeatingCircuit::Mode::MINFLOW);
|
||||
}
|
||||
inline bool set_roominfluence(const char * value, const int8_t id) {
|
||||
return set_temperature_value(value, id, HeatingCircuit::Mode::ROOMINFLUENCE, true);
|
||||
}
|
||||
inline bool set_remoteseltemp(const char * value, const int8_t id) {
|
||||
return set_temperature_value(value, id, HeatingCircuit::Mode::REMOTESELTEMP);
|
||||
}
|
||||
|
||||
// set functions - these don't use the id/hc, the parameters are ignored
|
||||
bool set_wwmode(const char * value, const int8_t id);
|
||||
bool set_wwtemp(const char * value, const int8_t id);
|
||||
bool set_wwtemplow(const char * value, const int8_t id);
|
||||
bool set_wwcircmode(const char * value, const int8_t id);
|
||||
bool set_wwcharge(const char * value, const int8_t id);
|
||||
bool set_wwchargeduration(const char * value, const int8_t id);
|
||||
bool set_wwDisinfect(const char * value, const int8_t id);
|
||||
bool set_wwDisinfectDay(const char * value, const int8_t id);
|
||||
bool set_wwDisinfectHour(const char * value, const int8_t id);
|
||||
bool set_wwMaxTemp(const char * value, const int8_t id);
|
||||
bool set_wwOneTimeKey(const char * value, const int8_t id);
|
||||
bool set_wwProgMode(const char * value, const int8_t id);
|
||||
bool set_wwCircProg(const char * value, const int8_t id);
|
||||
bool set_wwSwitchTime(const char * value, const int8_t id);
|
||||
bool set_wwCircSwitchTime(const char * value, const int8_t id);
|
||||
bool set_wwDailyHeating(const char * value, const int8_t id);
|
||||
bool set_wwDailyHeatTime(const char * value, const int8_t id);
|
||||
bool set_wwwhenmodeoff(const char * value, const int8_t id);
|
||||
bool set_wwVacation(const char * value, const int8_t id) {
|
||||
bool set_wwmode(const char * value, const int8_t id);
|
||||
bool set_wwtemp(const char * value, const int8_t id);
|
||||
bool set_wwtemplow(const char * value, const int8_t id);
|
||||
bool set_wwcircmode(const char * value, const int8_t id);
|
||||
bool set_wwcharge(const char * value, const int8_t id);
|
||||
bool set_wwchargeduration(const char * value, const int8_t id);
|
||||
bool set_wwDisinfect(const char * value, const int8_t id);
|
||||
bool set_wwDisinfectDay(const char * value, const int8_t id);
|
||||
bool set_wwDisinfectHour(const char * value, const int8_t id);
|
||||
bool set_wwMaxTemp(const char * value, const int8_t id);
|
||||
bool set_wwOneTimeKey(const char * value, const int8_t id);
|
||||
bool set_wwProgMode(const char * value, const int8_t id);
|
||||
bool set_wwCircProg(const char * value, const int8_t id);
|
||||
bool set_wwSwitchTime(const char * value, const int8_t id);
|
||||
bool set_wwCircSwitchTime(const char * value, const int8_t id);
|
||||
bool set_wwDailyHeating(const char * value, const int8_t id);
|
||||
bool set_wwDailyHeatTime(const char * value, const int8_t id);
|
||||
bool set_wwwhenmodeoff(const char * value, const int8_t id);
|
||||
inline bool set_wwVacation(const char * value, const int8_t id) {
|
||||
return set_holiday(value, DeviceValueTAG::TAG_WWC1, true);
|
||||
}
|
||||
bool set_wwHoliday(const char * value, const int8_t id) {
|
||||
inline bool set_wwHoliday(const char * value, const int8_t id) {
|
||||
return set_holiday(value, DeviceValueTAG::TAG_WWC1);
|
||||
}
|
||||
|
||||
@@ -484,7 +538,6 @@ class Thermostat : public EMSdevice {
|
||||
bool set_autodst(const char * value, const int8_t id);
|
||||
bool set_preheating(const char * value, const int8_t id);
|
||||
bool set_mixingvalves(const char * value, const int8_t id);
|
||||
bool set_offtemp(const char * value, const int8_t id);
|
||||
|
||||
bool set_hybridStrategy(const char * value, const int8_t id);
|
||||
bool set_switchOverTemp(const char * value, const int8_t id);
|
||||
@@ -493,6 +546,11 @@ class Thermostat : public EMSdevice {
|
||||
bool set_electricFactor(const char * value, const int8_t id);
|
||||
bool set_delayBoiler(const char * value, const int8_t id);
|
||||
bool set_tempDiffBoiler(const char * value, const int8_t id);
|
||||
bool set_roomsensor(const char * value, const int8_t id);
|
||||
|
||||
bool set_pvEnableWw(const char * value, const int8_t id);
|
||||
bool set_pvRaiseHeat(const char * value, const int8_t id);
|
||||
bool set_pvLowerCool(const char * value, const int8_t id);
|
||||
};
|
||||
|
||||
} // namespace emsesp
|
||||
|
||||
1138
src/emsdevice.cpp
1138
src/emsdevice.cpp
File diff suppressed because it is too large
Load Diff
210
src/emsdevice.h
210
src/emsdevice.h
@@ -31,10 +31,10 @@ class EMSdevice {
|
||||
public:
|
||||
virtual ~EMSdevice() = default; // destructor of base class must always be virtual because it's a polymorphic class
|
||||
|
||||
static constexpr uint8_t EMS_DEVICES_MAX_TELEGRAMS = 20;
|
||||
using process_function_p = std::function<void(std::shared_ptr<const Telegram>)>;
|
||||
|
||||
// device_type defines which derived class to use, e.g. BOILER, THERMOSTAT etc..
|
||||
EMSdevice(uint8_t device_type, uint8_t device_id, uint8_t product_id, const char * version, const std::string & name, uint8_t flags, uint8_t brand)
|
||||
EMSdevice(uint8_t device_type, uint8_t device_id, uint8_t product_id, const char * version, const char * name, uint8_t flags, uint8_t brand)
|
||||
: device_type_(device_type)
|
||||
, device_id_(device_id)
|
||||
, product_id_(product_id)
|
||||
@@ -44,15 +44,19 @@ class EMSdevice {
|
||||
strlcpy(version_, version, sizeof(version_));
|
||||
}
|
||||
|
||||
std::string device_type_name() const;
|
||||
// static functions, used outside the class like in console.cpp, command.cpp, emsesp.cpp, mqtt.cpp
|
||||
static const char * device_type_2_device_name(const uint8_t device_type);
|
||||
static uint8_t device_name_2_device_type(const char * topic);
|
||||
static std::string uom_to_string(uint8_t uom);
|
||||
static std::string tag_to_string(uint8_t tag, const bool translate = true);
|
||||
static std::string tag_to_mqtt(uint8_t tag);
|
||||
static uint8_t decode_brand(uint8_t value);
|
||||
|
||||
static std::string device_type_2_device_name(const uint8_t device_type);
|
||||
static uint8_t device_name_2_device_type(const char * topic);
|
||||
static std::string uom_to_string(uint8_t uom);
|
||||
static std::string tag_to_string(uint8_t tag);
|
||||
static std::string tag_to_mqtt(uint8_t tag);
|
||||
const char * device_type_name(); // returns short non-translated device type name
|
||||
const char * device_type_2_device_name_translated(); // returns translated device type name
|
||||
|
||||
bool has_tag(const uint8_t tag) const;
|
||||
bool has_cmd(const char * cmd, const int8_t id) const;
|
||||
|
||||
inline uint8_t device_id() const {
|
||||
return device_id_;
|
||||
@@ -104,15 +108,14 @@ class EMSdevice {
|
||||
return brand_;
|
||||
}
|
||||
|
||||
inline void name(const std::string & name) {
|
||||
inline void name(const char * name) {
|
||||
name_ = name;
|
||||
}
|
||||
|
||||
inline std::string name() const {
|
||||
inline const char * name() const {
|
||||
return name_;
|
||||
}
|
||||
|
||||
// unique id of a device
|
||||
inline uint8_t unique_id() const {
|
||||
return unique_id_;
|
||||
}
|
||||
@@ -173,11 +176,9 @@ class EMSdevice {
|
||||
}
|
||||
}
|
||||
|
||||
std::string brand_to_string() const;
|
||||
static uint8_t decode_brand(uint8_t value);
|
||||
|
||||
std::string to_string() const;
|
||||
std::string to_string_short() const;
|
||||
const std::string brand_to_string();
|
||||
const std::string to_string();
|
||||
const std::string to_string_short();
|
||||
|
||||
enum Handlers : uint8_t { ALL, RECEIVED, FETCHED, PENDING, IGNORED };
|
||||
|
||||
@@ -187,12 +188,11 @@ class EMSdevice {
|
||||
void list_device_entries(JsonObject & output) const;
|
||||
void add_handlers_ignored(const uint16_t handler);
|
||||
|
||||
void mask_entity(const std::string & entity_id);
|
||||
void getMaskedEntities(std::vector<std::string> & entity_ids);
|
||||
void set_climate_minmax(uint8_t tag, int16_t min, uint16_t max);
|
||||
void setCustomEntity(const std::string & entity_id);
|
||||
void getCustomEntities(std::vector<std::string> & entity_ids);
|
||||
|
||||
using process_function_p = std::function<void(std::shared_ptr<const Telegram>)>;
|
||||
|
||||
void register_telegram_type(const uint16_t telegram_type_id, const __FlashStringHelper * telegram_type_name, bool fetch, const process_function_p cb);
|
||||
void register_telegram_type(const uint16_t telegram_type_id, const char * telegram_type_name, bool fetch, const process_function_p cb);
|
||||
bool handle_telegram(std::shared_ptr<const Telegram> telegram);
|
||||
|
||||
std::string get_value_uom(const char * key) const;
|
||||
@@ -204,41 +204,77 @@ class EMSdevice {
|
||||
void generate_values_web(JsonObject & output);
|
||||
void generate_values_web_customization(JsonArray & output);
|
||||
|
||||
void register_device_value(uint8_t tag,
|
||||
void * value_p,
|
||||
uint8_t type,
|
||||
const __FlashStringHelper * const * options,
|
||||
const __FlashStringHelper * short_name,
|
||||
const __FlashStringHelper * full_name,
|
||||
uint8_t uom,
|
||||
bool has_cmd,
|
||||
int16_t min,
|
||||
uint16_t max);
|
||||
void add_device_value(uint8_t tag,
|
||||
void * value_p,
|
||||
uint8_t type,
|
||||
const char * const ** options,
|
||||
const char * const * options_single,
|
||||
int8_t numeric_operator,
|
||||
const char * const * name,
|
||||
uint8_t uom,
|
||||
const cmd_function_p f,
|
||||
int16_t min,
|
||||
uint16_t max);
|
||||
|
||||
void register_device_value(uint8_t tag,
|
||||
void * value_p,
|
||||
uint8_t type,
|
||||
const __FlashStringHelper * const * options,
|
||||
const __FlashStringHelper * const * name,
|
||||
uint8_t uom,
|
||||
const cmd_function_p f,
|
||||
int16_t min,
|
||||
uint16_t max);
|
||||
void register_device_value(uint8_t tag,
|
||||
void * value_p,
|
||||
uint8_t type,
|
||||
const char * const ** options,
|
||||
const char * const * name,
|
||||
uint8_t uom,
|
||||
const cmd_function_p f,
|
||||
int16_t min,
|
||||
uint16_t max);
|
||||
|
||||
void register_device_value(uint8_t tag,
|
||||
void * value_p,
|
||||
uint8_t type,
|
||||
const __FlashStringHelper * const * options,
|
||||
const __FlashStringHelper * const * name,
|
||||
uint8_t uom,
|
||||
const cmd_function_p f);
|
||||
void
|
||||
register_device_value(uint8_t tag, void * value_p, uint8_t type, const char * const ** options, const char * const * name, uint8_t uom, const cmd_function_p f);
|
||||
|
||||
void register_device_value(uint8_t tag,
|
||||
void * value_p,
|
||||
uint8_t type,
|
||||
const __FlashStringHelper * const * options,
|
||||
const __FlashStringHelper * const * name,
|
||||
uint8_t uom);
|
||||
void register_device_value(uint8_t tag, void * value_p, uint8_t type, const char * const ** options, const char * const * name, uint8_t uom);
|
||||
|
||||
void register_device_value(uint8_t tag,
|
||||
void * value_p,
|
||||
uint8_t type,
|
||||
int8_t numeric_operator,
|
||||
const char * const * name,
|
||||
uint8_t uom,
|
||||
const cmd_function_p f = nullptr);
|
||||
|
||||
void register_device_value(uint8_t tag,
|
||||
void * value_p,
|
||||
uint8_t type,
|
||||
int8_t numeric_operator,
|
||||
const char * const * name,
|
||||
uint8_t uom,
|
||||
const cmd_function_p f,
|
||||
int16_t min,
|
||||
uint16_t max);
|
||||
|
||||
// single list of options
|
||||
void register_device_value(uint8_t tag,
|
||||
void * value_p,
|
||||
uint8_t type,
|
||||
const char * const * options_single,
|
||||
const char * const * name,
|
||||
uint8_t uom,
|
||||
const cmd_function_p f = nullptr);
|
||||
|
||||
// single list of options, with no translations, with min and max
|
||||
void register_device_value(uint8_t tag,
|
||||
void * value_p,
|
||||
uint8_t type,
|
||||
const char * const * options_single,
|
||||
const char * const * name,
|
||||
uint8_t uom,
|
||||
const cmd_function_p f,
|
||||
int16_t min,
|
||||
uint16_t max);
|
||||
|
||||
// no options, optional function f
|
||||
void register_device_value(uint8_t tag, void * value_p, uint8_t type, const char * const * name, uint8_t uom, const cmd_function_p f = nullptr);
|
||||
|
||||
// no options, with min/max
|
||||
void
|
||||
register_device_value(uint8_t tag, void * value_p, uint8_t type, const char * const * name, uint8_t uom, const cmd_function_p f, int16_t min, uint16_t max);
|
||||
|
||||
void write_command(const uint16_t type_id, const uint8_t offset, uint8_t * message_data, const uint8_t message_length, const uint16_t validate_typeid) const;
|
||||
void write_command(const uint16_t type_id, const uint8_t offset, const uint8_t value, const uint16_t validate_typeid) const;
|
||||
@@ -301,15 +337,35 @@ class EMSdevice {
|
||||
SWITCH,
|
||||
CONTROLLER,
|
||||
CONNECT,
|
||||
ALERT,
|
||||
PUMP,
|
||||
GENERIC,
|
||||
HEATSOURCE,
|
||||
UNKNOWN
|
||||
};
|
||||
|
||||
static constexpr uint8_t EMS_DEVICES_MAX_TELEGRAMS = 20;
|
||||
|
||||
// static device IDs
|
||||
static constexpr uint8_t EMS_DEVICE_ID_BOILER = 0x08; // fixed device_id for Master Boiler/UBA
|
||||
static constexpr uint8_t EMS_DEVICE_ID_BOILER_1 = 0x70; // fixed device_id for 1st. Cascade Boiler/UBA
|
||||
static constexpr uint8_t EMS_DEVICE_ID_BOILER_F = 0x7F; // fixed device_id for last Cascade Boiler/UBA
|
||||
static constexpr uint8_t EMS_DEVICE_ID_AM200 = 0x60; // fixed device_id for alternative Heating AM200
|
||||
static constexpr uint8_t EMS_DEVICE_ID_BOILER = 0x08; // fixed device_id for Master Boiler/UBA
|
||||
static constexpr uint8_t EMS_DEVICE_ID_HS1 = 0x70; // fixed device_id for 1st. Cascade Boiler/UBA
|
||||
static constexpr uint8_t EMS_DEVICE_ID_HS16 = 0x7F; // fixed device_id for last Cascade Boiler/UBA
|
||||
static constexpr uint8_t EMS_DEVICE_ID_AHS1 = 0x60; // fixed device_id for alternative Heating AM200
|
||||
static constexpr uint8_t EMS_DEVICE_ID_CONTROLLER = 0x09;
|
||||
static constexpr uint8_t EMS_DEVICE_ID_RS232 = 0x04;
|
||||
static constexpr uint8_t EMS_DEVICE_ID_TERMINAL = 0x0A;
|
||||
static constexpr uint8_t EMS_DEVICE_ID_SERVICEKEY = 0x0B;
|
||||
static constexpr uint8_t EMS_DEVICE_ID_CASCADE = 0x0C;
|
||||
static constexpr uint8_t EMS_DEVICE_ID_EASYCOM = 0x0D;
|
||||
static constexpr uint8_t EMS_DEVICE_ID_CONVERTER = 0x0E;
|
||||
static constexpr uint8_t EMS_DEVICE_ID_CLOCK = 0x0F;
|
||||
static constexpr uint8_t EMS_DEVICE_ID_SWITCH = 0x11; // Switch WM10
|
||||
static constexpr uint8_t EMS_DEVICE_ID_ALERT = 0x12; // Error module EM10
|
||||
static constexpr uint8_t EMS_DEVICE_ID_PUMP = 0x15; // Pump module PM10
|
||||
static constexpr uint8_t EMS_DEVICE_ID_MODEM = 0x48;
|
||||
static constexpr uint8_t EMS_DEVICE_ID_RFSENSOR = 0x40; // RF sensor only sending, no reply
|
||||
static constexpr uint8_t EMS_DEVICE_ID_RFBASE = 0x50;
|
||||
static constexpr uint8_t EMS_DEVICE_ID_ROOMTHERMOSTAT = 0x17; // TADO using this with no version reply
|
||||
|
||||
// generic type IDs
|
||||
static constexpr uint16_t EMS_TYPE_VERSION = 0x02; // type ID for Version information. Generic across all EMS devices.
|
||||
@@ -327,7 +383,6 @@ class EMSdevice {
|
||||
static constexpr uint8_t EMS_DEVICE_FLAG_HT3 = 3;
|
||||
static constexpr uint8_t EMS_DEVICE_FLAG_HEATPUMP = 4;
|
||||
static constexpr uint8_t EMS_DEVICE_FLAG_HYBRID = 5;
|
||||
static constexpr uint8_t EMS_DEVICE_FLAG_AM200 = 6;
|
||||
|
||||
// Solar Module
|
||||
static constexpr uint8_t EMS_DEVICE_FLAG_SM10 = 1;
|
||||
@@ -360,28 +415,32 @@ class EMSdevice {
|
||||
uint8_t count_entities();
|
||||
bool has_entities() const;
|
||||
|
||||
#if defined(EMSESP_STANDALONE_DUMP)
|
||||
void dump_value_info();
|
||||
#endif
|
||||
|
||||
private:
|
||||
uint8_t unique_id_;
|
||||
uint8_t device_type_ = DeviceType::SYSTEM;
|
||||
uint8_t device_id_ = 0;
|
||||
uint8_t product_id_ = 0;
|
||||
char version_[6];
|
||||
std::string name_; // the long name for the EMS model
|
||||
uint8_t flags_ = 0;
|
||||
uint8_t brand_ = Brand::NO_BRAND;
|
||||
uint8_t unique_id_;
|
||||
uint8_t device_type_ = DeviceType::SYSTEM;
|
||||
uint8_t device_id_ = 0;
|
||||
uint8_t product_id_ = 0;
|
||||
char version_[6];
|
||||
const char * name_; // the long name for the EMS model
|
||||
uint8_t flags_ = 0;
|
||||
uint8_t brand_ = Brand::NO_BRAND;
|
||||
|
||||
bool ha_config_done_ = false;
|
||||
bool has_update_ = false;
|
||||
bool ha_config_firstrun_ = true; // this means a first setup of HA is needed after a restart
|
||||
|
||||
struct TelegramFunction {
|
||||
uint16_t telegram_type_id_; // it's type_id
|
||||
const __FlashStringHelper * telegram_type_name_; // e.g. RC20Message
|
||||
bool fetch_; // if this type_id be queried automatically
|
||||
bool received_;
|
||||
process_function_p process_function_;
|
||||
uint16_t telegram_type_id_; // it's type_id
|
||||
const char * telegram_type_name_; // e.g. RC20Message
|
||||
bool fetch_; // if this type_id be queried automatically
|
||||
bool received_;
|
||||
process_function_p process_function_;
|
||||
|
||||
TelegramFunction(uint16_t telegram_type_id, const __FlashStringHelper * telegram_type_name, bool fetch, bool received, const process_function_p process_function)
|
||||
TelegramFunction(uint16_t telegram_type_id, const char * telegram_type_name, bool fetch, bool received, const process_function_p process_function)
|
||||
: telegram_type_id_(telegram_type_id)
|
||||
, telegram_type_name_(telegram_type_name)
|
||||
, fetch_(fetch)
|
||||
@@ -390,10 +449,13 @@ class EMSdevice {
|
||||
}
|
||||
};
|
||||
|
||||
#ifdef EMSESP_STANDALONE
|
||||
void debug_print_dv(const char * shortname);
|
||||
#endif
|
||||
|
||||
std::vector<TelegramFunction> telegram_functions_; // each EMS device has its own set of registered telegram types
|
||||
|
||||
// device values
|
||||
std::vector<DeviceValue> devicevalues_;
|
||||
std::vector<DeviceValue> devicevalues_; // all the device values
|
||||
|
||||
std::vector<uint16_t> handlers_ignored_;
|
||||
};
|
||||
|
||||
@@ -22,128 +22,192 @@
|
||||
|
||||
namespace emsesp {
|
||||
|
||||
// mapping of UOM, to match order in DeviceValueUOM enum emsdevice.h
|
||||
// constructor
|
||||
DeviceValue::DeviceValue(uint8_t device_type,
|
||||
uint8_t tag,
|
||||
void * value_p,
|
||||
uint8_t type,
|
||||
const char * const ** options,
|
||||
const char * const * options_single,
|
||||
int8_t numeric_operator,
|
||||
const char * const short_name,
|
||||
const char * const * fullname,
|
||||
std::string & custom_fullname,
|
||||
uint8_t uom,
|
||||
bool has_cmd,
|
||||
int16_t min,
|
||||
uint16_t max,
|
||||
uint8_t state)
|
||||
: device_type(device_type)
|
||||
, tag(tag)
|
||||
, value_p(value_p)
|
||||
, type(type)
|
||||
, options(options)
|
||||
, options_single(options_single)
|
||||
, numeric_operator(numeric_operator)
|
||||
, short_name(short_name)
|
||||
, fullname(fullname)
|
||||
, custom_fullname(custom_fullname)
|
||||
, uom(uom)
|
||||
, has_cmd(has_cmd)
|
||||
, min(min)
|
||||
, max(max)
|
||||
, state(state) {
|
||||
// calculate #options in options list
|
||||
if (options_single) {
|
||||
options_size = 1;
|
||||
} else {
|
||||
options_size = Helpers::count_items(options);
|
||||
}
|
||||
|
||||
// set the min/max
|
||||
set_custom_minmax();
|
||||
|
||||
/*
|
||||
#ifdef EMSESP_STANDALONE
|
||||
// only added for debugging
|
||||
Serial.print(COLOR_BRIGHT_RED_BACKGROUND);
|
||||
Serial.print(" registering entity: ");
|
||||
Serial.print((short_name));
|
||||
Serial.print("/");
|
||||
if (!custom_fullname.empty()) {
|
||||
Serial.print(COLOR_BRIGHT_CYAN);
|
||||
Serial.print(custom_fullname.c_str());
|
||||
Serial.print(COLOR_RESET);
|
||||
} else {
|
||||
Serial.print(Helpers::translated_word(fullname));
|
||||
}
|
||||
Serial.print(" (#options=");
|
||||
Serial.print(options_size);
|
||||
Serial.print(",numop=");
|
||||
Serial.print(numeric_operator);
|
||||
Serial.print(") ");
|
||||
if (options != nullptr) {
|
||||
uint8_t i = 0;
|
||||
while (i < options_size) {
|
||||
Serial.print(" option");
|
||||
Serial.print(i + 1);
|
||||
Serial.print(":");
|
||||
auto str = Helpers::translated_word(options[i]);
|
||||
Serial.print(str);
|
||||
i++;
|
||||
}
|
||||
} else if (options_single != nullptr) {
|
||||
Serial.print("option1:!");
|
||||
Serial.print((options_single[0]));
|
||||
Serial.print("!");
|
||||
}
|
||||
Serial.println(COLOR_RESET);
|
||||
#endif
|
||||
*/
|
||||
}
|
||||
|
||||
// mapping of UOM, to match order in DeviceValueUOM enum emsdevicevalue.h
|
||||
// also maps to DeviceValueUOM in interface/src/project/types.ts for the Web UI
|
||||
// must be an int of 4 bytes, 32bit aligned
|
||||
const __FlashStringHelper * DeviceValue::DeviceValueUOM_s[] __attribute__((__aligned__(sizeof(uint32_t)))) PROGMEM = {
|
||||
const char * DeviceValue::DeviceValueUOM_s[] = {
|
||||
|
||||
F_(blank),
|
||||
F_(degrees),
|
||||
F_(degrees),
|
||||
F_(percent),
|
||||
F_(lmin),
|
||||
F_(kwh),
|
||||
F_(wh),
|
||||
F_(hours),
|
||||
F_(minutes),
|
||||
F_(ua),
|
||||
F_(bar),
|
||||
F_(kw),
|
||||
F_(w),
|
||||
F_(kb),
|
||||
F_(seconds),
|
||||
F_(dbm),
|
||||
F_(fahrenheit),
|
||||
F_(mv),
|
||||
F_(sqm)
|
||||
F_(uom_blank), F_(uom_degrees), F_(uom_degrees), F_(uom_percent), F_(uom_lmin), F_(uom_kwh), F_(uom_wh), FL_(hours)[0], FL_(minutes)[0],
|
||||
F_(uom_ua), F_(uom_bar), F_(uom_kw), F_(uom_w), F_(uom_kb), FL_(seconds)[0], F_(uom_dbm), F_(uom_fahrenheit), F_(uom_mv),
|
||||
F_(uom_sqm), F_(uom_m3), F_(uom_l), F_(uom_kmin), F_(uom_k), F_(uom_blank)
|
||||
|
||||
};
|
||||
|
||||
// mapping of TAGs, to match order in DeviceValueTAG enum in emsdevice.h
|
||||
// must be an int of 4 bytes, 32bit aligned
|
||||
const __FlashStringHelper * const DeviceValue::DeviceValueTAG_s[] PROGMEM = {
|
||||
const char * const * DeviceValue::DeviceValueTAG_s[] = {
|
||||
|
||||
F_(tag_none), // ""
|
||||
F_(tag_heartbeat), // ""
|
||||
F_(tag_boiler_data_ww), // "dhw"
|
||||
F_(tag_device_data), // ""
|
||||
F_(tag_device_data_ww), // "dhw"
|
||||
F_(tag_hc1), // "hc1"
|
||||
F_(tag_hc2), // "hc2"
|
||||
F_(tag_hc3), // "hc3"
|
||||
F_(tag_hc4), // "hc4"
|
||||
F_(tag_hc5), // "hc5"
|
||||
F_(tag_hc6), // "hc6"
|
||||
F_(tag_hc7), // "hc7"
|
||||
F_(tag_hc8), // "hc8"
|
||||
F_(tag_wwc1), // "wwc1"
|
||||
F_(tag_wwc2), // "Wwc2"
|
||||
F_(tag_wwc3), // "wwc3"
|
||||
F_(tag_wwc4), // "wwc4"
|
||||
F_(tag_wwc5), // "wwc5"
|
||||
F_(tag_wwc6), // "wwc6"
|
||||
F_(tag_wwc7), // "wwc7"
|
||||
F_(tag_wwc8), // "wwc8"
|
||||
F_(tag_wwc9), // "wwc9"
|
||||
F_(tag_wwc10), // "wwc10"
|
||||
F_(tag_ahs), // "ahs"
|
||||
F_(tag_hs1), // "hs1"
|
||||
F_(tag_hs2), // "hs2"
|
||||
F_(tag_hs3), // "hs3"
|
||||
F_(tag_hs4), // "hs4"
|
||||
F_(tag_hs5), // "hs5"
|
||||
F_(tag_hs6), // "hs6"
|
||||
F_(tag_hs7), // "hs7"
|
||||
F_(tag_hs8), // "hs8"
|
||||
F_(tag_hs9), // "hs9"
|
||||
F_(tag_hs10), // "hs10"
|
||||
F_(tag_hs11), // "hs11"
|
||||
F_(tag_hs12), // "hs12"
|
||||
F_(tag_hs13), // "hs13"
|
||||
F_(tag_hs14), // "hs14"
|
||||
F_(tag_hs15), // "hs15"
|
||||
F_(tag_hs16) // "hs16"
|
||||
FL_(tag_none), // ""
|
||||
FL_(tag_heartbeat), // ""
|
||||
FL_(tag_boiler_data_ww), // "dhw"
|
||||
FL_(tag_device_data), // ""
|
||||
FL_(tag_device_data_ww), // "dhw"
|
||||
FL_(tag_hc1), // "hc1"
|
||||
FL_(tag_hc2), // "hc2"
|
||||
FL_(tag_hc3), // "hc3"
|
||||
FL_(tag_hc4), // "hc4"
|
||||
FL_(tag_hc5), // "hc5"
|
||||
FL_(tag_hc6), // "hc6"
|
||||
FL_(tag_hc7), // "hc7"
|
||||
FL_(tag_hc8), // "hc8"
|
||||
FL_(tag_wwc1), // "wwc1"
|
||||
FL_(tag_wwc2), // "Wwc2"
|
||||
FL_(tag_wwc3), // "wwc3"
|
||||
FL_(tag_wwc4), // "wwc4"
|
||||
FL_(tag_wwc5), // "wwc5"
|
||||
FL_(tag_wwc6), // "wwc6"
|
||||
FL_(tag_wwc7), // "wwc7"
|
||||
FL_(tag_wwc8), // "wwc8"
|
||||
FL_(tag_wwc9), // "wwc9"
|
||||
FL_(tag_wwc10), // "wwc10"
|
||||
FL_(tag_ahs1), // "ahs1"
|
||||
FL_(tag_hs1), // "hs1"
|
||||
FL_(tag_hs2), // "hs2"
|
||||
FL_(tag_hs3), // "hs3"
|
||||
FL_(tag_hs4), // "hs4"
|
||||
FL_(tag_hs5), // "hs5"
|
||||
FL_(tag_hs6), // "hs6"
|
||||
FL_(tag_hs7), // "hs7"
|
||||
FL_(tag_hs8), // "hs8"
|
||||
FL_(tag_hs9), // "hs9"
|
||||
FL_(tag_hs10), // "hs10"
|
||||
FL_(tag_hs11), // "hs11"
|
||||
FL_(tag_hs12), // "hs12"
|
||||
FL_(tag_hs13), // "hs13"
|
||||
FL_(tag_hs14), // "hs14"
|
||||
FL_(tag_hs15), // "hs15"
|
||||
FL_(tag_hs16) // "hs16"
|
||||
|
||||
};
|
||||
|
||||
// MQTT topics derived from tags
|
||||
const __FlashStringHelper * const DeviceValue::DeviceValueTAG_mqtt[] PROGMEM = {
|
||||
const char * const DeviceValue::DeviceValueTAG_mqtt[] = {
|
||||
|
||||
F_(tag_none), // ""
|
||||
FL_(tag_none)[0], // ""
|
||||
F_(heartbeat), // "heartbeat"
|
||||
F_(tag_boiler_data_ww_mqtt), // "ww"
|
||||
F_(tag_device_data), // ""
|
||||
FL_(tag_device_data)[0], // ""
|
||||
F_(tag_device_data_ww_mqtt), // ""
|
||||
F_(tag_hc1), // "hc1"
|
||||
F_(tag_hc2), // "hc2"
|
||||
F_(tag_hc3), // "hc3"
|
||||
F_(tag_hc4), // "hc4"
|
||||
F_(tag_hc5), // "hc5"
|
||||
F_(tag_hc6), // "hc6"
|
||||
F_(tag_hc7), // "hc7"
|
||||
F_(tag_hc8), // "hc8"
|
||||
F_(tag_wwc1), // "wwc1"
|
||||
F_(tag_wwc2), // "Wwc2"
|
||||
F_(tag_wwc3), // "wwc3"
|
||||
F_(tag_wwc4), // "wwc4"
|
||||
F_(tag_wwc5), // "wwc5"
|
||||
F_(tag_wwc6), // "wwc6"
|
||||
F_(tag_wwc7), // "wwc7"
|
||||
F_(tag_wwc8), // "wwc8"
|
||||
F_(tag_wwc9), // "wwc9"
|
||||
F_(tag_wwc10), // "wwc10"
|
||||
F_(tag_ahs), // "ahs"
|
||||
F_(tag_hs1), // "hs1"
|
||||
F_(tag_hs2), // "hs2"
|
||||
F_(tag_hs3), // "hs3"
|
||||
F_(tag_hs4), // "hs4"
|
||||
F_(tag_hs5), // "hs5"
|
||||
F_(tag_hs6), // "hs6"
|
||||
F_(tag_hs7), // "hs7"
|
||||
F_(tag_hs8), // "hs8"
|
||||
F_(tag_hs9), // "hs9"
|
||||
F_(tag_hs10), // "hs10"
|
||||
F_(tag_hs11), // "hs11"
|
||||
F_(tag_hs12), // "hs12"
|
||||
F_(tag_hs13), // "hs13"
|
||||
F_(tag_hs14), // "hs14"
|
||||
F_(tag_hs15), // "hs15"
|
||||
F_(tag_hs16) // "hs16"
|
||||
FL_(tag_hc1)[0], // "hc1"
|
||||
FL_(tag_hc2)[0], // "hc2"
|
||||
FL_(tag_hc3)[0], // "hc3"
|
||||
FL_(tag_hc4)[0], // "hc4"
|
||||
FL_(tag_hc5)[0], // "hc5"
|
||||
FL_(tag_hc6)[0], // "hc6"
|
||||
FL_(tag_hc7)[0], // "hc7"
|
||||
FL_(tag_hc8)[0], // "hc8"
|
||||
FL_(tag_wwc1)[0], // "wwc1"
|
||||
FL_(tag_wwc2)[0], // "Wwc2"
|
||||
FL_(tag_wwc3)[0], // "wwc3"
|
||||
FL_(tag_wwc4)[0], // "wwc4"
|
||||
FL_(tag_wwc5)[0], // "wwc5"
|
||||
FL_(tag_wwc6)[0], // "wwc6"
|
||||
FL_(tag_wwc7)[0], // "wwc7"
|
||||
FL_(tag_wwc8)[0], // "wwc8"
|
||||
FL_(tag_wwc9)[0], // "wwc9"
|
||||
FL_(tag_wwc10)[0], // "wwc10"
|
||||
FL_(tag_ahs1)[0], // "ahs1"
|
||||
FL_(tag_hs1)[0], // "hs1"
|
||||
FL_(tag_hs2)[0], // "hs2"
|
||||
FL_(tag_hs3)[0], // "hs3"
|
||||
FL_(tag_hs4)[0], // "hs4"
|
||||
FL_(tag_hs5)[0], // "hs5"
|
||||
FL_(tag_hs6)[0], // "hs6"
|
||||
FL_(tag_hs7)[0], // "hs7"
|
||||
FL_(tag_hs8)[0], // "hs8"
|
||||
FL_(tag_hs9)[0], // "hs9"
|
||||
FL_(tag_hs10)[0], // "hs10"
|
||||
FL_(tag_hs11)[0], // "hs11"
|
||||
FL_(tag_hs12)[0], // "hs12"
|
||||
FL_(tag_hs13)[0], // "hs13"
|
||||
FL_(tag_hs14)[0], // "hs14"
|
||||
FL_(tag_hs15)[0], // "hs15"
|
||||
FL_(tag_hs16)[0] // "hs16"
|
||||
|
||||
};
|
||||
|
||||
// count #tags once at compile time
|
||||
size_t DeviceValue::tag_count = sizeof(DeviceValue::DeviceValueTAG_s) / sizeof(__FlashStringHelper *);
|
||||
size_t DeviceValue::tag_count = sizeof(DeviceValue::DeviceValueTAG_s) / sizeof(char * const *);
|
||||
|
||||
// checks whether the device value has an actual value
|
||||
// returns true if its valid
|
||||
@@ -192,14 +256,14 @@ bool DeviceValue::hasValue() const {
|
||||
// converts to signed int, which means rounding to an whole integer
|
||||
// returns false if there is no min/max needed
|
||||
// Types BOOL, ENUM, STRING and CMD are not used
|
||||
bool DeviceValue::get_min_max(int16_t & dv_set_min, int16_t & dv_set_max) {
|
||||
bool DeviceValue::get_min_max(int16_t & dv_set_min, uint16_t & dv_set_max) {
|
||||
uint8_t fahrenheit = !EMSESP::system_.fahrenheit() ? 0 : (uom == DeviceValueUOM::DEGREES) ? 2 : (uom == DeviceValueUOM::DEGREES_R) ? 1 : 0;
|
||||
|
||||
// if we have individual limits set already, just do the conversion
|
||||
// limits are not scaled with divider and temperatures are °C
|
||||
// limits are not scaled with num operator and temperatures are °C
|
||||
if (min != 0 || max != 0) {
|
||||
dv_set_min = Helpers::round2(min, 0, fahrenheit);
|
||||
dv_set_max = Helpers::round2(max, 0, fahrenheit);
|
||||
dv_set_min = Helpers::transformNumFloat(min, 0, fahrenheit);
|
||||
dv_set_max = Helpers::transformNumFloat(max, 0, fahrenheit);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -207,17 +271,15 @@ bool DeviceValue::get_min_max(int16_t & dv_set_min, int16_t & dv_set_max) {
|
||||
dv_set_min = 0;
|
||||
dv_set_max = 0;
|
||||
|
||||
int8_t divider = (options_size == 1) ? Helpers::atoint(uuid::read_flash_string(options[0]).c_str()) : 0;
|
||||
|
||||
if (type == DeviceValueType::USHORT) {
|
||||
dv_set_min = Helpers::round2(0, divider, fahrenheit);
|
||||
dv_set_max = Helpers::round2(EMS_VALUE_USHORT_NOTSET, divider, fahrenheit);
|
||||
dv_set_min = Helpers::transformNumFloat(0, numeric_operator, fahrenheit);
|
||||
dv_set_max = Helpers::transformNumFloat(EMS_VALUE_USHORT_NOTSET - 1, numeric_operator, fahrenheit);
|
||||
return true;
|
||||
}
|
||||
|
||||
if (type == DeviceValueType::SHORT) {
|
||||
dv_set_min = Helpers::round2(-EMS_VALUE_SHORT_NOTSET, divider, fahrenheit);
|
||||
dv_set_max = Helpers::round2(EMS_VALUE_SHORT_NOTSET, divider, fahrenheit);
|
||||
dv_set_min = Helpers::transformNumFloat(-EMS_VALUE_SHORT_NOTSET + 1, numeric_operator, fahrenheit);
|
||||
dv_set_max = Helpers::transformNumFloat(EMS_VALUE_SHORT_NOTSET - 1, numeric_operator, fahrenheit);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -225,7 +287,7 @@ bool DeviceValue::get_min_max(int16_t & dv_set_min, int16_t & dv_set_max) {
|
||||
if (uom == DeviceValueUOM::PERCENT) {
|
||||
dv_set_max = 100;
|
||||
} else {
|
||||
dv_set_max = Helpers::round2(EMS_VALUE_UINT_NOTSET, divider, fahrenheit);
|
||||
dv_set_max = Helpers::transformNumFloat(EMS_VALUE_UINT_NOTSET - 1, numeric_operator, fahrenheit);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -235,23 +297,93 @@ bool DeviceValue::get_min_max(int16_t & dv_set_min, int16_t & dv_set_max) {
|
||||
dv_set_min = -100;
|
||||
dv_set_max = 100;
|
||||
} else {
|
||||
dv_set_min = Helpers::round2(-EMS_VALUE_INT_NOTSET, divider, fahrenheit);
|
||||
dv_set_max = Helpers::round2(EMS_VALUE_INT_NOTSET, divider, fahrenheit);
|
||||
dv_set_min = Helpers::transformNumFloat(-EMS_VALUE_INT_NOTSET + 1, numeric_operator, fahrenheit);
|
||||
dv_set_max = Helpers::transformNumFloat(EMS_VALUE_INT_NOTSET - 1, numeric_operator, fahrenheit);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
if (type == DeviceValueType::ULONG) {
|
||||
dv_set_max = Helpers::round2(EMS_VALUE_ULONG_NOTSET, divider);
|
||||
dv_set_max = Helpers::transformNumFloat(EMS_VALUE_ULONG_NOTSET - 1, numeric_operator);
|
||||
return true;
|
||||
}
|
||||
|
||||
if (type == DeviceValueType::TIME) {
|
||||
dv_set_max = Helpers::round2(EMS_VALUE_ULONG_NOTSET, divider);
|
||||
dv_set_max = Helpers::transformNumFloat(EMS_VALUE_ULONG_NOTSET - 1, numeric_operator);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false; // nothing changed, not supported
|
||||
}
|
||||
|
||||
// extract custom min from custom_fullname
|
||||
bool DeviceValue::get_custom_min(int16_t & val) {
|
||||
auto min_pos = custom_fullname.find('>');
|
||||
bool has_min = (min_pos != std::string::npos);
|
||||
uint8_t fahrenheit = !EMSESP::system_.fahrenheit() ? 0 : (uom == DeviceValueUOM::DEGREES) ? 2 : (uom == DeviceValueUOM::DEGREES_R) ? 1 : 0;
|
||||
if (has_min) {
|
||||
int v = Helpers::atoint(custom_fullname.substr(min_pos + 1).c_str());
|
||||
if (fahrenheit) {
|
||||
v = (v - (32 * (fahrenheit - 1))) / 1.8; // reset to °C
|
||||
}
|
||||
if (max > 0 && v > max) {
|
||||
return false;
|
||||
}
|
||||
val = v;
|
||||
}
|
||||
return has_min;
|
||||
}
|
||||
|
||||
// extract custom max from custom_fullname
|
||||
bool DeviceValue::get_custom_max(uint16_t & val) {
|
||||
auto max_pos = custom_fullname.find('<');
|
||||
bool has_max = (max_pos != std::string::npos);
|
||||
uint8_t fahrenheit = !EMSESP::system_.fahrenheit() ? 0 : (uom == DeviceValueUOM::DEGREES) ? 2 : (uom == DeviceValueUOM::DEGREES_R) ? 1 : 0;
|
||||
if (has_max) {
|
||||
int v = Helpers::atoint(custom_fullname.substr(max_pos + 1).c_str());
|
||||
if (fahrenheit) {
|
||||
v = (v - (32 * (fahrenheit - 1))) / 1.8; // reset to °C
|
||||
}
|
||||
if (v < 0 || v < min) {
|
||||
return false;
|
||||
}
|
||||
val = v;
|
||||
}
|
||||
return has_max;
|
||||
}
|
||||
|
||||
// sets min max to stored custom values (if set)
|
||||
void DeviceValue::set_custom_minmax() {
|
||||
get_custom_min(min);
|
||||
get_custom_max(max);
|
||||
}
|
||||
|
||||
std::string DeviceValue::get_custom_fullname() const {
|
||||
auto min_pos = custom_fullname.find('>');
|
||||
auto max_pos = custom_fullname.find('<');
|
||||
auto minmax_pos = min_pos < max_pos ? min_pos : max_pos;
|
||||
if (minmax_pos != std::string::npos) {
|
||||
return custom_fullname.substr(0, minmax_pos);
|
||||
}
|
||||
return custom_fullname;
|
||||
}
|
||||
|
||||
// returns the translated fullname or the custom fullname (if provided)
|
||||
// always returns a std::string
|
||||
std::string DeviceValue::get_fullname() const {
|
||||
std::string customname = get_custom_fullname();
|
||||
if (customname.empty()) {
|
||||
return Helpers::translated_word(fullname);
|
||||
}
|
||||
return customname;
|
||||
}
|
||||
|
||||
std::string DeviceValue::get_name(std::string & entity) {
|
||||
auto pos = entity.find('|');
|
||||
if (pos != std::string::npos) {
|
||||
return entity.substr(2, pos - 2);
|
||||
}
|
||||
return entity.substr(2);
|
||||
}
|
||||
|
||||
} // namespace emsesp
|
||||
|
||||
@@ -25,7 +25,6 @@
|
||||
|
||||
#include "helpers.h" // for conversions
|
||||
#include "default_settings.h" // for enum types
|
||||
#include <uuid/common.h> // for read_flash_string
|
||||
|
||||
namespace emsesp {
|
||||
|
||||
@@ -45,30 +44,33 @@ class DeviceValue {
|
||||
CMD // special for commands only
|
||||
};
|
||||
|
||||
// Unit Of Measurement mapping - maps to DeviceValueUOM_s in emsdevice.cpp. Sequence is important!!
|
||||
// Unit Of Measurement mapping - maps to DeviceValueUOM_s in emsdevicevalue.cpp. Sequence is important!!
|
||||
// also used with HA as uom
|
||||
enum DeviceValueUOM : uint8_t {
|
||||
NONE = 0, // 0
|
||||
DEGREES, // 1
|
||||
DEGREES_R, // 2
|
||||
PERCENT, // 3
|
||||
LMIN, // 4
|
||||
KWH, // 5
|
||||
WH, // 6
|
||||
HOURS, // 7
|
||||
MINUTES, // 8
|
||||
UA, // 9
|
||||
BAR, // 10
|
||||
KW, // 11
|
||||
W, // 12
|
||||
KB, // 13
|
||||
SECONDS, // 14
|
||||
DBM, // 15
|
||||
FAHRENHEIT, // 16
|
||||
MV, // 17
|
||||
SQM, // 18 squaremeter
|
||||
M3, // 19 cubic meter
|
||||
L // 20
|
||||
NONE = 0, // 0
|
||||
DEGREES, // 1 - °C
|
||||
DEGREES_R, // 2 - °C (relative temperature)
|
||||
PERCENT, // 3 - %
|
||||
LMIN, // 4 - l/min
|
||||
KWH, // 5 - kWh
|
||||
WH, // 6 - Wh
|
||||
HOURS, // 7 - h
|
||||
MINUTES, // 8 - m
|
||||
UA, // 9 - µA
|
||||
BAR, // 10 - bar
|
||||
KW, // 11 - kW
|
||||
W, // 12 - W
|
||||
KB, // 13 - kB
|
||||
SECONDS, // 14 - s
|
||||
DBM, // 15 - dBm
|
||||
FAHRENHEIT, // 16 - °F
|
||||
MV, // 17 - mV
|
||||
SQM, // 18 - m²
|
||||
M3, // 19 - m³
|
||||
L, // 20 - L
|
||||
KMIN, // 21 - K*min
|
||||
K, // 22 - K
|
||||
CONNECTIVITY // 23 - used in HA
|
||||
};
|
||||
|
||||
// TAG mapping - maps to DeviceValueTAG_s in emsdevice.cpp
|
||||
@@ -96,7 +98,7 @@ class DeviceValue {
|
||||
TAG_WWC8,
|
||||
TAG_WWC9,
|
||||
TAG_WWC10,
|
||||
TAG_AHS,
|
||||
TAG_AHS1,
|
||||
TAG_HS1,
|
||||
TAG_HS2,
|
||||
TAG_HS3,
|
||||
@@ -130,55 +132,63 @@ class DeviceValue {
|
||||
DV_FAVORITE = (1 << 7) // 128 - sort to front
|
||||
};
|
||||
|
||||
uint8_t device_type; // EMSdevice::DeviceType
|
||||
uint8_t tag; // DeviceValueTAG::*
|
||||
void * value_p; // pointer to variable of any type
|
||||
uint8_t type; // DeviceValueType::*
|
||||
const __FlashStringHelper * const * options; // options as a flash char array
|
||||
uint8_t options_size; // number of options in the char array, calculated
|
||||
const __FlashStringHelper * short_name; // used in MQTT
|
||||
const __FlashStringHelper * full_name; // used in Web and Console
|
||||
uint8_t uom; // DeviceValueUOM::*
|
||||
uint8_t ha; // DevcieValueHA::
|
||||
bool has_cmd; // true if there is a Console/MQTT command which matches the short_name
|
||||
int16_t min; // min range
|
||||
uint16_t max; // max range
|
||||
uint8_t state; // DeviceValueState::*
|
||||
// numeric operators
|
||||
// negative numbers used for multipliers
|
||||
enum DeviceValueNumOp : int8_t {
|
||||
DV_NUMOP_NONE = 0, // default
|
||||
DV_NUMOP_DIV2 = 2,
|
||||
DV_NUMOP_DIV10 = 10,
|
||||
DV_NUMOP_DIV60 = 60,
|
||||
DV_NUMOP_DIV100 = 100,
|
||||
DV_NUMOP_MUL5 = -5,
|
||||
DV_NUMOP_MUL10 = -10,
|
||||
DV_NUMOP_MUL15 = -15
|
||||
};
|
||||
|
||||
DeviceValue(uint8_t device_type,
|
||||
uint8_t tag,
|
||||
void * value_p,
|
||||
uint8_t type,
|
||||
const __FlashStringHelper * const * options,
|
||||
uint8_t options_size,
|
||||
const __FlashStringHelper * short_name,
|
||||
const __FlashStringHelper * full_name,
|
||||
uint8_t uom,
|
||||
uint8_t ha,
|
||||
bool has_cmd,
|
||||
int16_t min,
|
||||
uint16_t max,
|
||||
uint8_t state)
|
||||
: device_type(device_type)
|
||||
, tag(tag)
|
||||
, value_p(value_p)
|
||||
, type(type)
|
||||
, options(options)
|
||||
, options_size(options_size)
|
||||
, short_name(short_name)
|
||||
, full_name(full_name)
|
||||
, uom(uom)
|
||||
, ha(ha)
|
||||
, has_cmd(has_cmd)
|
||||
, min(min)
|
||||
, max(max)
|
||||
, state(state) {
|
||||
}
|
||||
uint8_t device_type; // EMSdevice::DeviceType
|
||||
uint8_t tag; // DeviceValueTAG::*
|
||||
void * value_p; // pointer to variable of any type
|
||||
uint8_t type; // DeviceValueType::*
|
||||
const char * const ** options; // options as a flash char array
|
||||
const char * const * options_single; // options are not translated
|
||||
int8_t numeric_operator;
|
||||
uint8_t options_size; // number of options in the char array, calculated
|
||||
const char * const short_name; // used in MQTT and API
|
||||
const char * const * fullname; // used in Web and Console, is translated
|
||||
std::string custom_fullname; // optional, from customization
|
||||
uint8_t uom; // DeviceValueUOM::*
|
||||
bool has_cmd; // true if there is a Console/MQTT command which matches the short_name
|
||||
int16_t min; // min range
|
||||
uint16_t max; // max range
|
||||
uint8_t state; // DeviceValueState::*
|
||||
|
||||
DeviceValue(uint8_t device_type,
|
||||
uint8_t tag,
|
||||
void * value_p,
|
||||
uint8_t type,
|
||||
const char * const ** options,
|
||||
const char * const * options_single,
|
||||
int8_t numeric_operator,
|
||||
const char * const short_name,
|
||||
const char * const * fullname,
|
||||
std::string & custom_fullname,
|
||||
uint8_t uom,
|
||||
bool has_cmd,
|
||||
int16_t min,
|
||||
uint16_t max,
|
||||
uint8_t state);
|
||||
|
||||
bool hasValue() const;
|
||||
bool get_min_max(int16_t & dv_set_min, int16_t & dv_set_max);
|
||||
bool get_min_max(int16_t & dv_set_min, uint16_t & dv_set_max);
|
||||
|
||||
// state flags
|
||||
void set_custom_minmax();
|
||||
bool get_custom_min(int16_t & val);
|
||||
bool get_custom_max(uint16_t & val);
|
||||
std::string get_custom_fullname() const;
|
||||
std::string get_fullname() const;
|
||||
static std::string get_name(std::string & entity);
|
||||
|
||||
// dv state flags
|
||||
void add_state(uint8_t s) {
|
||||
state |= s;
|
||||
}
|
||||
@@ -192,10 +202,10 @@ class DeviceValue {
|
||||
return state;
|
||||
}
|
||||
|
||||
static const __FlashStringHelper * DeviceValueUOM_s[];
|
||||
static const __FlashStringHelper * const DeviceValueTAG_s[];
|
||||
static const __FlashStringHelper * const DeviceValueTAG_mqtt[];
|
||||
static size_t tag_count; // # tags
|
||||
static const char * DeviceValueUOM_s[];
|
||||
static const char * const * DeviceValueTAG_s[];
|
||||
static const char * const DeviceValueTAG_mqtt[];
|
||||
static size_t tag_count; // # tags
|
||||
};
|
||||
|
||||
}; // namespace emsesp
|
||||
|
||||
380
src/emsesp.cpp
380
src/emsesp.cpp
@@ -105,15 +105,24 @@ void EMSESP::fetch_device_values_type(const uint8_t device_type) {
|
||||
}
|
||||
}
|
||||
|
||||
bool EMSESP::cmd_is_readonly(const uint8_t device_type, const char * cmd, const int8_t id) {
|
||||
bool EMSESP::cmd_is_readonly(const uint8_t device_type, const uint8_t device_id, const char * cmd, const int8_t id) {
|
||||
for (const auto & emsdevice : emsdevices) {
|
||||
if (emsdevice && (emsdevice->device_type() == device_type)) {
|
||||
if (emsdevice && (emsdevice->device_type() == device_type) && (!device_id || emsdevice->device_id() == device_id)) {
|
||||
return emsdevice->is_readonly(cmd, id);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
uint8_t EMSESP::device_id_from_cmd(const uint8_t device_type, const char * cmd, const int8_t id) {
|
||||
for (const auto & emsdevice : emsdevices) {
|
||||
if (emsdevice && emsdevice->device_type() == device_type && emsdevice->has_cmd(cmd, id)) {
|
||||
return emsdevice->device_id();
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
// clears list of recognized devices
|
||||
void EMSESP::clear_all_devices() {
|
||||
// temporarily removed: clearing the list causes a crash, the associated commands and mqtt should also be removed.
|
||||
@@ -190,7 +199,7 @@ void EMSESP::uart_init() {
|
||||
if (System::is_valid_gpio(rx_gpio) && System::is_valid_gpio(tx_gpio)) {
|
||||
EMSuart::start(tx_mode, rx_gpio, tx_gpio); // start UART
|
||||
} else {
|
||||
LOG_WARNING(F("Invalid UART Rx/Tx GPIOs. Check config."));
|
||||
LOG_WARNING("Invalid UART Rx/Tx GPIOs. Check config.");
|
||||
}
|
||||
|
||||
txservice_.start(); // sends out request to EMS bus for all devices
|
||||
@@ -234,42 +243,42 @@ void EMSESP::show_ems(uuid::console::Shell & shell) {
|
||||
// EMS bus information
|
||||
switch (bus_status()) {
|
||||
case BUS_STATUS_OFFLINE:
|
||||
shell.printfln(F("EMS Bus is disconnected."));
|
||||
shell.printfln("EMS Bus is disconnected.");
|
||||
break;
|
||||
case BUS_STATUS_TX_ERRORS:
|
||||
shell.printfln(F("EMS Bus is connected, but Tx is not stable."));
|
||||
shell.printfln("EMS Bus is connected, but Tx is not stable.");
|
||||
break;
|
||||
default:
|
||||
shell.printfln(F("EMS Bus is connected."));
|
||||
shell.printfln("EMS Bus is connected.");
|
||||
break;
|
||||
}
|
||||
|
||||
shell.println();
|
||||
|
||||
if (bus_status() != BUS_STATUS_OFFLINE) {
|
||||
shell.printfln(F("EMS Bus info:"));
|
||||
EMSESP::webSettingsService.read([&](WebSettings & settings) { shell.printfln(F(" Tx mode: %d"), settings.tx_mode); });
|
||||
shell.printfln(F(" Bus protocol: %s"), EMSbus::is_ht3() ? F("HT3") : F("Buderus"));
|
||||
shell.printfln(F(" #recognized EMS devices: %d"), EMSESP::emsdevices.size());
|
||||
shell.printfln(F(" #telegrams received: %d"), rxservice_.telegram_count());
|
||||
shell.printfln(F(" #read requests sent: %d"), txservice_.telegram_read_count());
|
||||
shell.printfln(F(" #write requests sent: %d"), txservice_.telegram_write_count());
|
||||
shell.printfln(F(" #incomplete telegrams: %d"), rxservice_.telegram_error_count());
|
||||
shell.printfln(F(" #read fails (after %d retries): %d"), TxService::MAXIMUM_TX_RETRIES, txservice_.telegram_read_fail_count());
|
||||
shell.printfln(F(" #write fails (after %d retries): %d"), TxService::MAXIMUM_TX_RETRIES, txservice_.telegram_write_fail_count());
|
||||
shell.printfln(F(" Rx line quality: %d%%"), rxservice_.quality());
|
||||
shell.printfln(F(" Tx line quality: %d%%"), (txservice_.read_quality() + txservice_.read_quality()) / 2);
|
||||
shell.printfln("EMS Bus info:");
|
||||
EMSESP::webSettingsService.read([&](WebSettings & settings) { shell.printfln(" Tx mode: %d", settings.tx_mode); });
|
||||
shell.printfln(" Bus protocol: %s", EMSbus::is_ht3() ? "HT3" : "Buderus");
|
||||
shell.printfln(" #recognized EMS devices: %d", EMSESP::emsdevices.size());
|
||||
shell.printfln(" #telegrams received: %d", rxservice_.telegram_count());
|
||||
shell.printfln(" #read requests sent: %d", txservice_.telegram_read_count());
|
||||
shell.printfln(" #write requests sent: %d", txservice_.telegram_write_count());
|
||||
shell.printfln(" #incomplete telegrams: %d", rxservice_.telegram_error_count());
|
||||
shell.printfln(" #read fails (after %d retries): %d", TxService::MAXIMUM_TX_RETRIES, txservice_.telegram_read_fail_count());
|
||||
shell.printfln(" #write fails (after %d retries): %d", TxService::MAXIMUM_TX_RETRIES, txservice_.telegram_write_fail_count());
|
||||
shell.printfln(" Rx line quality: %d%%", rxservice_.quality());
|
||||
shell.printfln(" Tx line quality: %d%%", (txservice_.read_quality() + txservice_.read_quality()) / 2);
|
||||
shell.println();
|
||||
}
|
||||
|
||||
// Rx queue
|
||||
auto rx_telegrams = rxservice_.queue();
|
||||
if (rx_telegrams.empty()) {
|
||||
shell.printfln(F("Rx Queue is empty"));
|
||||
shell.printfln("Rx Queue is empty");
|
||||
} else {
|
||||
shell.printfln(F("Rx Queue (%ld telegram%s):"), rx_telegrams.size(), rx_telegrams.size() == 1 ? "" : "s");
|
||||
shell.printfln("Rx Queue (%ld telegram%s):", rx_telegrams.size(), rx_telegrams.size() == 1 ? "" : "s");
|
||||
for (const auto & it : rx_telegrams) {
|
||||
shell.printfln(F(" [%02d] %s"), it.id_, pretty_telegram(it.telegram_).c_str());
|
||||
shell.printfln(" [%02d] %s", it.id_, pretty_telegram(it.telegram_).c_str());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -278,31 +287,66 @@ void EMSESP::show_ems(uuid::console::Shell & shell) {
|
||||
// Tx queue
|
||||
auto tx_telegrams = txservice_.queue();
|
||||
if (tx_telegrams.empty()) {
|
||||
shell.printfln(F("Tx Queue is empty"));
|
||||
shell.printfln("Tx Queue is empty");
|
||||
} else {
|
||||
shell.printfln(F("Tx Queue (%ld telegram%s):"), tx_telegrams.size(), tx_telegrams.size() == 1 ? "" : "s");
|
||||
shell.printfln("Tx Queue (%ld telegram%s):", tx_telegrams.size(), tx_telegrams.size() == 1 ? "" : "s");
|
||||
|
||||
std::string op;
|
||||
for (const auto & it : tx_telegrams) {
|
||||
if ((it.telegram_->operation) == Telegram::Operation::TX_RAW) {
|
||||
op = read_flash_string(F("RAW "));
|
||||
op = "RAW ";
|
||||
} else if ((it.telegram_->operation) == Telegram::Operation::TX_READ) {
|
||||
op = read_flash_string(F("READ "));
|
||||
op = "READ ";
|
||||
} else if ((it.telegram_->operation) == Telegram::Operation::TX_WRITE) {
|
||||
op = read_flash_string(F("WRITE"));
|
||||
op = "WRITE";
|
||||
}
|
||||
shell.printfln(F(" [%02d%c] %s %s"), it.id_, ((it.retry_) ? '*' : ' '), op.c_str(), pretty_telegram(it.telegram_).c_str());
|
||||
shell.printfln(" [%02d%c] %s %s", it.id_, ((it.retry_) ? '*' : ' '), op.c_str(), pretty_telegram(it.telegram_).c_str());
|
||||
}
|
||||
}
|
||||
|
||||
shell.println();
|
||||
}
|
||||
|
||||
// Dump all entities to Serial out
|
||||
// this is intended to run within the OS with lots of available memory!
|
||||
#if defined(EMSESP_STANDALONE_DUMP)
|
||||
void EMSESP::dump_all_values(uuid::console::Shell & shell) {
|
||||
Serial.println("---- CSV START ----"); // marker use by py script
|
||||
// add header for CSV
|
||||
Serial.print(
|
||||
"device name,device type,product id,shortname,fullname,type [options...] \\| (min/max),uom,writeable,discovery entityid v3.4, discovery entityid");
|
||||
Serial.println();
|
||||
|
||||
for (const auto & device_class : EMSFactory::device_handlers()) {
|
||||
// go through each device type so they are sorted
|
||||
for (const auto & device : device_library_) {
|
||||
if (device_class.first == device.device_type) {
|
||||
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)) {
|
||||
// pick one as hc and the other as having wwc
|
||||
if (device.product_id == 160) { // MM100
|
||||
device_id = 0x28; // wwc
|
||||
} else {
|
||||
device_id = 0x20; // hc
|
||||
}
|
||||
}
|
||||
|
||||
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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Serial.println("---- CSV END ----"); // marker use by py script
|
||||
}
|
||||
#endif
|
||||
|
||||
// show EMS device values to the shell console
|
||||
// generate_values_json is called in verbose mode
|
||||
void EMSESP::show_device_values(uuid::console::Shell & shell) {
|
||||
if (emsdevices.empty()) {
|
||||
shell.printfln(F("No EMS devices detected."));
|
||||
shell.printfln("No EMS devices detected.");
|
||||
shell.println();
|
||||
return;
|
||||
}
|
||||
@@ -311,13 +355,13 @@ void EMSESP::show_device_values(uuid::console::Shell & shell) {
|
||||
for (const auto & device_class : EMSFactory::device_handlers()) {
|
||||
for (const auto & emsdevice : emsdevices) {
|
||||
if (emsdevice && (emsdevice->device_type() == device_class.first)) {
|
||||
// print header
|
||||
shell.printfln(F("%s: %s (%d)"), emsdevice->device_type_name().c_str(), emsdevice->to_string().c_str(), emsdevice->count_entities());
|
||||
// print header, with device type translated
|
||||
shell.printfln("%s: %s (%d)", emsdevice->device_type_2_device_name_translated(), emsdevice->to_string().c_str(), emsdevice->count_entities());
|
||||
|
||||
DynamicJsonDocument doc(EMSESP_JSON_SIZE_XXLARGE_DYN); // use max size
|
||||
JsonObject json = doc.to<JsonObject>();
|
||||
|
||||
emsdevice->generate_values(json, DeviceValueTAG::TAG_NONE, true, EMSdevice::OUTPUT_TARGET::CONSOLE); // verbose mode and nested
|
||||
emsdevice->generate_values(json, DeviceValueTAG::TAG_NONE, true, EMSdevice::OUTPUT_TARGET::CONSOLE);
|
||||
|
||||
// print line
|
||||
uint8_t id = 0;
|
||||
@@ -326,17 +370,7 @@ void EMSESP::show_device_values(uuid::console::Shell & shell) {
|
||||
shell.printf(" %s: ", key);
|
||||
JsonVariant data = p.value();
|
||||
shell.print(COLOR_BRIGHT_GREEN);
|
||||
if (data.is<const char *>()) {
|
||||
shell.print(data.as<const char *>());
|
||||
} else if (data.is<int>()) {
|
||||
shell.print(data.as<int>());
|
||||
} else if (data.is<float>()) {
|
||||
char s[10];
|
||||
shell.print(Helpers::render_value(s, data.as<float>(), 1));
|
||||
} else if (data.is<bool>()) {
|
||||
shell.print(data.as<bool>() ? F_(on) : F_(off));
|
||||
}
|
||||
|
||||
shell.print(data.as<std::string>());
|
||||
// if there is a uom print it
|
||||
std::string uom = emsdevice->get_value_uom(key);
|
||||
if (uom == "°C" && EMSESP::system_.fahrenheit()) {
|
||||
@@ -360,14 +394,14 @@ void EMSESP::show_device_values(uuid::console::Shell & shell) {
|
||||
// show Dallas temperature sensors and Analog sensors
|
||||
void EMSESP::show_sensor_values(uuid::console::Shell & shell) {
|
||||
if (dallassensor_.have_sensors()) {
|
||||
shell.printfln(F("Temperature sensors:"));
|
||||
shell.printfln("Temperature sensors:");
|
||||
char s[10];
|
||||
char s2[10];
|
||||
uint8_t fahrenheit = EMSESP::system_.fahrenheit() ? 2 : 0;
|
||||
|
||||
for (const auto & sensor : dallassensor_.sensors()) {
|
||||
if (Helpers::hasValue(sensor.temperature_c)) {
|
||||
shell.printfln(F(" %s: %s%s °%c%s (offset %s, ID: %s)"),
|
||||
shell.printfln(" %s: %s%s °%c%s (offset %s, ID: %s)",
|
||||
sensor.name().c_str(),
|
||||
COLOR_BRIGHT_GREEN,
|
||||
Helpers::render_value(s, sensor.temperature_c, 10, fahrenheit),
|
||||
@@ -376,10 +410,7 @@ void EMSESP::show_sensor_values(uuid::console::Shell & shell) {
|
||||
Helpers::render_value(s2, sensor.offset(), 10, fahrenheit),
|
||||
sensor.id().c_str());
|
||||
} else {
|
||||
shell.printfln(F(" %s (offset %s, ID: %s)"),
|
||||
sensor.name().c_str(),
|
||||
Helpers::render_value(s, sensor.offset(), 10, fahrenheit),
|
||||
sensor.id().c_str());
|
||||
shell.printfln(" %s (offset %s, ID: %s)", sensor.name().c_str(), Helpers::render_value(s, sensor.offset(), 10, fahrenheit), sensor.id().c_str());
|
||||
}
|
||||
}
|
||||
shell.println();
|
||||
@@ -388,11 +419,11 @@ void EMSESP::show_sensor_values(uuid::console::Shell & shell) {
|
||||
if (analogsensor_.have_sensors()) {
|
||||
char s[10];
|
||||
char s2[10];
|
||||
shell.printfln(F("Analog sensors:"));
|
||||
shell.printfln("Analog sensors:");
|
||||
for (const auto & sensor : analogsensor_.sensors()) {
|
||||
switch (sensor.type()) {
|
||||
case AnalogSensor::AnalogType::ADC:
|
||||
shell.printfln(F(" %s: %s%s %s%s (Type: ADC, Factor: %s, Offset: %d)"),
|
||||
shell.printfln(" %s: %s%s %s%s (Type: ADC, Factor: %s, Offset: %d)",
|
||||
sensor.name().c_str(),
|
||||
COLOR_BRIGHT_GREEN,
|
||||
Helpers::render_value(s, sensor.value(), 2),
|
||||
@@ -404,7 +435,7 @@ void EMSESP::show_sensor_values(uuid::console::Shell & shell) {
|
||||
default:
|
||||
// case AnalogSensor::AnalogType::DIGITAL_IN:
|
||||
// case AnalogSensor::AnalogType::COUNTER:
|
||||
shell.printfln(F(" %s: %s%d%s (Type: %s)"),
|
||||
shell.printfln(" %s: %s%d%s (Type: %s)",
|
||||
sensor.name().c_str(),
|
||||
COLOR_BRIGHT_GREEN,
|
||||
(uint16_t)sensor.value(), // as int
|
||||
@@ -430,7 +461,7 @@ void EMSESP::publish_all(bool force) {
|
||||
publish_device_values(EMSdevice::DeviceType::THERMOSTAT);
|
||||
publish_device_values(EMSdevice::DeviceType::SOLAR);
|
||||
publish_device_values(EMSdevice::DeviceType::MIXER);
|
||||
publish_other_values(); // switch and heat pump
|
||||
publish_other_values(); // switch and heat pump, ...
|
||||
publish_sensor_values(true); // includes dallas and analog sensors
|
||||
system_.send_heartbeat();
|
||||
}
|
||||
@@ -488,6 +519,8 @@ void EMSESP::reset_mqtt_ha() {
|
||||
for (const auto & emsdevice : emsdevices) {
|
||||
emsdevice->ha_config_clear();
|
||||
}
|
||||
|
||||
// force the re-creating of the dallas and analog sensor topics (for HA)
|
||||
dallassensor_.reload();
|
||||
analogsensor_.reload();
|
||||
}
|
||||
@@ -512,6 +545,7 @@ void EMSESP::publish_device_values(uint8_t device_type) {
|
||||
if (emsdevice->ha_config_firstrun()) {
|
||||
emsdevice->ha_config_clear();
|
||||
emsdevice->ha_config_firstrun(false);
|
||||
return;
|
||||
} else {
|
||||
// see if we need to delete and /config topics before adding the payloads
|
||||
emsdevice->mqtt_ha_entity_config_remove();
|
||||
@@ -525,7 +559,7 @@ void EMSESP::publish_device_values(uint8_t device_type) {
|
||||
for (const auto & emsdevice : emsdevices) {
|
||||
if (emsdevice && (emsdevice->device_type() == device_type)) {
|
||||
if (nested && !nest_created && emsdevice->has_tag(tag)) {
|
||||
json_hc = doc.createNestedObject(EMSdevice::tag_to_string(tag));
|
||||
json_hc = doc.createNestedObject(EMSdevice::tag_to_mqtt(tag));
|
||||
nest_created = true;
|
||||
}
|
||||
need_publish |= emsdevice->generate_values(json_hc, tag, false, EMSdevice::OUTPUT_TARGET::MQTT);
|
||||
@@ -539,7 +573,7 @@ void EMSESP::publish_device_values(uint8_t device_type) {
|
||||
}
|
||||
if (need_publish) {
|
||||
if (doc.overflowed()) {
|
||||
LOG_WARNING(F("MQTT buffer overflow, please use individual topics"));
|
||||
LOG_WARNING("MQTT buffer overflow, please use individual topics");
|
||||
}
|
||||
Mqtt::publish(Mqtt::tag_to_topic(device_type, DeviceValueTAG::TAG_NONE), json);
|
||||
}
|
||||
@@ -558,6 +592,13 @@ void EMSESP::publish_device_values(uint8_t device_type) {
|
||||
void EMSESP::publish_other_values() {
|
||||
publish_device_values(EMSdevice::DeviceType::SWITCH);
|
||||
publish_device_values(EMSdevice::DeviceType::HEATPUMP);
|
||||
publish_device_values(EMSdevice::DeviceType::HEATSOURCE);
|
||||
// other devices without values yet
|
||||
// publish_device_values(EMSdevice::DeviceType::GATEWAY);
|
||||
// publish_device_values(EMSdevice::DeviceType::CONNECT);
|
||||
// publish_device_values(EMSdevice::DeviceType::ALERT);
|
||||
// publish_device_values(EMSdevice::DeviceType::PUMP);
|
||||
// publish_device_values(EMSdevice::DeviceType::GENERIC);
|
||||
}
|
||||
|
||||
// publish both the dallas and analog sensor values
|
||||
@@ -595,14 +636,16 @@ void EMSESP::publish_response(std::shared_ptr<const Telegram> telegram) {
|
||||
doc["value"] = value;
|
||||
}
|
||||
|
||||
Mqtt::publish(F_(response), doc.as<JsonObject>());
|
||||
Mqtt::publish("response", doc.as<JsonObject>());
|
||||
}
|
||||
|
||||
// builds json with the detail of each value, for a specific EMS device type or the dallas sensor
|
||||
bool EMSESP::get_device_value_info(JsonObject & root, const char * cmd, const int8_t id, const uint8_t devicetype) {
|
||||
for (const auto & emsdevice : emsdevices) {
|
||||
if (emsdevice->device_type() == devicetype) {
|
||||
return emsdevice->get_value_info(root, cmd, id);
|
||||
if (emsdevice->get_value_info(root, cmd, id)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -618,15 +661,19 @@ bool EMSESP::get_device_value_info(JsonObject & root, const char * cmd, const in
|
||||
return true;
|
||||
}
|
||||
|
||||
char error[100];
|
||||
snprintf(error, sizeof(error), "cannot find values for entity '%s'", cmd);
|
||||
root["message"] = error;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// search for recognized device_ids : Me, All, otherwise print hex value
|
||||
std::string EMSESP::device_tostring(const uint8_t device_id) {
|
||||
if ((device_id & 0x7F) == rxservice_.ems_bus_id()) {
|
||||
return read_flash_string(F("Me"));
|
||||
return "Me";
|
||||
} else if (device_id == 0x00) {
|
||||
return read_flash_string(F("All"));
|
||||
return "All";
|
||||
} else {
|
||||
char buffer[5];
|
||||
return Helpers::hextoa(buffer, device_id);
|
||||
@@ -671,23 +718,26 @@ std::string EMSESP::pretty_telegram(std::shared_ptr<const Telegram> telegram) {
|
||||
|
||||
// check for global/common types like Version & UBADevices
|
||||
if (telegram->type_id == EMSdevice::EMS_TYPE_VERSION) {
|
||||
type_name = read_flash_string(F("Version"));
|
||||
type_name = "Version";
|
||||
} else if (telegram->type_id == EMSdevice::EMS_TYPE_UBADevices) {
|
||||
type_name = read_flash_string(F("UBADevices"));
|
||||
type_name = "UBADevices";
|
||||
}
|
||||
|
||||
// if we don't know the type show
|
||||
if (type_name.empty()) {
|
||||
type_name = read_flash_string(F("?"));
|
||||
type_name = "?";
|
||||
}
|
||||
|
||||
std::string str;
|
||||
str.reserve(200);
|
||||
if (telegram->operation == Telegram::Operation::RX_READ) {
|
||||
str = src_name + "(" + Helpers::hextoa(src) + ") <- " + dest_name + "(" + Helpers::hextoa(dest) + "), " + type_name + "("
|
||||
str = src_name + "(" + Helpers::hextoa(src) + ") -R-> " + dest_name + "(" + Helpers::hextoa(dest) + "), " + type_name + "("
|
||||
+ Helpers::hextoa(telegram->type_id) + "), length: " + Helpers::hextoa(telegram->message_data[0]);
|
||||
} else if (telegram->dest == 0) {
|
||||
str = src_name + "(" + Helpers::hextoa(src) + ") -B-> " + dest_name + "(" + Helpers::hextoa(dest) + "), " + type_name + "("
|
||||
+ Helpers::hextoa(telegram->type_id) + "), data: " + telegram->to_string_message();
|
||||
} else {
|
||||
str = src_name + "(" + Helpers::hextoa(src) + ") -> " + dest_name + "(" + Helpers::hextoa(dest) + "), " + type_name + "("
|
||||
str = src_name + "(" + Helpers::hextoa(src) + ") -W-> " + dest_name + "(" + Helpers::hextoa(dest) + "), " + type_name + "("
|
||||
+ Helpers::hextoa(telegram->type_id) + "), data: " + telegram->to_string_message();
|
||||
}
|
||||
|
||||
@@ -724,7 +774,7 @@ void EMSESP::process_UBADevices(std::shared_ptr<const Telegram> telegram) {
|
||||
// if we haven't already detected this device, request it's version details, unless its us (EMS-ESP)
|
||||
// when the version info is received, it will automagically add the device
|
||||
if ((device_id != EMSbus::ems_bus_id()) && !(EMSESP::device_exists(device_id))) {
|
||||
LOG_DEBUG(F("New EMS device detected with ID 0x%02X. Requesting version information."), device_id);
|
||||
LOG_DEBUG("New EMS device detected with ID 0x%02X. Requesting version information.", device_id);
|
||||
send_read_request(EMSdevice::EMS_TYPE_VERSION, device_id);
|
||||
}
|
||||
}
|
||||
@@ -779,12 +829,12 @@ void EMSESP::process_version(std::shared_ptr<const Telegram> telegram) {
|
||||
|
||||
// find the device object that matches the deviceID and see if it has a matching telegram type handler
|
||||
// but only process if the telegram is sent to us or it's a broadcast (dest=0x00=all)
|
||||
// We also check for common telgram types, like the Version(0x02)
|
||||
// We also check for common telegram types, like the Version(0x02)
|
||||
// returns false if there are none found
|
||||
bool EMSESP::process_telegram(std::shared_ptr<const Telegram> telegram) {
|
||||
// if watching or reading...
|
||||
if ((telegram->type_id == read_id_) && (telegram->dest == txservice_.ems_bus_id())) {
|
||||
LOG_INFO(F("%s"), pretty_telegram(telegram).c_str());
|
||||
LOG_INFO("%s", pretty_telegram(telegram).c_str());
|
||||
if (Mqtt::send_response()) {
|
||||
publish_response(telegram);
|
||||
}
|
||||
@@ -796,18 +846,18 @@ bool EMSESP::process_telegram(std::shared_ptr<const Telegram> telegram) {
|
||||
} else if (watch() == WATCH_ON) {
|
||||
if ((watch_id_ == WATCH_ID_NONE) || (telegram->type_id == watch_id_)
|
||||
|| ((watch_id_ < 0x80) && ((telegram->src == watch_id_) || (telegram->dest == watch_id_)))) {
|
||||
LOG_NOTICE(F("%s"), pretty_telegram(telegram).c_str());
|
||||
LOG_NOTICE("%s", pretty_telegram(telegram).c_str());
|
||||
} else if (!trace_raw_) {
|
||||
LOG_TRACE(F("%s"), pretty_telegram(telegram).c_str());
|
||||
LOG_TRACE("%s", pretty_telegram(telegram).c_str());
|
||||
}
|
||||
} else if (!trace_raw_) {
|
||||
LOG_TRACE(F("%s"), pretty_telegram(telegram).c_str());
|
||||
LOG_TRACE("%s", pretty_telegram(telegram).c_str());
|
||||
}
|
||||
|
||||
// only process broadcast telegrams or ones sent to us on request
|
||||
// if ((telegram->dest != 0x00) && (telegram->dest != rxservice_.ems_bus_id())) {
|
||||
if (telegram->operation == Telegram::Operation::RX_READ) {
|
||||
// LOG_DEBUG(F("read telegram received, not processing"));
|
||||
// LOG_DEBUG("read telegram received, not processing");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -856,10 +906,11 @@ bool EMSESP::process_telegram(std::shared_ptr<const Telegram> telegram) {
|
||||
}
|
||||
}
|
||||
|
||||
if (!found) {
|
||||
LOG_DEBUG(F("No telegram type handler found for ID 0x%02X (src 0x%02X)"), telegram->type_id, telegram->src);
|
||||
// handle unknown broadcasted telegrams
|
||||
if (!found && telegram->dest == 0) {
|
||||
LOG_DEBUG("No telegram type handler found for ID 0x%02X (src 0x%02X)", telegram->type_id, telegram->src);
|
||||
if (watch() == WATCH_UNKNOWN) {
|
||||
LOG_NOTICE(F("%s"), pretty_telegram(telegram).c_str());
|
||||
LOG_NOTICE("%s", pretty_telegram(telegram).c_str());
|
||||
}
|
||||
if (!wait_km_ && !knowndevice && (telegram->src != EMSbus::ems_bus_id()) && (telegram->message_length > 0)) {
|
||||
send_read_request(EMSdevice::EMS_TYPE_VERSION, telegram->src);
|
||||
@@ -883,12 +934,12 @@ bool EMSESP::device_exists(const uint8_t device_id) {
|
||||
// for each associated EMS device go and get its system information
|
||||
void EMSESP::show_devices(uuid::console::Shell & shell) {
|
||||
if (emsdevices.empty()) {
|
||||
shell.printfln(F("No EMS devices detected. Try using 'scan devices' from the ems menu."));
|
||||
shell.printfln("No EMS devices detected. Try using 'scan devices' from the ems menu.");
|
||||
shell.println();
|
||||
return;
|
||||
}
|
||||
|
||||
shell.printfln(F("These EMS devices are currently active:"));
|
||||
shell.printfln("These EMS devices are currently active:");
|
||||
shell.println();
|
||||
|
||||
// count the number of thermostats
|
||||
@@ -899,12 +950,13 @@ void EMSESP::show_devices(uuid::console::Shell & shell) {
|
||||
}
|
||||
}
|
||||
|
||||
// for all device objects from emsdevice.h (UNKNOWN, SYSTEM, BOILER, THERMOSTAT, MIXER, SOLAR, HEATPUMP, GATEWAY, SWITCH, CONTROLLER, CONNECT)
|
||||
// for all device objects from emsdevice.h
|
||||
// so we keep a consistent order
|
||||
// don't translate the device type name
|
||||
for (const auto & device_class : EMSFactory::device_handlers()) {
|
||||
for (const auto & emsdevice : emsdevices) {
|
||||
if (emsdevice && (emsdevice->device_type() == device_class.first)) {
|
||||
shell.printf(F("%s: %s"), emsdevice->device_type_name().c_str(), emsdevice->to_string().c_str());
|
||||
shell.printf("%s: %s", emsdevice->device_type_name(), emsdevice->to_string().c_str());
|
||||
shell.println();
|
||||
emsdevice->show_telegram_handlers(shell);
|
||||
|
||||
@@ -931,7 +983,7 @@ bool EMSESP::add_device(const uint8_t device_id, const uint8_t product_id, const
|
||||
if (product_id == 0) { // update only with valid product_id
|
||||
return true;
|
||||
}
|
||||
LOG_DEBUG(F("Updating details for already active deviceID 0x%02X"), device_id);
|
||||
LOG_DEBUG("Updating details for already active deviceID 0x%02X", device_id);
|
||||
emsdevice->product_id(product_id);
|
||||
emsdevice->version(version);
|
||||
// only set brand if it doesn't already exist
|
||||
@@ -941,7 +993,7 @@ bool EMSESP::add_device(const uint8_t device_id, const uint8_t product_id, const
|
||||
// find the name and flags in our database
|
||||
for (const auto & device : device_library_) {
|
||||
if (device.product_id == product_id && device.device_type == emsdevice->device_type()) {
|
||||
emsdevice->name(std::move(read_flash_string(device.name)));
|
||||
emsdevice->name(device.name);
|
||||
emsdevice->add_flags(device.flags);
|
||||
}
|
||||
}
|
||||
@@ -955,13 +1007,18 @@ bool EMSESP::add_device(const uint8_t device_id, const uint8_t product_id, const
|
||||
for (auto & device : device_library_) {
|
||||
if (device.product_id == product_id) {
|
||||
// sometimes boilers share the same productID as controllers
|
||||
// so only add boilers if the device_id is 0x08 or 0x60 or 0x70.., which is fixed for EMS
|
||||
// so only add boilers if the device_id is 0x08
|
||||
// cascaded boilers with 0x70.., map to heatsources
|
||||
if (device.device_type == DeviceType::BOILER) {
|
||||
if (device_id == EMSdevice::EMS_DEVICE_ID_BOILER || device_id == EMSdevice::EMS_DEVICE_ID_AM200
|
||||
|| (device_id >= EMSdevice::EMS_DEVICE_ID_BOILER_1 && device_id <= EMSdevice::EMS_DEVICE_ID_BOILER_F)) {
|
||||
if (device_id == EMSdevice::EMS_DEVICE_ID_BOILER) {
|
||||
device_p = &device;
|
||||
break;
|
||||
}
|
||||
if ((device_id >= EMSdevice::EMS_DEVICE_ID_HS1 && device_id <= EMSdevice::EMS_DEVICE_ID_HS16)) {
|
||||
device_p = &device;
|
||||
device_p->device_type = DeviceType::HEATSOURCE;
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
// it's not a boiler, but we have a match
|
||||
device_p = &device;
|
||||
@@ -972,59 +1029,78 @@ bool EMSESP::add_device(const uint8_t device_id, const uint8_t product_id, const
|
||||
|
||||
// if we don't recognize the productID report it and add as a generic device
|
||||
if (device_p == nullptr) {
|
||||
LOG_NOTICE(F("Unrecognized EMS device (deviceID 0x%02X, productID %d). Please report on GitHub."), device_id, product_id);
|
||||
std::string name("unknown");
|
||||
LOG_NOTICE("Unrecognized EMS device (deviceID 0x%02X, productID %d). Please report on GitHub.", device_id, product_id);
|
||||
emsdevices.push_back(
|
||||
EMSFactory::add(DeviceType::GENERIC, device_id, product_id, version, name, DeviceFlags::EMS_DEVICE_FLAG_NONE, EMSdevice::Brand::NO_BRAND));
|
||||
EMSFactory::add(DeviceType::GENERIC, device_id, product_id, version, "unknown", DeviceFlags::EMS_DEVICE_FLAG_NONE, EMSdevice::Brand::NO_BRAND));
|
||||
return false; // not found
|
||||
}
|
||||
|
||||
auto name = read_flash_string(device_p->name);
|
||||
auto name = device_p->name;
|
||||
auto device_type = device_p->device_type;
|
||||
auto flags = device_p->flags;
|
||||
|
||||
// check for integrated modules with same product id
|
||||
if (device_type == DeviceType::HEATPUMP) {
|
||||
if (device_id == EMSdevice::EMS_DEVICE_ID_MODEM) {
|
||||
device_type = DeviceType::GATEWAY;
|
||||
name = "WiFi module";
|
||||
} else if (device_id == EMSdevice::EMS_DEVICE_ID_RFBASE) {
|
||||
device_type = DeviceType::CONNECT;
|
||||
name = "Wireless sensor base";
|
||||
}
|
||||
}
|
||||
|
||||
// empty reply to version, read a generic device from database
|
||||
if (product_id == 0) {
|
||||
// check for known device IDs
|
||||
if (device_id == 0x40) {
|
||||
// see: https://github.com/emsesp/EMS-ESP32/issues/103#issuecomment-911717342
|
||||
name = "rf room temperature sensor"; // generic
|
||||
} else if (device_id == 0x17) {
|
||||
name = "generic thermostat";
|
||||
if (device_id == EMSdevice::EMS_DEVICE_ID_RFSENSOR) {
|
||||
// see: https://github.com/emsesp/EMS-ESP32/issues/103#issuecomment-911717342 and https://github.com/emsesp/EMS-ESP32/issues/624
|
||||
name = "RF room temperature sensor";
|
||||
device_type = DeviceType::THERMOSTAT;
|
||||
} else if (device_id == EMSdevice::EMS_DEVICE_ID_ROOMTHERMOSTAT) {
|
||||
name = "Generic thermostat";
|
||||
device_type = DeviceType::THERMOSTAT;
|
||||
flags = DeviceFlags::EMS_DEVICE_FLAG_RC10 | DeviceFlags::EMS_DEVICE_FLAG_NO_WRITE;
|
||||
} else if (device_id == 0x04) {
|
||||
} else if (device_id == EMSdevice::EMS_DEVICE_ID_RS232) {
|
||||
name = "RS232";
|
||||
device_type = DeviceType::CONNECT;
|
||||
} else if (device_id == 0x0A) {
|
||||
name = "terminal";
|
||||
} else if (device_id == EMSdevice::EMS_DEVICE_ID_TERMINAL) {
|
||||
name = "Terminal";
|
||||
device_type = DeviceType::CONNECT;
|
||||
} else if (device_id == 0x0B) {
|
||||
name = "service key";
|
||||
} else if (device_id == EMSdevice::EMS_DEVICE_ID_SERVICEKEY) {
|
||||
name = "Service key";
|
||||
device_type = DeviceType::CONNECT;
|
||||
} else if (device_id == 0x0C) {
|
||||
name = "cascade";
|
||||
} else if (device_id == EMSdevice::EMS_DEVICE_ID_CASCADE) {
|
||||
name = "Cascade";
|
||||
device_type = DeviceType::CONNECT;
|
||||
} else if (device_id == 0x0D) {
|
||||
} else if (device_id == EMSdevice::EMS_DEVICE_ID_EASYCOM) {
|
||||
// see https://github.com/emsesp/EMS-ESP/issues/460#issuecomment-709553012
|
||||
name = "modem";
|
||||
name = "Modem";
|
||||
device_type = DeviceType::CONNECT;
|
||||
} else if (device_id == 0x0E) {
|
||||
name = "converter"; // generic
|
||||
} else if (device_id == 0x0F) {
|
||||
name = "clock"; // generic
|
||||
} else if (device_id == 0x08) {
|
||||
name = "generic boiler";
|
||||
} else if (device_id == EMSdevice::EMS_DEVICE_ID_CONVERTER) {
|
||||
name = "Converter"; // generic
|
||||
} else if (device_id == EMSdevice::EMS_DEVICE_ID_CLOCK) {
|
||||
name = "Clock"; // generic
|
||||
device_type = DeviceType::CONTROLLER;
|
||||
} else if (device_id == EMSdevice::EMS_DEVICE_ID_CONTROLLER) {
|
||||
name = "Generic controller";
|
||||
device_type = DeviceType::CONTROLLER;
|
||||
} else if (device_id == EMSdevice::EMS_DEVICE_ID_BOILER) {
|
||||
name = "Generic boiler";
|
||||
device_type = DeviceType::BOILER;
|
||||
flags = DeviceFlags::EMS_DEVICE_FLAG_HEATPUMP;
|
||||
LOG_WARNING(F("Unknown EMS boiler. Using generic profile. Please report on GitHub."));
|
||||
LOG_WARNING("Unknown EMS boiler. Using generic profile. Please report on GitHub.");
|
||||
} else if (device_id >= 0x68 && device_id <= 0x6F) {
|
||||
// test for https://github.com/emsesp/EMS-ESP32/issues/882
|
||||
name = "Cascaded controller";
|
||||
device_type = DeviceType::CONTROLLER;
|
||||
} else {
|
||||
LOG_WARNING(F("Unrecognized EMS device (device ID 0x%02X, no product ID). Please report on GitHub."), device_id);
|
||||
LOG_WARNING("Unrecognized EMS device (device ID 0x%02X, no product ID). Please report on GitHub.", device_id);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
LOG_DEBUG(F("Adding new device %s (deviceID 0x%02X, productID %d, version %s)"), name.c_str(), device_id, product_id, version);
|
||||
LOG_DEBUG("Adding new device %s (deviceID 0x%02X, productID %d, version %s)", name, device_id, product_id, version);
|
||||
emsdevices.push_back(EMSFactory::add(device_type, device_id, product_id, version, name, flags, brand));
|
||||
|
||||
// assign a unique ID. Note that this is not actual unique after a restart as it's dependent on the order that devices are found
|
||||
@@ -1038,7 +1114,7 @@ bool EMSESP::add_device(const uint8_t device_id, const uint8_t product_id, const
|
||||
fetch_device_values(device_id); // go and fetch its data
|
||||
|
||||
// Print to LOG showing we've added a new device
|
||||
LOG_INFO(F("Recognized new %s with deviceID 0x%02X"), EMSdevice::device_type_2_device_name(device_type).c_str(), device_id);
|
||||
LOG_INFO("Recognized new %s with deviceID 0x%02X", EMSdevice::device_type_2_device_name(device_type), device_id);
|
||||
|
||||
// add command commands for all devices, except for connect, controller and gateway
|
||||
if ((device_type == DeviceType::CONNECT) || (device_type == DeviceType::CONTROLLER) || (device_type == DeviceType::GATEWAY)) {
|
||||
@@ -1051,10 +1127,10 @@ bool EMSESP::add_device(const uint8_t device_id, const uint8_t product_id, const
|
||||
[device_type](const char * value, const int8_t id, JsonObject & output) {
|
||||
return command_info(device_type, output, id, EMSdevice::OUTPUT_TARGET::API_VERBOSE);
|
||||
},
|
||||
F_(info_cmd));
|
||||
FL_(info_cmd));
|
||||
Command::add(
|
||||
device_type,
|
||||
F("values"),
|
||||
F_(values),
|
||||
[device_type](const char * value, const int8_t id, JsonObject & output) {
|
||||
return command_info(device_type, output, id, EMSdevice::OUTPUT_TARGET::API_SHORTNAMES); // HIDDEN command showing short names, used in e.g. /api/boiler
|
||||
},
|
||||
@@ -1064,15 +1140,16 @@ bool EMSESP::add_device(const uint8_t device_id, const uint8_t product_id, const
|
||||
device_type,
|
||||
F_(commands),
|
||||
[device_type](const char * value, const int8_t id, JsonObject & output) { return command_commands(device_type, output, id); },
|
||||
F_(commands_cmd));
|
||||
FL_(commands_cmd));
|
||||
Command::add(
|
||||
device_type,
|
||||
F_(entities),
|
||||
[device_type](const char * value, const int8_t id, JsonObject & output) { return command_entities(device_type, output, id); },
|
||||
F_(entities_cmd));
|
||||
FL_(entities_cmd));
|
||||
|
||||
// MQTT subscribe to the device e.g. "ems-esp/boiler/#"
|
||||
Mqtt::subscribe(device_type, EMSdevice::device_type_2_device_name(device_type) + "/#", nullptr);
|
||||
auto topic = std::string(EMSdevice::device_type_2_device_name(device_type)) + "/#";
|
||||
Mqtt::subscribe(device_type, topic, nullptr);
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -1123,7 +1200,7 @@ bool EMSESP::command_info(uint8_t device_type, JsonObject & output, const int8_t
|
||||
for (const auto & emsdevice : emsdevices) {
|
||||
if (emsdevice && (emsdevice->device_type() == device_type)) {
|
||||
if (!nest_created && emsdevice->has_tag(tag)) {
|
||||
output_hc = output.createNestedObject(EMSdevice::tag_to_string(tag));
|
||||
output_hc = output.createNestedObject(EMSdevice::tag_to_mqtt(tag));
|
||||
nest_created = true;
|
||||
}
|
||||
has_value |= emsdevice->generate_values(output_hc, tag, true, output_target); // use nested for id -1 and 0
|
||||
@@ -1173,7 +1250,7 @@ void EMSESP::incoming_telegram(uint8_t * data, const uint8_t length) {
|
||||
Roomctrl::check((data[1] ^ 0x80 ^ rxservice_.ems_mask()), data);
|
||||
#ifdef EMSESP_UART_DEBUG
|
||||
// get_uptime is only updated once per loop, does not give the right time
|
||||
LOG_TRACE(F("[UART_DEBUG] Echo after %d ms: %s"), ::millis() - rx_time_, Helpers::data_to_hex(data, length).c_str());
|
||||
LOG_TRACE("[UART_DEBUG] Echo after %d ms: %s", ::millis() - rx_time_, Helpers::data_to_hex(data, length).c_str());
|
||||
#endif
|
||||
// add to RxQueue for log/watch
|
||||
rxservice_.add(data, length);
|
||||
@@ -1189,30 +1266,31 @@ void EMSESP::incoming_telegram(uint8_t * data, const uint8_t length) {
|
||||
// if we're waiting on a Write operation, we want a single byte 1 or 4
|
||||
if ((tx_state == Telegram::Operation::TX_WRITE) && (length == 1)) {
|
||||
if (first_value == TxService::TX_WRITE_SUCCESS) {
|
||||
LOG_DEBUG(F("Last Tx write successful"));
|
||||
LOG_DEBUG("Last Tx write successful");
|
||||
txservice_.increment_telegram_write_count(); // last tx/write was confirmed ok
|
||||
txservice_.send_poll(); // close the bus
|
||||
publish_id_ = txservice_.post_send_query(); // follow up with any post-read if set
|
||||
txservice_.reset_retry_count();
|
||||
tx_successful = true;
|
||||
} else if (first_value == TxService::TX_WRITE_FAIL) {
|
||||
LOG_ERROR(F("Last Tx write rejected by host"));
|
||||
LOG_ERROR("Last Tx write rejected by host");
|
||||
txservice_.send_poll(); // close the bus
|
||||
txservice_.reset_retry_count();
|
||||
tx_successful = true;
|
||||
}
|
||||
} else if (tx_state == Telegram::Operation::TX_READ) {
|
||||
// got a telegram with data in it. See if the src/dest matches that from the last one we sent and continue to process it
|
||||
uint8_t src = data[0];
|
||||
uint8_t dest = data[1];
|
||||
if (txservice_.is_last_tx(src, dest)) {
|
||||
LOG_DEBUG(F("Last Tx read successful"));
|
||||
LOG_DEBUG("Last Tx read successful");
|
||||
txservice_.increment_telegram_read_count();
|
||||
txservice_.send_poll(); // close the bus
|
||||
txservice_.reset_retry_count();
|
||||
tx_successful = true;
|
||||
|
||||
// if telegram is longer read next part with offset +25 for ems+ or +27 for ems1.0
|
||||
if ((length == 32) && (txservice_.read_next_tx(data[3]) == read_id_)) {
|
||||
if ((length >= 31) && (txservice_.read_next_tx(data[3], length) == read_id_)) {
|
||||
read_next_ = true;
|
||||
}
|
||||
}
|
||||
@@ -1247,15 +1325,15 @@ void EMSESP::incoming_telegram(uint8_t * data, const uint8_t length) {
|
||||
#ifdef EMSESP_UART_DEBUG
|
||||
char s[4];
|
||||
if (first_value & 0x80) {
|
||||
LOG_TRACE(F("[UART_DEBUG] next Poll %s after %d ms"), Helpers::hextoa(s, first_value), ::millis() - rx_time_);
|
||||
LOG_TRACE("[UART_DEBUG] next Poll %s after %d ms", Helpers::hextoa(s, first_value), ::millis() - rx_time_);
|
||||
// time measurement starts here, use millis because get_uptime is only updated once per loop
|
||||
rx_time_ = ::millis();
|
||||
} else {
|
||||
LOG_TRACE(F("[UART_DEBUG] Poll ack %s after %d ms"), Helpers::hextoa(s, first_value), ::millis() - rx_time_);
|
||||
LOG_TRACE("[UART_DEBUG] Poll ack %s after %d ms", Helpers::hextoa(s, first_value), ::millis() - rx_time_);
|
||||
}
|
||||
#endif
|
||||
// check for poll to us, if so send top message from Tx queue immediately and quit
|
||||
if (poll_id == txservice_.ems_bus_id()) {
|
||||
if (poll_id == txservice_.get_send_id()) {
|
||||
txservice_.send();
|
||||
}
|
||||
// send remote room temperature if active
|
||||
@@ -1263,7 +1341,7 @@ void EMSESP::incoming_telegram(uint8_t * data, const uint8_t length) {
|
||||
return;
|
||||
} else {
|
||||
#ifdef EMSESP_UART_DEBUG
|
||||
LOG_TRACE(F("[UART_DEBUG] Reply after %d ms: %s"), ::millis() - rx_time_, Helpers::data_to_hex(data, length).c_str());
|
||||
LOG_TRACE("[UART_DEBUG] Reply after %d ms: %s", ::millis() - rx_time_, Helpers::data_to_hex(data, length).c_str());
|
||||
#endif
|
||||
Roomctrl::check((data[1] ^ 0x80 ^ rxservice_.ems_mask()), data); // check if there is a message for the roomcontroller
|
||||
|
||||
@@ -1271,11 +1349,6 @@ void EMSESP::incoming_telegram(uint8_t * data, const uint8_t length) {
|
||||
}
|
||||
}
|
||||
|
||||
// sends raw data of bytes along the Tx line
|
||||
void EMSESP::send_raw_telegram(const char * data) {
|
||||
txservice_.send_raw(data);
|
||||
}
|
||||
|
||||
// start all the core services
|
||||
// the services must be loaded in the correct order
|
||||
void EMSESP::start() {
|
||||
@@ -1289,18 +1362,46 @@ void EMSESP::start() {
|
||||
}
|
||||
#endif
|
||||
|
||||
// do a quick scan of the filesystem to see if we have a /config folder
|
||||
// so we know if this is a new install or not
|
||||
#ifndef EMSESP_STANDALONE
|
||||
File root = LittleFS.open("/config");
|
||||
bool factory_settings = !root;
|
||||
if (!root) {
|
||||
#ifdef EMSESP_DEBUG
|
||||
Serial.println("No config found, assuming factory settings");
|
||||
#endif
|
||||
}
|
||||
root.close();
|
||||
#else
|
||||
bool factory_settings = false;
|
||||
#endif
|
||||
|
||||
esp8266React.begin(); // loads core system services settings (network, mqtt, ap, ntp etc)
|
||||
webLogService.begin(); // start web log service. now we can start capturing logs to the web log
|
||||
LOG_INFO(F("Last system reset reason Core0: %s, Core1: %s"), system_.reset_reason(0).c_str(), system_.reset_reason(1).c_str());
|
||||
|
||||
// do any system upgrades
|
||||
if (system_.check_upgrade()) {
|
||||
LOG_INFO(F("System will be restarted to apply upgrade"));
|
||||
#ifdef EMSESP_DEBUG
|
||||
LOG_NOTICE("System is running in Debug mode");
|
||||
#endif
|
||||
|
||||
LOG_INFO("Last system reset reason Core0: %s, Core1: %s", system_.reset_reason(0).c_str(), system_.reset_reason(1).c_str());
|
||||
|
||||
// see if we're restoring a settings file
|
||||
if (system_.check_restore()) {
|
||||
LOG_WARNING("System needs a restart to apply new settings. Please wait.");
|
||||
system_.system_restart();
|
||||
};
|
||||
|
||||
webSettingsService.begin(); // load EMS-ESP Application settings...
|
||||
system_.reload_settings(); // ... and store some of the settings locally
|
||||
webSettingsService.begin(); // load EMS-ESP Application settings...
|
||||
|
||||
// do any system upgrades
|
||||
if (system_.check_upgrade(factory_settings)) {
|
||||
LOG_WARNING("System needs a restart to apply new settings. Please wait.");
|
||||
system_.system_restart();
|
||||
};
|
||||
|
||||
system_.reload_settings(); // ... and store some of the settings locally
|
||||
|
||||
webCustomizationService.begin(); // load the customizations
|
||||
|
||||
// start telnet service if it's enabled
|
||||
@@ -1311,7 +1412,7 @@ void EMSESP::start() {
|
||||
// start all the EMS-ESP services
|
||||
mqtt_.start(); // mqtt init
|
||||
system_.start(); // starts commands, led, adc, button, network, syslog & uart
|
||||
LOG_INFO(F("Starting EMS-ESP version %s (hostname: %s)"), EMSESP_APP_VERSION, system_.hostname().c_str()); // welcome message
|
||||
LOG_INFO(("Starting EMS-ESP version %s (hostname: %s)"), EMSESP_APP_VERSION, system_.hostname().c_str()); // welcome message
|
||||
|
||||
shower_.start(); // initialize shower timer and shower alert
|
||||
dallassensor_.start(); // Dallas external sensors
|
||||
@@ -1322,7 +1423,7 @@ void EMSESP::start() {
|
||||
device_library_ = {
|
||||
#include "device_library.h"
|
||||
};
|
||||
LOG_INFO(F("Loaded EMS device library (%d records)"), device_library_.size());
|
||||
LOG_INFO("Loaded EMS device library (%d records)", device_library_.size());
|
||||
|
||||
#if defined(EMSESP_STANDALONE)
|
||||
Mqtt::on_connect(); // simulate an MQTT connection
|
||||
@@ -1339,6 +1440,7 @@ void EMSESP::scheduled_fetch_values() {
|
||||
last_fetch_ = uuid::get_uptime();
|
||||
no = 1;
|
||||
}
|
||||
|
||||
if (txservice_.tx_queue_empty()) {
|
||||
uint8_t i = 0;
|
||||
for (const auto & emsdevice : emsdevices) {
|
||||
|
||||
15
src/emsesp.h
15
src/emsesp.h
@@ -92,6 +92,8 @@ using DeviceValueUOM = emsesp::DeviceValue::DeviceValueUOM;
|
||||
using DeviceValueType = emsesp::DeviceValue::DeviceValueType;
|
||||
using DeviceValueState = emsesp::DeviceValue::DeviceValueState;
|
||||
using DeviceValueTAG = emsesp::DeviceValue::DeviceValueTAG;
|
||||
using DeviceValueNumOp = emsesp::DeviceValue::DeviceValueNumOp;
|
||||
|
||||
|
||||
class Shower; // forward declaration for compiler
|
||||
|
||||
@@ -126,10 +128,10 @@ class EMSESP {
|
||||
static void send_write_request(const uint16_t type_id, const uint8_t dest, const uint8_t offset, const uint8_t value);
|
||||
static void send_write_request(const uint16_t type_id, const uint8_t dest, const uint8_t offset, const uint8_t value, const uint16_t validate_typeid);
|
||||
|
||||
static void send_raw_telegram(const char * data);
|
||||
static bool device_exists(const uint8_t device_id);
|
||||
static bool cmd_is_readonly(const uint8_t device_type, const char * cmd, const int8_t id);
|
||||
static bool cmd_is_readonly(const uint8_t device_type, const uint8_t device_id, const char * cmd, const int8_t id);
|
||||
|
||||
static uint8_t device_id_from_cmd(const uint8_t device_type, const char * cmd, const int8_t id);
|
||||
static uint8_t count_devices(const uint8_t device_type);
|
||||
static uint8_t count_devices();
|
||||
static uint8_t device_index(const uint8_t device_type, const uint8_t unique_id);
|
||||
@@ -138,6 +140,7 @@ class EMSESP {
|
||||
|
||||
static void show_device_values(uuid::console::Shell & shell);
|
||||
static void show_sensor_values(uuid::console::Shell & shell);
|
||||
static void dump_all_values(uuid::console::Shell & shell);
|
||||
|
||||
static void show_devices(uuid::console::Shell & shell);
|
||||
static void show_ems(uuid::console::Shell & shell);
|
||||
@@ -250,10 +253,10 @@ class EMSESP {
|
||||
static constexpr uint8_t EMS_WAIT_KM_TIMEOUT = 60; // wait one minute
|
||||
|
||||
struct Device_record {
|
||||
uint8_t product_id;
|
||||
EMSdevice::DeviceType device_type;
|
||||
const __FlashStringHelper * name;
|
||||
uint8_t flags;
|
||||
uint8_t product_id;
|
||||
EMSdevice::DeviceType device_type;
|
||||
const char * name;
|
||||
uint8_t flags;
|
||||
};
|
||||
static std::vector<Device_record> device_library_;
|
||||
|
||||
|
||||
@@ -55,12 +55,12 @@ class EMSFactory {
|
||||
}
|
||||
|
||||
// Construct derived class returning an unique ptr
|
||||
static auto add(const uint8_t device_type, uint8_t device_id, uint8_t product_id, const char * version, std::string & name, uint8_t flags, uint8_t brand)
|
||||
static auto add(const uint8_t device_type, uint8_t device_id, uint8_t product_id, const char * version, const char * name, uint8_t flags, uint8_t brand)
|
||||
-> std::unique_ptr<EMSdevice> {
|
||||
return std::unique_ptr<EMSdevice>(EMSFactory::makeRaw(device_type, device_id, product_id, version, name, flags, brand));
|
||||
}
|
||||
|
||||
virtual auto construct(uint8_t device_type, uint8_t device_id, uint8_t product_id, const char * version, std::string & name, uint8_t flags, uint8_t brand) const
|
||||
virtual auto construct(uint8_t device_type, uint8_t device_id, uint8_t product_id, const char * version, const char * name, uint8_t flags, uint8_t brand) const
|
||||
-> EMSdevice * = 0;
|
||||
|
||||
private:
|
||||
@@ -72,7 +72,7 @@ class EMSFactory {
|
||||
|
||||
// Construct derived class returning a raw pointer
|
||||
// find which EMS device it is and use that class
|
||||
static auto makeRaw(const uint8_t device_type, uint8_t device_id, uint8_t product_id, const char * version, std::string & name, uint8_t flags, uint8_t brand)
|
||||
static auto makeRaw(const uint8_t device_type, uint8_t device_id, uint8_t product_id, const char * version, const char * name, uint8_t flags, uint8_t brand)
|
||||
-> EMSdevice * {
|
||||
auto it = EMSFactory::getRegister().find(device_type);
|
||||
if (it != EMSFactory::getRegister().end()) {
|
||||
@@ -90,7 +90,7 @@ class ConcreteEMSFactory : EMSFactory {
|
||||
EMSFactory::registerFactory(device_type, this);
|
||||
}
|
||||
|
||||
auto construct(uint8_t device_type, uint8_t device_id, uint8_t product_id, const char * version, std::string & name, uint8_t flags, uint8_t brand) const
|
||||
auto construct(uint8_t device_type, uint8_t device_id, uint8_t product_id, const char * version, const char * name, uint8_t flags, uint8_t brand) const
|
||||
-> EMSdevice * {
|
||||
return new DerivedClass(device_type, device_id, product_id, version, name, flags, brand);
|
||||
}
|
||||
|
||||
203
src/helpers.cpp
203
src/helpers.cpp
@@ -177,10 +177,11 @@ char * Helpers::smallitoa(char * result, const uint16_t value) {
|
||||
// for strings only
|
||||
char * Helpers::render_boolean(char * result, const bool value, const bool dashboard) {
|
||||
uint8_t bool_format_ = dashboard ? EMSESP::system_.bool_dashboard() : EMSESP::system_.bool_format();
|
||||
|
||||
if (bool_format_ == BOOL_FORMAT_ONOFF_STR) {
|
||||
strlcpy(result, value ? read_flash_string(F_(on)).c_str() : read_flash_string(F_(off)).c_str(), 5);
|
||||
strlcpy(result, value ? translated_word(FL_(on)) : translated_word(FL_(off)), 12);
|
||||
} else if (bool_format_ == BOOL_FORMAT_ONOFF_STR_CAP) {
|
||||
strlcpy(result, value ? read_flash_string(F_(ON)).c_str() : read_flash_string(F_(OFF)).c_str(), 5);
|
||||
strlcpy(result, value ? translated_word(FL_(ON)) : translated_word(FL_(OFF)), 12);
|
||||
} else if ((bool_format_ == BOOL_FORMAT_10) || (bool_format_ == BOOL_FORMAT_10_STR)) {
|
||||
strlcpy(result, value ? "1" : "0", 2);
|
||||
} else {
|
||||
@@ -243,15 +244,16 @@ char * Helpers::render_value(char * result, uint8_t value, int8_t format, const
|
||||
|
||||
// float: convert float to char
|
||||
// format is the precision, 0 to 8
|
||||
char * Helpers::render_value(char * result, const float value, const int8_t format) {
|
||||
char * Helpers::render_value(char * result, const double value, const int8_t format) {
|
||||
if (format > 8) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
uint32_t p[] = {0, 10, 100, 1000, 10000, 100000, 1000000, 10000000, 100000000};
|
||||
uint32_t p[] = {1, 10, 100, 1000, 10000, 100000, 1000000, 10000000, 100000000};
|
||||
|
||||
char * ret = result;
|
||||
auto whole = (int32_t)value;
|
||||
double v = value < 0 ? value - 1.0 / (2 * p[format]) : value + 1.0 / (2 * p[format]);
|
||||
auto whole = (int32_t)v;
|
||||
|
||||
itoa(whole, result, 10);
|
||||
|
||||
@@ -259,8 +261,13 @@ char * Helpers::render_value(char * result, const float value, const int8_t form
|
||||
result++;
|
||||
}
|
||||
|
||||
*result++ = '.';
|
||||
int32_t decimal = abs((int32_t)((value - whole) * p[format]));
|
||||
*result++ = '.';
|
||||
auto decimal = abs((int32_t)((v - whole) * p[format]));
|
||||
for (int8_t i = 1; i < format; i++) {
|
||||
if (decimal < p[i]) {
|
||||
*result++ = '0'; // add leading zeros
|
||||
}
|
||||
}
|
||||
itoa(decimal, result, 10);
|
||||
|
||||
return ret;
|
||||
@@ -296,7 +303,7 @@ char * Helpers::render_value(char * result, const int32_t value, const int8_t fo
|
||||
} else if (format > 0) {
|
||||
strlcat(result, itoa(new_value / format, s, 10), sizeof(s));
|
||||
strlcat(result, ".", sizeof(s));
|
||||
strlcat(result, itoa(new_value % format, s, 10), sizeof(s));
|
||||
strlcat(result, itoa(((new_value % format) * 10) / format, s, 10), sizeof(s));
|
||||
} else {
|
||||
strlcat(result, itoa(new_value * format * -1, s, 10), sizeof(s));
|
||||
}
|
||||
@@ -336,9 +343,9 @@ char * Helpers::render_value(char * result, const uint32_t value, const int8_t f
|
||||
if (!hasValue(value)) {
|
||||
return nullptr;
|
||||
}
|
||||
result[0] = '\0';
|
||||
int32_t new_value = fahrenheit ? format ? value * 1.8 + 32 * format * (fahrenheit - 1) : value * 1.8 + 32 * (fahrenheit - 1) : value;
|
||||
char s[10] = {0};
|
||||
result[0] = '\0';
|
||||
uint32_t new_value = fahrenheit ? format ? value * 1.8 + 32 * format * (fahrenheit - 1) : value * 1.8 + 32 * (fahrenheit - 1) : value;
|
||||
char s[10] = {0};
|
||||
|
||||
#ifndef EMSESP_STANDALONE
|
||||
if (!format) {
|
||||
@@ -346,7 +353,7 @@ char * Helpers::render_value(char * result, const uint32_t value, const int8_t f
|
||||
} else if (format > 0) {
|
||||
strlcpy(result, ltoa(new_value / format, s, 10), sizeof(s));
|
||||
strlcat(result, ".", sizeof(s));
|
||||
strlcat(result, ltoa(new_value % format, s, 10), sizeof(s));
|
||||
strlcat(result, itoa(((new_value % format) * 10) / format, s, 10), sizeof(s));
|
||||
} else {
|
||||
strlcpy(result, ltoa(new_value * format * -1, s, 10), sizeof(s));
|
||||
}
|
||||
@@ -439,17 +446,41 @@ int Helpers::atoint(const char * value) {
|
||||
// The conversion to Fahrenheit is different for absolute temperatures and relative temperatures like hysteresis.
|
||||
// fahrenheit=0 - off, no conversion
|
||||
// fahrenheit=1 - relative, 1.8t
|
||||
// fahrenheit=2 - absolute, 1.8t + 32(fahrenheit-1).
|
||||
float Helpers::round2(float value, const int8_t divider, const uint8_t fahrenheit) {
|
||||
float val = (value * 100 + 0.5);
|
||||
if (divider > 0) {
|
||||
val = ((value / divider) * 100 + 0.5);
|
||||
} else if (divider < 0) {
|
||||
val = value * -100 * divider;
|
||||
// fahrenheit=2 - absolute, 1.8t + 32(fahrenheit-1)
|
||||
float Helpers::transformNumFloat(float value, const int8_t numeric_operator, const uint8_t fahrenheit) {
|
||||
float val;
|
||||
|
||||
switch (numeric_operator) {
|
||||
case DeviceValueNumOp::DV_NUMOP_DIV2:
|
||||
val = ((value / 2) * 100 + 0.5);
|
||||
break;
|
||||
case DeviceValueNumOp::DV_NUMOP_DIV10:
|
||||
val = ((value / 10) * 100 + 0.5);
|
||||
break;
|
||||
case DeviceValueNumOp::DV_NUMOP_DIV60:
|
||||
val = ((value / 60) * 100 + 0.5);
|
||||
break;
|
||||
case DeviceValueNumOp::DV_NUMOP_DIV100:
|
||||
val = ((value / 100) * 100 + 0.5);
|
||||
break;
|
||||
case DeviceValueNumOp::DV_NUMOP_MUL5:
|
||||
val = value * 100 * 5;
|
||||
break;
|
||||
case DeviceValueNumOp::DV_NUMOP_MUL10:
|
||||
val = value * 100 * 10;
|
||||
break;
|
||||
case DeviceValueNumOp::DV_NUMOP_MUL15:
|
||||
val = value * 100 * 15;
|
||||
break;
|
||||
default:
|
||||
val = (value * 100 + 0.5); // no ops
|
||||
break;
|
||||
}
|
||||
|
||||
if (value < 0) { // negative rounding
|
||||
val = val - 1;
|
||||
}
|
||||
|
||||
if (fahrenheit) {
|
||||
val = val * 1.8 + 3200 * (fahrenheit - 1);
|
||||
}
|
||||
@@ -492,7 +523,7 @@ bool Helpers::hasValue(const uint16_t & value) {
|
||||
}
|
||||
|
||||
bool Helpers::hasValue(const uint32_t & value) {
|
||||
return (value != EMS_VALUE_ULONG_NOTSET);
|
||||
return (value != EMS_VALUE_ULONG_NOTSET && value != EMS_VALUE_ULLONG_NOTSET);
|
||||
}
|
||||
|
||||
// checks if we can convert a char string to an int value
|
||||
@@ -566,14 +597,16 @@ bool Helpers::value2bool(const char * value, bool & value_b) {
|
||||
return false;
|
||||
}
|
||||
|
||||
std::string bool_str = toLower(value); // convert to lower case
|
||||
std::string bool_str = toLower(value);
|
||||
|
||||
if ((bool_str == read_flash_string(F_(on))) || (bool_str == "1") || (bool_str == "true")) {
|
||||
if ((bool_str == std::string(Helpers::translated_word(FL_(on)))) || (bool_str == toLower(Helpers::translated_word(FL_(ON)))) || (bool_str == "on")
|
||||
|| (bool_str == "1") || (bool_str == "true")) {
|
||||
value_b = true;
|
||||
return true; // is a bool
|
||||
}
|
||||
|
||||
if ((bool_str == read_flash_string(F_(off))) || (bool_str == "0") || (bool_str == "false")) {
|
||||
if ((bool_str == std::string(Helpers::translated_word(FL_(off)))) || (bool_str == toLower(Helpers::translated_word(FL_(OFF)))) || (bool_str == "off")
|
||||
|| (bool_str == "0") || (bool_str == "false")) {
|
||||
value_b = false;
|
||||
return true; // is a bool
|
||||
}
|
||||
@@ -582,20 +615,50 @@ bool Helpers::value2bool(const char * value, bool & value_b) {
|
||||
}
|
||||
|
||||
// checks to see if a string is member of a vector and return the index, also allow true/false for on/off
|
||||
bool Helpers::value2enum(const char * value, uint8_t & value_ui, const __FlashStringHelper * const * strs) {
|
||||
// this for a list of lists, when using translated strings
|
||||
bool Helpers::value2enum(const char * value, uint8_t & value_ui, const char * const ** strs) {
|
||||
if ((value == nullptr) || (strlen(value) == 0)) {
|
||||
return false;
|
||||
}
|
||||
std::string str = toLower(value);
|
||||
|
||||
for (value_ui = 0; strs[value_ui]; value_ui++) {
|
||||
std::string str1 = toLower(read_flash_string(strs[value_ui]));
|
||||
std::string str1 = toLower(std::string(Helpers::translated_word(strs[value_ui])));
|
||||
std::string str2 = toLower((strs[value_ui][0])); // also check for default language
|
||||
if ((str1 != "")
|
||||
&& ((str1 == read_flash_string(F_(off)) && str == "false") || (str1 == read_flash_string(F_(on)) && str == "true") || (str == str1)
|
||||
&& ((str2 == "off" && str == "false") || (str2 == "on" && str == "true") || (str == str1) || (str == str2)
|
||||
|| (value[0] == ('0' + value_ui) && value[1] == '\0'))) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// finds the string (value) of a list vector (strs)
|
||||
// returns true if found, and sets the value_ui to the index, else false
|
||||
// also allow true/false for on/off
|
||||
bool Helpers::value2enum(const char * value, uint8_t & value_ui, const char * const * strs) {
|
||||
if ((value == nullptr) || (strlen(value) == 0)) {
|
||||
return false;
|
||||
}
|
||||
std::string str = toLower(value);
|
||||
|
||||
std::string s_on = Helpers::translated_word(FL_(on));
|
||||
std::string s_off = Helpers::translated_word(FL_(off));
|
||||
|
||||
// stops when a nullptr is found, which is the end delimeter of a MAKE_PSTR_LIST()
|
||||
// could use count_items() to avoid buffer over-run but this works
|
||||
for (value_ui = 0; strs[value_ui]; value_ui++) {
|
||||
std::string enum_str = toLower((strs[value_ui]));
|
||||
|
||||
if ((enum_str != "")
|
||||
&& ((enum_str == "off" && (str == s_off || str == "false")) || (enum_str == "on" && (str == s_on || str == "true")) || (str == enum_str)
|
||||
|| (value[0] == ('0' + value_ui) && value[1] == '\0'))) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -606,18 +669,63 @@ std::string Helpers::toLower(std::string const & s) {
|
||||
return lc;
|
||||
}
|
||||
|
||||
std::string Helpers::toLower(const char * s) {
|
||||
return toLower(std::string(s));
|
||||
}
|
||||
|
||||
std::string Helpers::toUpper(std::string const & s) {
|
||||
std::string lc = s;
|
||||
std::transform(lc.begin(), lc.end(), lc.begin(), [](unsigned char c) { return std::toupper(c); });
|
||||
return lc;
|
||||
}
|
||||
|
||||
// capitalizes one UTF-8 character in char array
|
||||
// works with Latin1 (1 byte), Polish amd some other (2 bytes) characters
|
||||
// TODO add special characters that occur in other supported languages
|
||||
void Helpers::CharToUpperUTF8(char * c) {
|
||||
switch (*c) {
|
||||
case 0xC3:
|
||||
// grave, acute, circumflex, diaeresis, etc.
|
||||
if ((*(c + 1) >= 0xA0) && (*(c + 1) <= 0xBE)) {
|
||||
*(c + 1) -= 0x20;
|
||||
}
|
||||
break;
|
||||
case 0xC4:
|
||||
switch (*(c + 1)) {
|
||||
case 0x85: //ą (0xC4,0x85) -> Ą (0xC4,0x84)
|
||||
case 0x87: //ć (0xC4,0x87) -> Ć (0xC4,0x86)
|
||||
case 0x99: //ę (0xC4,0x99) -> Ę (0xC4,0x98)
|
||||
*(c + 1) -= 1;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 0xC5:
|
||||
switch (*(c + 1)) {
|
||||
case 0x82: //ł (0xC5,0x82) -> Ł (0xC5,0x81)
|
||||
case 0x84: //ń (0xC5,0x84) -> Ń (0xC5,0x83)
|
||||
case 0x9B: //ś (0xC5,0x9B) -> Ś (0xC5,0x9A)
|
||||
case 0xBA: //ź (0xC5,0xBA) -> Ź (0xC5,0xB9)
|
||||
case 0xBC: //ż (0xC5,0xBC) -> Ż (0xC5,0xBB)
|
||||
*(c + 1) -= 1;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
*c = toupper(*c); //works on Latin1 letters
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// replace char in char string
|
||||
void Helpers::replace_char(char * str, char find, char replace) {
|
||||
if (str == nullptr) {
|
||||
return;
|
||||
}
|
||||
|
||||
int i = 0;
|
||||
|
||||
while (str[i] != '\0') {
|
||||
/*Replace the matched character...*/
|
||||
// Replace the matched character...
|
||||
if (str[i] == find)
|
||||
str[i] = replace;
|
||||
|
||||
@@ -625,4 +733,45 @@ void Helpers::replace_char(char * str, char find, char replace) {
|
||||
}
|
||||
}
|
||||
|
||||
// count number of items in a list
|
||||
// the end of a list has a nullptr
|
||||
uint8_t Helpers::count_items(const char * const * list) {
|
||||
uint8_t list_size = 0;
|
||||
if (list != nullptr) {
|
||||
while (list[list_size]) {
|
||||
list_size++;
|
||||
}
|
||||
}
|
||||
return list_size;
|
||||
}
|
||||
|
||||
// count number of items in a list of lists
|
||||
// the end of a list has a nullptr
|
||||
uint8_t Helpers::count_items(const char * const ** list) {
|
||||
uint8_t list_size = 0;
|
||||
if (list != nullptr) {
|
||||
while (list[list_size]) {
|
||||
list_size++;
|
||||
}
|
||||
}
|
||||
return list_size;
|
||||
}
|
||||
|
||||
// returns char pointer to translated description or fullname
|
||||
// if force_en is true always take the EN non-translated word
|
||||
const char * Helpers::translated_word(const char * const * strings, const bool force_en) {
|
||||
uint8_t language_index = EMSESP::system_.language_index();
|
||||
uint8_t index = 0;
|
||||
|
||||
if (!strings) {
|
||||
return ""; // no translations
|
||||
}
|
||||
|
||||
// see how many translations we have for this entity. if there is no translation for this, revert to EN
|
||||
if (!force_en && (Helpers::count_items(strings) >= language_index + 1 && strlen(strings[language_index]))) {
|
||||
index = language_index;
|
||||
}
|
||||
return strings[index];
|
||||
}
|
||||
|
||||
} // namespace emsesp
|
||||
|
||||
@@ -21,16 +21,13 @@
|
||||
|
||||
#include "telegram.h" // for EMS_VALUE_* settings
|
||||
|
||||
#define FJSON(x) x
|
||||
// #define FJSON(x) F(x)
|
||||
#include "common.h"
|
||||
|
||||
namespace emsesp {
|
||||
|
||||
using flash_string_vector = std::vector<const __FlashStringHelper *>;
|
||||
|
||||
class Helpers {
|
||||
public:
|
||||
static char * render_value(char * result, const float value, const int8_t format); // format is the precision
|
||||
static char * render_value(char * result, const double value, const int8_t format); // format is the precision
|
||||
static char * render_value(char * result, const uint8_t value, const int8_t format, const uint8_t fahrenheit = 0);
|
||||
static char * render_value(char * result, const int8_t value, const int8_t format, const uint8_t fahrenheit = 0);
|
||||
static char * render_value(char * result, const uint16_t value, const int8_t format, const uint8_t fahrenheit = 0);
|
||||
@@ -52,10 +49,15 @@ class Helpers {
|
||||
static int atoint(const char * value);
|
||||
static bool check_abs(const int32_t i);
|
||||
static uint32_t abs(const int32_t i);
|
||||
static float round2(float value, const int8_t divider, const uint8_t fahrenheit = 0);
|
||||
|
||||
static float transformNumFloat(float value, const int8_t numeric_operator, const uint8_t fahrenheit = 0);
|
||||
|
||||
static std::string toLower(std::string const & s);
|
||||
static std::string toUpper(std::string const & s);
|
||||
static void replace_char(char * str, char find, char replace);
|
||||
static std::string toLower(const char * s);
|
||||
static void CharToUpperUTF8(char * c);
|
||||
|
||||
static void replace_char(char * str, char find, char replace);
|
||||
|
||||
static bool hasValue(const uint8_t & value, const uint8_t isBool = 0);
|
||||
static bool hasValue(const int8_t & value);
|
||||
@@ -68,10 +70,16 @@ class Helpers {
|
||||
static bool value2float(const char * value, float & value_f);
|
||||
static bool value2bool(const char * value, bool & value_b);
|
||||
static bool value2string(const char * value, std::string & value_s);
|
||||
static bool value2enum(const char * value, uint8_t & value_ui, const __FlashStringHelper * const * strs);
|
||||
static bool value2enum(const char * value, uint8_t & value_ui, const char * const ** strs);
|
||||
static bool value2enum(const char * value, uint8_t & value_ui, const char * const * strs);
|
||||
static bool value2temperature(const char * value, float & value_f, bool relative = false);
|
||||
static bool value2temperature(const char * value, int & value_i, const bool relative = false, const int min = -2147483648, const int max = 2147483647);
|
||||
|
||||
static uint8_t count_items(const char * const ** list);
|
||||
static uint8_t count_items(const char * const * list);
|
||||
|
||||
static const char * translated_word(const char * const * strings, const bool force_en = false);
|
||||
|
||||
#ifdef EMSESP_STANDALONE
|
||||
static char * ultostr(char * ptr, uint32_t value, const uint8_t base);
|
||||
#endif
|
||||
|
||||
858
src/locale_DE.h
858
src/locale_DE.h
@@ -1,858 +0,0 @@
|
||||
/*
|
||||
* EMS-ESP - https://github.com/emsesp/EMS-ESP
|
||||
* Copyright 2020 Paul Derbyshire
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
// common words
|
||||
MAKE_PSTR_WORD(debug)
|
||||
MAKE_PSTR_WORD(exit)
|
||||
MAKE_PSTR_WORD(help)
|
||||
MAKE_PSTR_WORD(log)
|
||||
MAKE_PSTR_WORD(logout)
|
||||
MAKE_PSTR_WORD(enabled)
|
||||
MAKE_PSTR_WORD(disabled)
|
||||
MAKE_PSTR_WORD(set)
|
||||
MAKE_PSTR_WORD(show)
|
||||
MAKE_PSTR_WORD(on)
|
||||
MAKE_PSTR_WORD(off)
|
||||
MAKE_PSTR_WORD(ON)
|
||||
MAKE_PSTR_WORD(OFF)
|
||||
MAKE_PSTR_WORD(su)
|
||||
MAKE_PSTR_WORD(name)
|
||||
MAKE_PSTR_WORD(auto)
|
||||
MAKE_PSTR_WORD(scan)
|
||||
MAKE_PSTR_WORD(password)
|
||||
MAKE_PSTR_WORD(read)
|
||||
MAKE_PSTR_WORD(version)
|
||||
MAKE_PSTR_WORD(values)
|
||||
MAKE_PSTR_WORD(system)
|
||||
MAKE_PSTR_WORD(fetch)
|
||||
MAKE_PSTR_WORD(restart)
|
||||
MAKE_PSTR_WORD(format)
|
||||
MAKE_PSTR_WORD(raw)
|
||||
MAKE_PSTR_WORD(watch)
|
||||
MAKE_PSTR_WORD(syslog)
|
||||
MAKE_PSTR_WORD(send)
|
||||
MAKE_PSTR_WORD(telegram)
|
||||
MAKE_PSTR_WORD(bus_id)
|
||||
MAKE_PSTR_WORD(tx_mode)
|
||||
MAKE_PSTR_WORD(ems)
|
||||
MAKE_PSTR_WORD(devices)
|
||||
MAKE_PSTR_WORD(shower)
|
||||
MAKE_PSTR_WORD(mqtt)
|
||||
MAKE_PSTR_WORD(emsesp)
|
||||
MAKE_PSTR_WORD(connected)
|
||||
MAKE_PSTR_WORD(disconnected)
|
||||
MAKE_PSTR_WORD(passwd)
|
||||
MAKE_PSTR_WORD(hostname)
|
||||
MAKE_PSTR_WORD(wifi)
|
||||
MAKE_PSTR_WORD(reconnect)
|
||||
MAKE_PSTR_WORD(ssid)
|
||||
MAKE_PSTR_WORD(heartbeat)
|
||||
MAKE_PSTR_WORD(users)
|
||||
MAKE_PSTR_WORD(publish)
|
||||
MAKE_PSTR_WORD(timeout)
|
||||
MAKE_PSTR_WORD(board_profile)
|
||||
MAKE_PSTR_WORD(setvalue)
|
||||
|
||||
// for commands
|
||||
MAKE_PSTR_WORD(call)
|
||||
MAKE_PSTR_WORD(cmd)
|
||||
MAKE_PSTR_WORD(id)
|
||||
MAKE_PSTR_WORD(hc)
|
||||
MAKE_PSTR_WORD(wwc)
|
||||
MAKE_PSTR_WORD(device)
|
||||
MAKE_PSTR_WORD(data)
|
||||
MAKE_PSTR_WORD(command)
|
||||
MAKE_PSTR_WORD(commands)
|
||||
MAKE_PSTR_WORD(info)
|
||||
MAKE_PSTR_WORD(settings)
|
||||
MAKE_PSTR_WORD(customizations)
|
||||
MAKE_PSTR_WORD(value)
|
||||
MAKE_PSTR_WORD(error)
|
||||
MAKE_PSTR_WORD(entities)
|
||||
|
||||
// devices
|
||||
MAKE_PSTR_WORD(boiler)
|
||||
MAKE_PSTR_WORD(thermostat)
|
||||
MAKE_PSTR_WORD(switch)
|
||||
MAKE_PSTR_WORD(solar)
|
||||
MAKE_PSTR_WORD(mixer)
|
||||
MAKE_PSTR_WORD(gateway)
|
||||
MAKE_PSTR_WORD(controller)
|
||||
MAKE_PSTR_WORD(connect)
|
||||
MAKE_PSTR_WORD(heatpump)
|
||||
MAKE_PSTR_WORD(generic)
|
||||
MAKE_PSTR_WORD(analogsensor)
|
||||
MAKE_PSTR_WORD(unknown)
|
||||
MAKE_PSTR_WORD(dallassensor)
|
||||
|
||||
// format strings
|
||||
MAKE_PSTR(host_fmt, "Host: %s")
|
||||
MAKE_PSTR(port_fmt, "Port: %d")
|
||||
MAKE_PSTR(hostname_fmt, "Hostname: %s")
|
||||
MAKE_PSTR(board_profile_fmt, "Board Profile: %s")
|
||||
MAKE_PSTR(mark_interval_fmt, "Mark interval: %lus")
|
||||
MAKE_PSTR(wifi_ssid_fmt, "WiFi SSID: %s")
|
||||
MAKE_PSTR(wifi_password_fmt, "WiFi Password: %S")
|
||||
MAKE_PSTR(tx_mode_fmt, "Tx mode: %d")
|
||||
MAKE_PSTR(bus_id_fmt, "Bus ID: %02X")
|
||||
MAKE_PSTR(log_level_fmt, "Log level: %s")
|
||||
|
||||
MAKE_STR(productid_fmt, "%s EMS ProductID")
|
||||
|
||||
MAKE_PSTR_LIST(enum_syslog_level, F_(off), F("emerg"), F("alert"), F("crit"), F_(error), F("warn"), F("notice"), F_(info), F_(debug), F("trace"), F("all"))
|
||||
MAKE_PSTR_LIST(enum_watch, F_(off), F_(on), F_(raw), F_(unknown))
|
||||
MAKE_PSTR_LIST(enum_sensortype, F("none"), F("digital in"), F("counter"), F("adc"), F("timer"), F("rate"), F("digital out"), F("pwm 0"), F("pwm 1"), F("pwm 2"))
|
||||
|
||||
// strings
|
||||
MAKE_PSTR(EMSESP, "EMS-ESP")
|
||||
MAKE_PSTR(cmd_optional, "[cmd]")
|
||||
MAKE_PSTR(ha_optional, "[ha]")
|
||||
MAKE_PSTR(deep_optional, "[deep]")
|
||||
MAKE_PSTR(watchid_optional, "[ID]")
|
||||
MAKE_PSTR(watch_format_optional, "[off | on | raw | unknown]")
|
||||
MAKE_PSTR(invalid_watch, "Invalid watch type")
|
||||
MAKE_PSTR(data_mandatory, "\"XX XX ...\"")
|
||||
MAKE_PSTR(asterisks, "********")
|
||||
MAKE_PSTR(n_mandatory, "<n>")
|
||||
MAKE_PSTR(sensorid_optional, "[sensor ID]")
|
||||
MAKE_PSTR(id_optional, "[id|hc]")
|
||||
MAKE_PSTR(data_optional, "[data]")
|
||||
MAKE_PSTR(offset_optional, "[offset]")
|
||||
MAKE_PSTR(length_optional, "[length]")
|
||||
MAKE_PSTR(typeid_mandatory, "<type ID>")
|
||||
MAKE_PSTR(deviceid_mandatory, "<device ID>")
|
||||
MAKE_PSTR(device_type_optional, "[device]")
|
||||
MAKE_PSTR(invalid_log_level, "Invalid log level")
|
||||
MAKE_PSTR(log_level_optional, "[level]")
|
||||
MAKE_PSTR(name_mandatory, "<name>")
|
||||
MAKE_PSTR(name_optional, "[name]")
|
||||
MAKE_PSTR(new_password_prompt1, "Enter new password: ")
|
||||
MAKE_PSTR(new_password_prompt2, "Retype new password: ")
|
||||
MAKE_PSTR(password_prompt, "Password: ")
|
||||
MAKE_PSTR(unset, "<unset>")
|
||||
|
||||
// command descriptions
|
||||
MAKE_PSTR(info_cmd, "lists all values")
|
||||
MAKE_PSTR(commands_cmd, "lists all commands")
|
||||
MAKE_PSTR(entities_cmd, "lists all entities")
|
||||
|
||||
MAKE_PSTR_WORD(number)
|
||||
MAKE_PSTR_WORD(enum)
|
||||
MAKE_PSTR_WORD(text)
|
||||
|
||||
MAKE_PSTR_WORD(2)
|
||||
MAKE_PSTR_WORD(4)
|
||||
MAKE_PSTR_WORD(10)
|
||||
MAKE_PSTR_WORD(100)
|
||||
MAKE_PSTR_WORD(60)
|
||||
|
||||
MAKE_PSTR_LIST(div2, F_(2))
|
||||
MAKE_PSTR_LIST(div4, F_(4))
|
||||
MAKE_PSTR_LIST(div10, F_(10))
|
||||
MAKE_PSTR_LIST(div60, F_(60))
|
||||
MAKE_PSTR_LIST(div100, F_(100))
|
||||
MAKE_PSTR_LIST(mul5, F("-5"))
|
||||
MAKE_PSTR_LIST(mul10, F("-10"))
|
||||
MAKE_PSTR_LIST(mul15, F("-15"))
|
||||
|
||||
// Unit Of Measurement mapping - maps to DeviceValueUOM_s in emsdevice.cpp
|
||||
// uom - also used with HA see https://github.com/home-assistant/core/blob/d7ac4bd65379e11461c7ce0893d3533d8d8b8cbf/homeassistant/const.py#L384
|
||||
MAKE_PSTR(blank, " ")
|
||||
MAKE_PSTR(percent, "%")
|
||||
MAKE_PSTR(degrees, "°C")
|
||||
MAKE_PSTR(kwh, "kWh")
|
||||
MAKE_PSTR(wh, "Wh")
|
||||
MAKE_PSTR(bar, "bar")
|
||||
MAKE_PSTR(minutes, "Minuten")
|
||||
MAKE_PSTR(hours, "Stunden")
|
||||
MAKE_PSTR(days, "Tage")
|
||||
MAKE_PSTR(ua, "uA")
|
||||
MAKE_PSTR(lmin, "l/min")
|
||||
MAKE_PSTR(kw, "kW")
|
||||
MAKE_PSTR(w, "W")
|
||||
MAKE_PSTR(kb, "KB")
|
||||
MAKE_PSTR(seconds, "seconds")
|
||||
MAKE_PSTR(dbm, "dBm")
|
||||
MAKE_PSTR(fahrenheit, "°F")
|
||||
MAKE_PSTR(mv, "mV")
|
||||
MAKE_PSTR(sqm, "sqm")
|
||||
MAKE_PSTR(m3, "m3")
|
||||
MAKE_PSTR(l, "l")
|
||||
// MAKE_PSTR(times, "mal")
|
||||
// MAKE_PSTR(oclock, "Uhr")
|
||||
|
||||
// TAG mapping - maps to DeviceValueTAG_s in emsdevice.cpp
|
||||
// use empty string if want to suppress showing tags
|
||||
// mqtt tags must not have spaces
|
||||
MAKE_PSTR(tag_none, "")
|
||||
MAKE_PSTR(tag_heartbeat, "")
|
||||
MAKE_PSTR(tag_boiler_data_ww, "ww")
|
||||
MAKE_PSTR(tag_device_data, "")
|
||||
MAKE_PSTR(tag_device_data_ww, "ww")
|
||||
MAKE_PSTR(tag_hc1, "hc1")
|
||||
MAKE_PSTR(tag_hc2, "hc2")
|
||||
MAKE_PSTR(tag_hc3, "hc3")
|
||||
MAKE_PSTR(tag_hc4, "hc4")
|
||||
MAKE_PSTR(tag_hc5, "hc5")
|
||||
MAKE_PSTR(tag_hc6, "hc6")
|
||||
MAKE_PSTR(tag_hc7, "hc7")
|
||||
MAKE_PSTR(tag_hc8, "hc8")
|
||||
MAKE_PSTR(tag_wwc1, "wwc1")
|
||||
MAKE_PSTR(tag_wwc2, "wwc2")
|
||||
MAKE_PSTR(tag_wwc3, "wwc3")
|
||||
MAKE_PSTR(tag_wwc4, "wwc4")
|
||||
MAKE_PSTR(tag_wwc5, "wwc5")
|
||||
MAKE_PSTR(tag_wwc6, "wwc6")
|
||||
MAKE_PSTR(tag_wwc7, "wwc7")
|
||||
MAKE_PSTR(tag_wwc8, "wwc8")
|
||||
MAKE_PSTR(tag_wwc9, "wwc9")
|
||||
MAKE_PSTR(tag_wwc10, "wwc10")
|
||||
MAKE_PSTR(tag_ahs, "ahs")
|
||||
MAKE_PSTR(tag_hs1, "hs1")
|
||||
MAKE_PSTR(tag_hs2, "hs2")
|
||||
MAKE_PSTR(tag_hs3, "hs3")
|
||||
MAKE_PSTR(tag_hs4, "hs4")
|
||||
MAKE_PSTR(tag_hs5, "hs5")
|
||||
MAKE_PSTR(tag_hs6, "hs6")
|
||||
MAKE_PSTR(tag_hs7, "hs7")
|
||||
MAKE_PSTR(tag_hs8, "hs8")
|
||||
MAKE_PSTR(tag_hs9, "hs9")
|
||||
MAKE_PSTR(tag_hs10, "hs10")
|
||||
MAKE_PSTR(tag_hs11, "hs11")
|
||||
MAKE_PSTR(tag_hs12, "hs12")
|
||||
MAKE_PSTR(tag_hs13, "hs13")
|
||||
MAKE_PSTR(tag_hs14, "hs14")
|
||||
MAKE_PSTR(tag_hs15, "hs15")
|
||||
MAKE_PSTR(tag_hs16, "hs16")
|
||||
|
||||
// MQTT topic names
|
||||
// MAKE_PSTR(tag_heartbeat_mqtt, "heartbeat")
|
||||
// MAKE_PSTR(tag_boiler_data_mqtt, "")
|
||||
MAKE_PSTR(tag_boiler_data_ww_mqtt, "ww")
|
||||
MAKE_PSTR(tag_device_data_ww_mqtt, "")
|
||||
|
||||
// boiler
|
||||
MAKE_PSTR(time, "Zeit")
|
||||
MAKE_PSTR(date, "Datum")
|
||||
MAKE_PSTR_WORD(1x3min)
|
||||
MAKE_PSTR_WORD(2x3min)
|
||||
MAKE_PSTR_WORD(3x3min)
|
||||
MAKE_PSTR_WORD(4x3min)
|
||||
MAKE_PSTR_WORD(5x3min)
|
||||
MAKE_PSTR_WORD(6x3min)
|
||||
MAKE_PSTR_(continuos, "kontinuierlich")
|
||||
MAKE_PSTR(3wayvalve, "3-Wege Ventil")
|
||||
MAKE_PSTR(chargepump, "Ladepumpe")
|
||||
MAKE_PSTR(hot, "Heiss")
|
||||
MAKE_PSTR(high_comfort, "Heiss Komfort")
|
||||
MAKE_PSTR(eco, "Eco")
|
||||
MAKE_PSTR(intelligent, "Intelligent")
|
||||
MAKE_PSTR_(flow, "Fluss")
|
||||
MAKE_PSTR(manual, "Manuell")
|
||||
MAKE_PSTR_(buffer, "Speicher")
|
||||
MAKE_PSTR(bufferedflow, "Durchlaufspeicher")
|
||||
MAKE_PSTR(layeredbuffer, "Schichtspeicher")
|
||||
MAKE_PSTR(maintenance, "Wartung")
|
||||
MAKE_PSTR(heating, "Heizen")
|
||||
MAKE_PSTR(cooling, "K<EFBFBD>hlen")
|
||||
|
||||
// boiler lists
|
||||
MAKE_PSTR_LIST(tpl_date, F("Format: < dd.mm.yyyy >")) // template for text input
|
||||
MAKE_PSTR_LIST(enum_off_time_date_manual, F_(off), F_(time), F_(date), F_(manual))
|
||||
MAKE_PSTR_LIST(enum_freq, F_(off), F_(1x3min), F_(2x3min), F_(3x3min), F_(4x3min), F_(5x3min), F_(6x3min), F_(continuous))
|
||||
MAKE_PSTR_LIST(enum_charge, F_(chargepump), F_(3wayvalve))
|
||||
MAKE_PSTR_LIST(enum_comfort, F_(hot), F_(eco), F_(intelligent))
|
||||
MAKE_PSTR_LIST(enum_comfort1, F_(high_comfort), F_(eco))
|
||||
MAKE_PSTR_LIST(enum_flow, F_(off), F_(flow), F_(bufferedflow), F_(buffer), F_(layeredbuffer))
|
||||
MAKE_PSTR_LIST(enum_reset, F("-"), F_(maintenance), F_(error))
|
||||
// MAKE_PSTR_LIST(enum_bool, F_(off), F_(on))
|
||||
|
||||
// AM200 lists
|
||||
MAKE_PSTR_LIST(enum_vr2Config, F_(off), F("bypass"));
|
||||
MAKE_PSTR_LIST(enum_aPumpSignal, F_(off), F("pwm"), F("pwm_invers"));
|
||||
MAKE_PSTR_LIST(enum_bufBypass, F("no"), F_(mixer), F("valve"));
|
||||
MAKE_PSTR_LIST(enum_bufConfig, F("monovalent"), F("bivalent"));
|
||||
MAKE_PSTR_LIST(enum_blockMode, F_(off), F_(auto), F("blocking"));
|
||||
MAKE_PSTR_LIST(enum_blockTerm, F("n_o"), F("n_c"));
|
||||
|
||||
//heatpump
|
||||
MAKE_PSTR_LIST(enum_hpactivity, F("Kein"), F("Heizen"), F("Kühlen"), F("Warmwasser"), F("Pool"))
|
||||
|
||||
// mixer
|
||||
MAKE_PSTR_LIST(enum_shunt, F("gestoppt"), F("öffnen"), F("schließen"), F("Offen"), F("Geschlossen"))
|
||||
|
||||
// thermostat
|
||||
MAKE_PSTR(light, "Leicht")
|
||||
MAKE_PSTR(medium, "Mittel")
|
||||
MAKE_PSTR(heavy, "Schwer")
|
||||
MAKE_PSTR(own_prog, "Eigenprog")
|
||||
MAKE_PSTR(start, "Start")
|
||||
MAKE_PSTR(heat, "Heizen")
|
||||
MAKE_PSTR(hold, "Halten")
|
||||
MAKE_PSTR(cool, "Kühl")
|
||||
MAKE_PSTR(end, "Ende")
|
||||
MAKE_PSTR(german, "Deutsch")
|
||||
MAKE_PSTR(dutch, "Niederländisch")
|
||||
MAKE_PSTR(french, "Französisch")
|
||||
MAKE_PSTR(italian, "Italienisch")
|
||||
MAKE_PSTR(high, "hoch")
|
||||
MAKE_PSTR(low, "niedrig")
|
||||
MAKE_PSTR(radiator, "Heizkörper")
|
||||
MAKE_PSTR(convector, "Konvektor")
|
||||
MAKE_PSTR(floor, "Fussboden")
|
||||
MAKE_PSTR(summer, "Sommer")
|
||||
MAKE_PSTR(winter, "Winter")
|
||||
MAKE_PSTR(outdoor, "Aussentemperatur")
|
||||
MAKE_PSTR_WORD(mpc)
|
||||
MAKE_PSTR(room, "Raum")
|
||||
MAKE_PSTR(room_outdoor, "Raum+Au<41>en")
|
||||
MAKE_PSTR(power, "Leistung")
|
||||
MAKE_PSTR(constant, "konstant")
|
||||
MAKE_PSTR(simple, "einfach")
|
||||
MAKE_PSTR(optimized, "optimiert")
|
||||
MAKE_PSTR(nofrost, "Frostschutz")
|
||||
MAKE_PSTR(comfort, "Komfort")
|
||||
MAKE_PSTR(night, "Nacht")
|
||||
MAKE_PSTR(day, "Tag")
|
||||
MAKE_PSTR(holiday, "Urlaub")
|
||||
MAKE_PSTR(reduce, "reduziert")
|
||||
MAKE_PSTR(noreduce, "unreduziert")
|
||||
MAKE_PSTR(offset, "Anhebung")
|
||||
MAKE_PSTR(design, "Auslegung")
|
||||
MAKE_PSTR_WORD(tempauto)
|
||||
MAKE_PSTR(minflow, "minfluss")
|
||||
MAKE_PSTR(maxflow, "maxfluss")
|
||||
MAKE_PSTR_WORD(rc3x)
|
||||
MAKE_PSTR_WORD(rc20)
|
||||
|
||||
MAKE_PSTR(internal_temperature, "interne Temperatur")
|
||||
MAKE_PSTR(internal_setpoint, "interner Sollwert")
|
||||
MAKE_PSTR(external_temperature, "externe Temperatur")
|
||||
MAKE_PSTR(burner_temperature, "Kesseltemperatur")
|
||||
MAKE_PSTR(ww_temperature, "Wassertemperatur")
|
||||
MAKE_PSTR(functioning_mode, "functioning mode")
|
||||
MAKE_PSTR(smoke_temperature, "Abgastemperatur")
|
||||
|
||||
// thermostat lists
|
||||
MAKE_PSTR_LIST(tpl_datetime, F("Format: < NTP | dd.mm.yyyy-hh:mm:ss-dw-dst >"))
|
||||
MAKE_PSTR_LIST(tpl_switchtime, F("Format: < nn.d.o.hh:mm >"))
|
||||
MAKE_PSTR_LIST(tpl_switchtime1, F("Format: <nn> [ not_set | day hh:mm Tn ]"))
|
||||
MAKE_PSTR_LIST(tpl_holidays, F("Format: < dd.mm.yyyy-dd.mm.yyyy >"))
|
||||
MAKE_PSTR_LIST(enum_ibaMainDisplay,
|
||||
F_(internal_temperature),
|
||||
F_(internal_setpoint),
|
||||
F_(external_temperature),
|
||||
F_(burner_temperature),
|
||||
F_(ww_temperature),
|
||||
F_(functioning_mode),
|
||||
F_(time),
|
||||
F_(date),
|
||||
F_(smoke_temperature))
|
||||
MAKE_PSTR_LIST(enum_ibaLanguage, F_(german), F_(dutch), F_(french), F_(italian))
|
||||
MAKE_PSTR_LIST(enum_ibaLanguage_RC30, F_(german), F_(dutch))
|
||||
MAKE_PSTR_LIST(enum_floordrystatus, F_(off), F_(start), F_(heat), F_(hold), F_(cool), F_(end))
|
||||
MAKE_PSTR_LIST(enum_ibaBuildingType, F_(light), F_(medium), F_(heavy)) // RC300
|
||||
MAKE_PSTR_LIST(enum_PID, F("fast"), F_(medium), F("slow"))
|
||||
MAKE_PSTR_LIST(enum_wwMode, F_(off), F("normal"), F_(comfort), F_(auto), F_(own_prog), F_(eco))
|
||||
MAKE_PSTR_LIST(enum_wwCircMode, F_(off), F_(on), F_(auto), F_(own_prog))
|
||||
MAKE_PSTR_LIST(enum_wwMode2, F_(off), F_(on), F_(auto))
|
||||
MAKE_PSTR_LIST(enum_wwMode3, F_(on), F_(off), F_(auto))
|
||||
MAKE_PSTR_LIST(enum_heatingtype, F_(off), F_(radiator), F_(convector), F_(floor))
|
||||
MAKE_PSTR_LIST(enum_summermode, F_(summer), F_(auto), F_(winter))
|
||||
MAKE_PSTR_LIST(enum_hpoperatingmode, F_(off), F_(auto), F("heizen"), F("kühlen"))
|
||||
MAKE_PSTR_LIST(enum_summer, F_(winter), F_(summer))
|
||||
MAKE_PSTR_LIST(enum_operatingstate, F_(heating), F_(off), F_(cooling))
|
||||
|
||||
MAKE_PSTR_LIST(enum_mode, F_(manual), F_(auto)) // RC100, RC300, RC310
|
||||
MAKE_PSTR_LIST(enum_mode2, F_(off), F_(manual), F_(auto)) // RC20
|
||||
MAKE_PSTR_LIST(enum_mode3, F_(night), F_(day), F_(auto)) // RC35, RC30, RC25
|
||||
MAKE_PSTR_LIST(enum_mode4, F_(nofrost), F_(eco), F_(heat), F_(auto)) // JUNKERS
|
||||
MAKE_PSTR_LIST(enum_mode5, F_(auto), F_(off)) // CRF
|
||||
MAKE_PSTR_LIST(enum_mode6, F_(nofrost), F_(night), F_(day)) // RC10
|
||||
|
||||
MAKE_PSTR_LIST(enum_modetype, F_(eco), F_(comfort))
|
||||
// MAKE_PSTR_LIST(enum_modetype2, F_(day))
|
||||
MAKE_PSTR_LIST(enum_modetype3, F_(night), F_(day))
|
||||
MAKE_PSTR_LIST(enum_modetype4, F_(nofrost), F_(eco), F_(heat))
|
||||
MAKE_PSTR_LIST(enum_modetype5, F_(off), F_(on))
|
||||
|
||||
MAKE_PSTR_LIST(enum_reducemode, F_(nofrost), F_(reduce), F_(room), F_(outdoor))
|
||||
MAKE_PSTR_LIST(enum_reducemode1, F_(outdoor), F_(room), F_(reduce)) // RC310 values: 1-3
|
||||
MAKE_PSTR_LIST(enum_nofrostmode, F_(off), F_(room), F_(outdoor))
|
||||
MAKE_PSTR_LIST(enum_nofrostmode1, F_(room), F_(outdoor), F_(room_outdoor))
|
||||
|
||||
MAKE_PSTR_LIST(enum_controlmode, F_(off), F_(optimized), F_(simple), F_(mpc), F_(room), F_(power), F_(constant))
|
||||
MAKE_PSTR_LIST(enum_controlmode1, F("weather-compensated"), F("outside-basepoint"), F("n/a"), F_(room)) // RC310 1-4
|
||||
MAKE_PSTR_LIST(enum_controlmode2, F_(outdoor), F_(room))
|
||||
// MAKE_PSTR_LIST(enum_controlmode3, F_(off), F_(room), F_(outdoor), F("room+outdoor"))
|
||||
MAKE_PSTR_LIST(enum_control, F_(off), F_(rc20), F_(rc3x))
|
||||
MAKE_PSTR_LIST(enum_j_control, F_(off), F("fb10"), F("fb110"))
|
||||
|
||||
MAKE_PSTR_LIST(enum_wwProgMode, F("std Prog"), F_(own_prog))
|
||||
MAKE_PSTR_LIST(enum_dayOfWeek, F("Mo"), F("Di"), F("Mi"), F("Do"), F("Fr"), F("Sa"), F("So"), F("Alle"))
|
||||
MAKE_PSTR_LIST(enum_progMode, F("Prog_1"), F("Prog_2"))
|
||||
MAKE_PSTR_LIST(enum_progMode2,
|
||||
F("Eigen_1"),
|
||||
F("Familie"),
|
||||
F("Morgends"),
|
||||
F("Abends"),
|
||||
F("Vormittag"),
|
||||
F("Nachmittag"),
|
||||
F("Mittag"),
|
||||
F("Singles"),
|
||||
F("Senioren"),
|
||||
F("Neu"),
|
||||
F("Eigen_2"))
|
||||
MAKE_PSTR_LIST(enum_progMode3, F("Familie"), F("Morgends"), F("Abends"), F("Vormittag"), F("Nachmittag"), F("Mittag"), F("Singles"), F("Senioren"))
|
||||
MAKE_PSTR_LIST(enum_progMode4, F("prog_a"), F("prog_b"), F("prog_c"), F("prog_d"), F("prog_e"), F("prog_f"))
|
||||
|
||||
MAKE_PSTR_LIST(enum_switchmode, F_(off), F_(eco), F_(comfort), F_(heat))
|
||||
MAKE_PSTR_LIST(enum_climate, F("Solltemperature"), F("Raumtemperatur"))
|
||||
|
||||
// solar list
|
||||
MAKE_PSTR_LIST(enum_solarmode, F_(constant), F("pwm"), F("analog"))
|
||||
MAKE_PSTR_LIST(enum_collectortype, F("flach"), F("vakuum"))
|
||||
MAKE_PSTR_LIST(enum_cylprio, F("Zyl_1"), F("Zyl_2"))
|
||||
|
||||
// id used to store the device ID, goes into MQTT payload
|
||||
MAKE_PSTR_LIST(ID, F_(id))
|
||||
|
||||
// Boiler
|
||||
// extra commands
|
||||
MAKE_PSTR_LIST(wwtapactivated, F("wwtapactivated"), F("Aktiviere Warmwasser im Wartungsmodus"))
|
||||
MAKE_PSTR_LIST(reset, F("reset"), F("Reset"))
|
||||
|
||||
// single mqtt topics
|
||||
MAKE_PSTR_WORD(heating_active)
|
||||
MAKE_PSTR_WORD(tapwater_active)
|
||||
MAKE_PSTR_WORD(response)
|
||||
|
||||
// mqtt, commands and text
|
||||
MAKE_PSTR_LIST(heatingActive, F("heatingactive"), F("Heizung aktiv"))
|
||||
MAKE_PSTR_LIST(tapwaterActive, F("tapwateractive"), F("Warmwasser aktiv"))
|
||||
MAKE_PSTR_LIST(selFlowTemp, F("selflowtemp"), F("Sollwert Flusstemperatur"))
|
||||
MAKE_PSTR_LIST(selBurnPow, F("selburnpow"), F("Sollwert Brennerleistung"))
|
||||
MAKE_PSTR_LIST(heatingPumpMod, F("heatingpumpmod"), F("Heizungspumpe 1 Modulation"))
|
||||
MAKE_PSTR_LIST(heatingPump2Mod, F("heatingpump2mod"), F("Heizungspumpe 2 Modulation"))
|
||||
MAKE_PSTR_LIST(outdoorTemp, F("outdoortemp"), F("Aussentemperatur"))
|
||||
MAKE_PSTR_LIST(curFlowTemp, F("curflowtemp"), F("aktuelle Flusstemperatur"))
|
||||
MAKE_PSTR_LIST(retTemp, F("rettemp"), F("Rücklauftemperatur"))
|
||||
MAKE_PSTR_LIST(switchTemp, F("switchtemp"), F("Mischer Schalttemperatur"))
|
||||
MAKE_PSTR_LIST(sysPress, F("syspress"), F("Systemdruck"))
|
||||
MAKE_PSTR_LIST(boilTemp, F("boiltemp"), F("Kesseltemperatur"))
|
||||
MAKE_PSTR_LIST(exhaustTemp, F("exhausttemp"), F("Auslasstemperatur"))
|
||||
MAKE_PSTR_LIST(burnGas, F("burngas"), F("Gas"))
|
||||
MAKE_PSTR_LIST(burnGas2, F("burngas2"), F("Gas Stufe 2"))
|
||||
MAKE_PSTR_LIST(flameCurr, F("flamecurr"), F("Flammstrom"))
|
||||
MAKE_PSTR_LIST(heatingPump, F("heatingpump"), F("Heizungspumpe"))
|
||||
MAKE_PSTR_LIST(fanWork, F("fanwork"), F("Gebläse"))
|
||||
MAKE_PSTR_LIST(ignWork, F("ignwork"), F("Zündung"))
|
||||
MAKE_PSTR_LIST(oilPreHeat, F("oilpreheat"), F("oil preheating"))
|
||||
MAKE_PSTR_LIST(heatingActivated, F("heatingactivated"), F("Heizen aktiviert"))
|
||||
MAKE_PSTR_LIST(heatingTemp, F("heatingtemp"), F("Kesseltemperatur"))
|
||||
MAKE_PSTR_LIST(pumpModMax, F("pumpmodmax"), F("Kesselpumpen Maximalleistung"))
|
||||
MAKE_PSTR_LIST(pumpModMin, F("pumpmodmin"), F("Kesselpumpen Minmalleistung"))
|
||||
MAKE_PSTR_LIST(pumpDelay, F("pumpdelay"), F("Pumpennachlauf"))
|
||||
MAKE_PSTR_LIST(burnMinPeriod, F("burnminperiod"), F("Antipendelzeit"))
|
||||
MAKE_PSTR_LIST(burnMinPower, F("burnminpower"), F("minimale Brennerleistung"))
|
||||
MAKE_PSTR_LIST(burnMaxPower, F("burnmaxpower"), F("maximale Brennerleistung"))
|
||||
MAKE_PSTR_LIST(boilHystOn, F("boilhyston"), F("Hysterese ein temperatur"))
|
||||
MAKE_PSTR_LIST(boilHystOff, F("boilhystoff"), F("Hysterese aus temperatur"))
|
||||
MAKE_PSTR_LIST(setFlowTemp, F("setflowtemp"), F("Sollwert Flusstemperatur"))
|
||||
MAKE_PSTR_LIST(setBurnPow, F("setburnpow"), F("Sollwert Brennerleistung"))
|
||||
MAKE_PSTR_LIST(curBurnPow, F("curburnpow"), F("Brennerleistung"))
|
||||
MAKE_PSTR_LIST(burnStarts, F("burnstarts"), F("Brenner # starts"))
|
||||
MAKE_PSTR_LIST(burnWorkMin, F("burnworkmin"), F("Brenner Laufzeit"))
|
||||
MAKE_PSTR_LIST(burn2WorkMin, F("burn2workmin"), F("Brenner Stufe 2 Laufzeit"))
|
||||
MAKE_PSTR_LIST(heatWorkMin, F("heatworkmin"), F("Heizung Laufzeit"))
|
||||
MAKE_PSTR_LIST(UBAuptime, F("ubauptime"), F("gesamte Laufzeit"))
|
||||
MAKE_PSTR_LIST(lastCode, F("lastcode"), F("Fehlerspeicher"))
|
||||
MAKE_PSTR_LIST(serviceCode, F("servicecode"), F("Statusmeldung"))
|
||||
MAKE_PSTR_LIST(serviceCodeNumber, F("servicecodenumber"), F("Statusmeldungsnummer"))
|
||||
MAKE_PSTR_LIST(maintenanceMessage, F("maintenancemessage"), F("Wartungsmeldung"))
|
||||
MAKE_PSTR_LIST(maintenanceDate, F("maintenancedate"), F("Wartungsdatum"))
|
||||
MAKE_PSTR_LIST(maintenanceType, F_(maintenance), F("Wartungsplan"))
|
||||
MAKE_PSTR_LIST(maintenanceTime, F("maintenancetime"), F("Wartung in"))
|
||||
MAKE_PSTR_LIST(emergencyOps, F("emergencyops"), F("emergency operation"))
|
||||
MAKE_PSTR_LIST(emergencyTemp, F("emergencytemp"), F("emergency temperature"))
|
||||
|
||||
// heatpump/compress specific
|
||||
MAKE_PSTR_LIST(upTimeControl, F("uptimecontrol"), F("Betriebszeit total heizen"))
|
||||
MAKE_PSTR_LIST(upTimeCompHeating, F("uptimecompheating"), F("Betriebszeit Kompressor heizen"))
|
||||
MAKE_PSTR_LIST(upTimeCompCooling, F("uptimecompcooling"), F("Betriebszeit Kompressor kühlen"))
|
||||
MAKE_PSTR_LIST(upTimeCompWw, F("uptimecompww"), F("Betriebszeit Kompressor"))
|
||||
MAKE_PSTR_LIST(upTimeCompPool, F("uptimecomppool"), F("Betriebszeit Kompressor Pool"))
|
||||
MAKE_PSTR_LIST(totalCompStarts, F("totalcompstarts"), F("gesamt Kompressor Starts"))
|
||||
MAKE_PSTR_LIST(heatingStarts, F("heatingstarts"), F("Heizen Starts"))
|
||||
MAKE_PSTR_LIST(coolingStarts, F("coolingstarts"), F("Kühlen Starts"))
|
||||
MAKE_PSTR_LIST(poolStarts, F("poolstarts"), F("Pool Starts"))
|
||||
MAKE_PSTR_LIST(nrgConsTotal, F("nrgconstotal"), F("totaler Energieverbrauch"))
|
||||
MAKE_PSTR_LIST(nrgConsCompTotal, F("nrgconscomptotal"), F("Energieverbrauch Kompressor total"))
|
||||
MAKE_PSTR_LIST(nrgConsCompHeating, F("nrgconscompheating"), F("Energieverbrauch Kompressor heizen"))
|
||||
MAKE_PSTR_LIST(nrgConsCompWw, F("nrgconscompww"), F("Energieverbrauch Kompressor"))
|
||||
MAKE_PSTR_LIST(nrgConsCompCooling, F("nrgconscompcooling"), F("Energieverbrauch Kompressor kühlen"))
|
||||
MAKE_PSTR_LIST(nrgConsCompPool, F("nrgconscomppool"), F("Energieverbrauch Kompressor Pool"))
|
||||
MAKE_PSTR_LIST(nrgSuppTotal, F("nrgsupptotal"), F("gesamte Energieabgabe"))
|
||||
MAKE_PSTR_LIST(nrgSuppHeating, F("nrgsuppheating"), F("gesamte Energieabgabe heizen"))
|
||||
MAKE_PSTR_LIST(nrgSuppWw, F("nrgsuppww"), F("gesamte Energieabgabe"))
|
||||
MAKE_PSTR_LIST(nrgSuppCooling, F("nrgsuppcooling"), F("gesamte Energieabgabe kühlen"))
|
||||
MAKE_PSTR_LIST(nrgSuppPool, F("nrgsupppool"), F("gesamte Energieabgabe Pool"))
|
||||
MAKE_PSTR_LIST(auxElecHeatNrgConsTotal, F("auxelecheatnrgconstotal"), F("Energieverbrauch el. Zusatzheizung"))
|
||||
MAKE_PSTR_LIST(auxElecHeatNrgConsHeating, F("auxelecheatnrgconsheating"), F("Energieverbrauch el. Zusatzheizung Heizen"))
|
||||
MAKE_PSTR_LIST(auxElecHeatNrgConsWW, F("auxelecheatnrgconsww"), F("Energieverbrauch el. Zusatzheizung"))
|
||||
MAKE_PSTR_LIST(auxElecHeatNrgConsPool, F("auxelecheatnrgconspool"), F("Energieverbrauch el. Zusatzheizung Pool"))
|
||||
|
||||
MAKE_PSTR_LIST(hpPower, F("hppower"), F("Leistung Wärmepumpe"))
|
||||
MAKE_PSTR_LIST(hpCompOn, F("hpcompon"), F("HP Compressor"))
|
||||
MAKE_PSTR_LIST(hpHeatingOn, F("hpheatingon"), F("HP Heating"))
|
||||
MAKE_PSTR_LIST(hpCoolingOn, F("hpcoolingon"), F("HP Cooling"))
|
||||
MAKE_PSTR_LIST(hpWwOn, F("hpwwon"), F("HP dhw"))
|
||||
MAKE_PSTR_LIST(hpPoolOn, F("hppoolon"), F("HP Pool"))
|
||||
MAKE_PSTR_LIST(hpBrinePumpSpd, F("hpbrinepumpspd"), F("Brine Pump Speed"))
|
||||
MAKE_PSTR_LIST(hpCompSpd, F("hpcompspd"), F("Compressor Speed"))
|
||||
MAKE_PSTR_LIST(hpCircSpd, F("hpcircspd"), F("Circulation pump Speed"))
|
||||
MAKE_PSTR_LIST(hpBrineIn, F("hpbrinein"), F("Brine in/Evaporator"))
|
||||
MAKE_PSTR_LIST(hpBrineOut, F("hpbrineout"), F("Brine out/Condenser"))
|
||||
MAKE_PSTR_LIST(hpSuctionGas, F("hpsuctiongas"), F("Suction gas"))
|
||||
MAKE_PSTR_LIST(hpHotGas, F("hphotgas"), F("Hot gas/Compressed"))
|
||||
MAKE_PSTR_LIST(hpSwitchValve, F("hpswitchvalve"), F("Switch Valve"))
|
||||
MAKE_PSTR_LIST(hpActivity, F("hpactivity"), F("Compressor Activity"))
|
||||
MAKE_PSTR_LIST(hpTc0, F("hptc0"), F("Wärmeträgerflüssigkeit Eingang (TC0)"))
|
||||
MAKE_PSTR_LIST(hpTc1, F("hptc1"), F("Wärmeträgerflüssigkeit Ausgang (TC1)"))
|
||||
MAKE_PSTR_LIST(hpTc3, F("hptc3"), F("Verflüssigertemperatur (TC3)"))
|
||||
MAKE_PSTR_LIST(hpTr3, F("hptr3"), F(" Temperaturfühler Kältemittel (Flüssigkeit) (TR3)"))
|
||||
MAKE_PSTR_LIST(hpTr4, F("hptr4"), F("Verdampfer Eintritt (TR4)"))
|
||||
MAKE_PSTR_LIST(hpTr5, F("hptr5"), F("Temperaturfühler Kompessoransaugleitung (TR5)"))
|
||||
MAKE_PSTR_LIST(hpTr6, F("hptr6"), F("Temperaturfühler Kompressorausgangsleitung (TR6)"))
|
||||
MAKE_PSTR_LIST(hpTr7, F("hptr7"), F("Temperaturfühler Kältemittel (Gas) (TR7)"))
|
||||
MAKE_PSTR_LIST(hpTl2, F("hptl2"), F("Außenlufttemperaturfühler (TL2)"))
|
||||
MAKE_PSTR_LIST(hpPl1, F("hppl1"), F("Niedrigdruckfühler (PL1)"))
|
||||
MAKE_PSTR_LIST(hpPh1, F("hpph1"), F("Hochdruckfühler (PH1)"))
|
||||
|
||||
// hybrid heatpump
|
||||
MAKE_PSTR_LIST(enum_hybridStrategy, F("co2-optimized"), F("cost-optimized"), F("outside-temp-switched"), F("co2-cost-mix"))
|
||||
MAKE_PSTR_LIST(hybridStrategy, F("hybridstrategy"), F("hybrid control strategy"))
|
||||
MAKE_PSTR_LIST(switchOverTemp, F("switchovertemp"), F("outside switchover temperature"))
|
||||
MAKE_PSTR_LIST(energyCostRatio, F("energycostratio"), F("energy cost ratio"))
|
||||
MAKE_PSTR_LIST(fossileFactor, F("fossilefactor"), F("fossile energy factor"))
|
||||
MAKE_PSTR_LIST(electricFactor, F("electricfactor"), F("electric energy factor"))
|
||||
MAKE_PSTR_LIST(delayBoiler, F("delayboiler"), F("delay boiler support"))
|
||||
MAKE_PSTR_LIST(tempDiffBoiler, F("tempdiffboiler"), F("tempediff boiler support"))
|
||||
|
||||
// alternative heatsource AM200
|
||||
MAKE_PSTR_LIST(aCylTopTemp, F("cyltoptemp"), F("Zylinder oben Temperatur"))
|
||||
MAKE_PSTR_LIST(aCylCenterTemp, F("cylcentertemp"), F("Zylinder mitte Temperatur"))
|
||||
MAKE_PSTR_LIST(aCylBottomTemp, F("cylbottomtemp"), F("Zylinder unten Temperatur"))
|
||||
MAKE_PSTR_LIST(aFlowTemp, F("altflowtemp"), F("Alternativ hs Flusstemperatur"))
|
||||
MAKE_PSTR_LIST(aRetTemp, F("altrettemp"), F("Alternativ hs Rücktemperatur"))
|
||||
MAKE_PSTR_LIST(sysFlowTemp, F("sysflowtemp"), F("System Flusstemperature"))
|
||||
MAKE_PSTR_LIST(sysRetTemp, F("sysrettemp"), F("System Rücktemperature"))
|
||||
MAKE_PSTR_LIST(valveByPass, F("valvebypass"), F("bypass Ventil"))
|
||||
MAKE_PSTR_LIST(valveBuffer, F("valvebuffer"), F("Puffer Ventil"))
|
||||
MAKE_PSTR_LIST(valveReturn, F("valvereturn"), F("Rückfluss Ventil"))
|
||||
MAKE_PSTR_LIST(aPumpMod, F("altpumpmod"), F("Alternativ hs Pumpenmodulation"))
|
||||
MAKE_PSTR_LIST(heatSource, F("heatsource"), F("Alternativ Heizung"))
|
||||
|
||||
MAKE_PSTR_LIST(vr2Config, F("vr2config"), F("vr2 configuration"))
|
||||
MAKE_PSTR_LIST(ahsActivated, F("ahsactivated"), F("alternate heat source activation"))
|
||||
MAKE_PSTR_LIST(aPumpConfig, F("apumpconfig"), F("primary pump config"))
|
||||
MAKE_PSTR_LIST(aPumpSignal, F("apumpsignal"), F("output for pr1 pump"))
|
||||
MAKE_PSTR_LIST(aPumpMin, F("apumpmin"), F("min output pump pr1"))
|
||||
MAKE_PSTR_LIST(tempRise, F("temprise"), F("ahs return temp rise"))
|
||||
MAKE_PSTR_LIST(setReturnTemp, F("setreturntemp"), F("set temp return"))
|
||||
MAKE_PSTR_LIST(mixRuntime, F("mixruntime"), F("mixer run time"))
|
||||
// MAKE_PSTR_LIST(setFlowTemp, F("setflowtemp"), F("set flow temp"))
|
||||
MAKE_PSTR_LIST(bufBypass, F("bufbypass"), F("buffer bypass config"))
|
||||
MAKE_PSTR_LIST(bufMixRuntime, F("bufmixruntime"), F("bypass mixer run time"))
|
||||
MAKE_PSTR_LIST(bufConfig, F("bufconfig"), F("dhw buffer config"))
|
||||
MAKE_PSTR_LIST(blockMode, F("blockmode"), F("config htg. blocking mode"))
|
||||
MAKE_PSTR_LIST(blockTerm, F("blockterm"), F("config of block terminal"))
|
||||
MAKE_PSTR_LIST(blockHyst, F("blockhyst"), F("hyst. for bolier block"))
|
||||
MAKE_PSTR_LIST(releaseWait, F("releasewait"), F("boiler release wait time"))
|
||||
|
||||
// the following are dhw for the boiler and automatically tagged with 'ww'
|
||||
MAKE_PSTR_LIST(wWSelTemp, F("wwseltemp"), F("gewählte Temperatur"))
|
||||
MAKE_PSTR_LIST(wwSelTempLow, F("wwseltemplow"), F("selected lower temperature"))
|
||||
MAKE_PSTR_LIST(wwSelTempOff, F("wwseltempoff"), F("selected temperature for off"))
|
||||
MAKE_PSTR_LIST(wwSelTempSingle, F("wwseltempsingle"), F("single charge temperature"))
|
||||
MAKE_PSTR_LIST(wWSetTemp, F("wwsettemp"), F("Solltemperatur"))
|
||||
MAKE_PSTR_LIST(wWType, F("wwtype"), F("Typ"))
|
||||
MAKE_PSTR_LIST(wWComfort, F("wwcomfort"), F("Komfort"))
|
||||
MAKE_PSTR_LIST(wWFlowTempOffset, F("wwflowtempoffset"), F("Flusstemperaturanhebung"))
|
||||
MAKE_PSTR_LIST(wWMaxPower, F("wwmaxpower"), F("max Leistung"))
|
||||
MAKE_PSTR_LIST(wWCircPump, F("wwcircpump"), F("Zirkulationspumpe vorhanden"))
|
||||
MAKE_PSTR_LIST(wWChargeType, F("wwchargetype"), F("Ladungstyp"))
|
||||
MAKE_PSTR_LIST(wWDisinfectionTemp, F("wwdisinfectiontemp"), F("Desinfectionstemperatur"))
|
||||
MAKE_PSTR_LIST(wWCircMode, F("wwcircmode"), F("Zirkulationspumpenfrequenz"))
|
||||
MAKE_PSTR_LIST(wWCirc, F("wwcirc"), F("Zirkulation aktiv"))
|
||||
MAKE_PSTR_LIST(wWCurTemp, F("wwcurtemp"), F("aktuelle Warmwasser Temperatur intern"))
|
||||
MAKE_PSTR_LIST(wWCurTemp2, F("wwcurtemp2"), F("aktuelle Warmwaser Temperatur extern"))
|
||||
MAKE_PSTR_LIST(wWCurFlow, F("wwcurflow"), F("aktueller Durchfluss"))
|
||||
MAKE_PSTR_LIST(wWStorageTemp1, F("wwstoragetemp1"), F("interne Speichertemperature"))
|
||||
MAKE_PSTR_LIST(wWStorageTemp2, F("wwstoragetemp2"), F("externer Speichertemperatur"))
|
||||
MAKE_PSTR_LIST(wWActivated, F("wwactivated"), F("aktiviert"))
|
||||
MAKE_PSTR_LIST(wWOneTime, F("wwonetime"), F("Einmalladung"))
|
||||
MAKE_PSTR_LIST(wWDisinfecting, F("wwdisinfect"), F("Desinfizieren"))
|
||||
MAKE_PSTR_LIST(wWCharging, F("wwcharging"), F("Laden"))
|
||||
MAKE_PSTR_LIST(wWRecharging, F("wwrecharging"), F("Nachladen"))
|
||||
MAKE_PSTR_LIST(wWTempOK, F("wwtempok"), F("Temperatur ok"))
|
||||
MAKE_PSTR_LIST(wWActive, F("wwactive"), F("aktiv"))
|
||||
MAKE_PSTR_LIST(wwTempOK, F("wwtempok"), F("Temperatur ok"))
|
||||
MAKE_PSTR_LIST(wwActive, F("wwactive"), F("aktiv"))
|
||||
MAKE_PSTR_LIST(ww3wayValve, F("ww3wayvalve"), F("3-Wegeventil aktiv"))
|
||||
MAKE_PSTR_LIST(wWSetPumpPower, F("wwsetpumppower"), F("Soll Pumpenleistung"))
|
||||
MAKE_PSTR_LIST(mixerTemp, F("mixertemp"), F("Mischertemperatur"))
|
||||
MAKE_PSTR_LIST(wwCylMiddleTemp, F("wwcylmiddletemp"), F("cylinder middle temperature (TS3)"))
|
||||
MAKE_PSTR_LIST(wWStarts, F("wwstarts"), F("Anzahl starts"))
|
||||
MAKE_PSTR_LIST(wWStarts2, F("wwstarts2"), F("Kreis 2 Anzahl Starts"))
|
||||
MAKE_PSTR_LIST(wWWorkM, F("wwworkm"), F("aktive Zeit"))
|
||||
MAKE_PSTR_LIST(wWHystOn, F("wwhyston"), F("Hysterese Einschalttemperatur"))
|
||||
MAKE_PSTR_LIST(wWHystOff, F("wwhystoff"), F("Hysterese Ausschalttemperatur"))
|
||||
MAKE_PSTR_LIST(wwProgMode, F("wwprogmode"), F("Programmmodus"))
|
||||
MAKE_PSTR_LIST(wwCircProg, F("wwcircprog"), F("Zirkulationsprogramm"))
|
||||
MAKE_PSTR_LIST(wwMaxTemp, F("wwmaxtemp"), F("Maximale Temperatur"))
|
||||
MAKE_PSTR_LIST(wwOneTimeKey, F("wwonetimekey"), F("Einmalladungstaste"))
|
||||
|
||||
// mqtt values / commands
|
||||
MAKE_PSTR_LIST(switchtime, F("switchtime"), F("Program Schaltzeit"))
|
||||
MAKE_PSTR_LIST(switchtime1, F("switchtime1"), F("Program 1 Schaltzeit"))
|
||||
MAKE_PSTR_LIST(switchtime2, F("switchtime2"), F("Programm 2 Schaltzeit"))
|
||||
MAKE_PSTR_LIST(wwswitchtime, F("wwswitchtime"), F("Programm Schaltzeit"))
|
||||
MAKE_PSTR_LIST(wwcircswitchtime, F("wwcircswitchtime"), F("Zirculationsprogramm Schaltzeit"))
|
||||
MAKE_PSTR_LIST(dateTime, F("datetime"), F("Datum/Zeit"))
|
||||
MAKE_PSTR_LIST(errorCode, F("errorcode"), F("Fehlermeldung"))
|
||||
MAKE_PSTR_LIST(ibaMainDisplay, F("display"), F("Anzeige"))
|
||||
MAKE_PSTR_LIST(ibaLanguage, F("language"), F("Sprache"))
|
||||
MAKE_PSTR_LIST(ibaClockOffset, F("clockoffset"), F("Uhrkorrektur"))
|
||||
MAKE_PSTR_LIST(ibaBuildingType, F("building"), F("Gebäude"))
|
||||
MAKE_PSTR_LIST(heatingPID, F("heatingpid"), F("heating PID"))
|
||||
MAKE_PSTR_LIST(ibaCalIntTemperature, F("intoffset"), F("Korrektur interner Temperatur"))
|
||||
MAKE_PSTR_LIST(ibaMinExtTemperature, F("minexttemp"), F("min Aussentemperatur"))
|
||||
MAKE_PSTR_LIST(backlight, F("backlight"), F("key backlight"))
|
||||
MAKE_PSTR_LIST(damping, F("damping"), F("Dämpfung der Außentemperatur"))
|
||||
MAKE_PSTR_LIST(tempsensor1, F("inttemp1"), F("Temperatursensor 1"))
|
||||
MAKE_PSTR_LIST(tempsensor2, F("inttemp2"), F("Temperatursensor 2"))
|
||||
MAKE_PSTR_LIST(dampedoutdoortemp, F("dampedoutdoortemp"), F("gedämpfte Aussentemperatur"))
|
||||
MAKE_PSTR_LIST(floordrystatus, F("floordry"), F("Estrichtrocknung"))
|
||||
MAKE_PSTR_LIST(floordrytemp, F("floordrytemp"), F("Estrichtrocknungs Temperatur"))
|
||||
MAKE_PSTR_LIST(brightness, F("brightness"), F("bildschirmhelligkeit"))
|
||||
MAKE_PSTR_LIST(autodst, F("autodst"), F("automatische sommerzeit umstellung"))
|
||||
MAKE_PSTR_LIST(preheating, F("preheating"), F("vorheizen im uhrenprogramm"))
|
||||
MAKE_PSTR_LIST(offtemp, F("offtemp"), F("temperatur bei ausgeschaltetem modus"))
|
||||
MAKE_PSTR_LIST(mixingvalves, F("mixingvalves"), F("mischventile"))
|
||||
// thermostat ww
|
||||
MAKE_PSTR_LIST(wwMode, F("wwmode"), F("modus"))
|
||||
MAKE_PSTR_LIST(wwSetTempLow, F("wwsettemplow"), F("untere Solltemperatur"))
|
||||
MAKE_PSTR_LIST(wwCharge, F("wwcharge"), F("charge"))
|
||||
MAKE_PSTR_LIST(wwChargeDuration, F("wwchargeduration"), F("charge duration"))
|
||||
MAKE_PSTR_LIST(wwDisinfect, F("wwdisinfect"), F("disinfection"))
|
||||
MAKE_PSTR_LIST(wwDisinfectDay, F("wwdisinfectday"), F("disinfection day"))
|
||||
MAKE_PSTR_LIST(wwDisinfectHour, F("wwdisinfecthour"), F("disinfection hour"))
|
||||
MAKE_PSTR_LIST(wwDisinfectTime, F("wwdisinfecttime"), F("disinfection time"))
|
||||
MAKE_PSTR_LIST(wwExtra1, F("wwextra1"), F("Kreis 1 Extra"))
|
||||
MAKE_PSTR_LIST(wwExtra2, F("wwextra2"), F("Kreis 2 Extra"))
|
||||
MAKE_PSTR_LIST(wwDailyHeating, F("wwdailyheating"), F("daily heating"))
|
||||
MAKE_PSTR_LIST(wwDailyHeatTime, F("wwdailyheattime"), F("daily heating time"))
|
||||
MAKE_PSTR_LIST(wwWhenModeOff, F("wwwhenmodeoff"), F("wenn Thermostatmodus ist aus"))
|
||||
// thermostat hc
|
||||
MAKE_PSTR_LIST(climate, F("climate"))
|
||||
MAKE_PSTR_LIST(selRoomTemp, F("seltemp"), F("Sollwert Raumtemperatur"))
|
||||
MAKE_PSTR_LIST(roomTemp, F("currtemp"), F("aktuelle Raumtemperatur"))
|
||||
MAKE_PSTR_LIST(mode, F("mode"), F("modus"))
|
||||
MAKE_PSTR_LIST(modetype, F("modetype"), F("modus Typ"))
|
||||
MAKE_PSTR_LIST(fastheatup, F("fastheatup"), F("fast heatup"))
|
||||
MAKE_PSTR_LIST(daytemp, F("daytemp"), F("Tagestemperatur"))
|
||||
MAKE_PSTR_LIST(daylowtemp, F("daytemp2"), F("Tagestemperatur T2"))
|
||||
MAKE_PSTR_LIST(daymidtemp, F("daytemp3"), F("Tagestemperatur T3"))
|
||||
MAKE_PSTR_LIST(dayhightemp, F("daytemp4"), F("Tagestemperatur T4"))
|
||||
MAKE_PSTR_LIST(heattemp, F("heattemp"), F("Heizen Temperatur"))
|
||||
MAKE_PSTR_LIST(nighttemp, F("nighttemp"), F("Nachttemperatur"))
|
||||
MAKE_PSTR_LIST(nighttemp2, F("nighttemp"), F("Nachttemperatur T1"))
|
||||
MAKE_PSTR_LIST(ecotemp, F("ecotemp"), F("eco Temperatur"))
|
||||
MAKE_PSTR_LIST(manualtemp, F("manualtemp"), F("manuelle Temperatur"))
|
||||
MAKE_PSTR_LIST(tempautotemp, F("tempautotemp"), F("zwischenzeitliche Solltemperatur"))
|
||||
MAKE_PSTR_LIST(comforttemp, F("comforttemp"), F("Komforttemperatur"))
|
||||
MAKE_PSTR_LIST(summertemp, F("summertemp"), F("Sommertemperatur"))
|
||||
MAKE_PSTR_LIST(designtemp, F("designtemp"), F("design-Temperatur"))
|
||||
MAKE_PSTR_LIST(offsettemp, F("offsettemp"), F("Temperaturanhebung"))
|
||||
MAKE_PSTR_LIST(minflowtemp, F("minflowtemp"), F("min Flusstemperatur"))
|
||||
MAKE_PSTR_LIST(maxflowtemp, F("maxflowtemp"), F("max Flusstemperatur"))
|
||||
MAKE_PSTR_LIST(roominfluence, F("roominfluence"), F("Raumeinfluss"))
|
||||
MAKE_PSTR_LIST(roominfl_factor, F("roominflfactor"), F("Raumeinfluss Factor"))
|
||||
MAKE_PSTR_LIST(curroominfl, F("curroominfl"), F("aktueller Raumeinfluss"))
|
||||
MAKE_PSTR_LIST(nofrosttemp, F("nofrosttemp"), F("Frostschutztemperatur"))
|
||||
MAKE_PSTR_LIST(targetflowtemp, F("targetflowtemp"), F("berechnete Flusstemperatur"))
|
||||
MAKE_PSTR_LIST(heatingtype, F("heatingtype"), F("Heizungstyp"))
|
||||
MAKE_PSTR_LIST(summersetmode, F("summersetmode"), F("Einstellung Sommerbetrieb"))
|
||||
MAKE_PSTR_LIST(hpoperatingmode, F("hpoperatingmode"), F("Wärmepumpe Betriebsmodus"))
|
||||
MAKE_PSTR_LIST(hpoperatingstate, F("hpoperatingstate"), F("heatpump operating state"))
|
||||
MAKE_PSTR_LIST(controlmode, F("controlmode"), F("Kontrollmodus"))
|
||||
MAKE_PSTR_LIST(control, F("control"), F("Fernsteuerung"))
|
||||
MAKE_PSTR_LIST(wwHolidays, F("wwholidays"), F("holiday dates"))
|
||||
MAKE_PSTR_LIST(wwVacations, F("wwvacations"), F("vacation dates"))
|
||||
MAKE_PSTR_LIST(holidays, F("holidays"), F("holiday dates"))
|
||||
MAKE_PSTR_LIST(vacations, F("vacations"), F("vacation dates"))
|
||||
MAKE_PSTR_LIST(program, F("program"), F("Programm"))
|
||||
MAKE_PSTR_LIST(pause, F("pause"), F("Pausenzeit"))
|
||||
MAKE_PSTR_LIST(party, F("party"), F("Partyzeit"))
|
||||
MAKE_PSTR_LIST(wwprio, F("wwprio"), F("dhw priority"))
|
||||
MAKE_PSTR_LIST(holidaytemp, F("holidaytemp"), F("Urlaubstemperatur"))
|
||||
MAKE_PSTR_LIST(summermode, F("summermode"), F("Sommerbetrieb"))
|
||||
MAKE_PSTR_LIST(holidaymode, F("holidaymode"), F("Urlaubsbetrieb"))
|
||||
MAKE_PSTR_LIST(flowtempoffset, F("flowtempoffset"), F("Flusstemperaturanhebung"))
|
||||
MAKE_PSTR_LIST(reducemode, F("reducemode"), F("Absenkmodus"))
|
||||
MAKE_PSTR_LIST(noreducetemp, F("noreducetemp"), F("Absenkung unterbrechen unter Temperatur"))
|
||||
MAKE_PSTR_LIST(reducetemp, F("reducetemp"), F("Absenkmodus unter Temperatur"))
|
||||
MAKE_PSTR_LIST(vacreducetemp, F("vacreducetemp"), F("Urlaub Absenkmodus unter Temperatur"))
|
||||
MAKE_PSTR_LIST(vacreducemode, F("vacreducemode"), F("Urlaub Absenkmodus"))
|
||||
MAKE_PSTR_LIST(nofrostmode, F("nofrostmode"), F("Frostschutz Modus"))
|
||||
MAKE_PSTR_LIST(nofrostmode1, F("nofrostmode1"), F("nofrost mode")) // RC310
|
||||
MAKE_PSTR_LIST(remotetemp, F("remotetemp"), F("Raumtemperatur der Fernsteuerung"))
|
||||
MAKE_PSTR_LIST(reducehours, F("reducehours"), F("duration for nighttemp"))
|
||||
MAKE_PSTR_LIST(reduceminutes, F("reduceminutes"), F("remaining time for nightmode"))
|
||||
MAKE_PSTR_LIST(switchonoptimization, F("switchonoptimization"), F("switch-on optimization"))
|
||||
|
||||
// heatpump
|
||||
MAKE_PSTR_LIST(airHumidity, F("airhumidity"), F("relative Luftfeuchte"))
|
||||
MAKE_PSTR_LIST(dewTemperature, F("dewtemperature"), F("Taupunkttemperatur"))
|
||||
|
||||
// mixer
|
||||
MAKE_PSTR_LIST(flowSetTemp, F("flowsettemp"), F("Sollwert Flusstemperatur"))
|
||||
MAKE_PSTR_LIST(flowTempHc, F("flowtemphc"), F("Flusstemperatur des hk (TC1)"))
|
||||
MAKE_PSTR_LIST(pumpStatus, F("pumpstatus"), F("Pumpenstatus des hk (PC1)"))
|
||||
MAKE_PSTR_LIST(mixerStatus, F("valvestatus"), F("Mischerventil Position (VC1)"))
|
||||
MAKE_PSTR_LIST(flowTempVf, F("flowtempvf"), F("Flusstemperatur am Kessel (T0/Vf)"))
|
||||
MAKE_PSTR_LIST(mixerSetTime, F("valvesettime"), F("time to set valve"))
|
||||
// mixer prefixed with wwc
|
||||
MAKE_PSTR_LIST(wwPumpStatus, F("pumpstatus"), F("Pumpenstatus des wwk (PC1)"))
|
||||
MAKE_PSTR_LIST(wwTempStatus, F("tempstatus"), F("Temperaturschalter des wwk (MC1)"))
|
||||
MAKE_PSTR_LIST(wwTemp, F("wwtemp"), F("aktuelle Temperatur"))
|
||||
// mixer pool
|
||||
MAKE_PSTR_LIST(poolSetTemp, F("poolsettemp"), F("pool set temperature"))
|
||||
MAKE_PSTR_LIST(poolTemp, F("pooltemp"), F("pool temperature"))
|
||||
MAKE_PSTR_LIST(poolShuntStatus, F("poolshuntstatus"), F("pool shunt status opening/closing"))
|
||||
MAKE_PSTR_LIST(poolShunt, F("poolshunt"), F("pool shunt open/close (0% = pool / 100% = heat)"))
|
||||
MAKE_PSTR_LIST(hydrTemp, F("hydrTemp"), F("hydraulic header temperature"))
|
||||
|
||||
// solar
|
||||
MAKE_PSTR_LIST(collectorTemp, F("collectortemp"), F("Kollektortemperatur (TS1)"))
|
||||
MAKE_PSTR_LIST(collector2Temp, F("collector2temp"), F("collector 2 temperature (TS7)"))
|
||||
MAKE_PSTR_LIST(cylBottomTemp, F("cylbottomtemp"), F("Speicher Bodentemperatur (TS2)"))
|
||||
MAKE_PSTR_LIST(cyl2BottomTemp, F("cyl2bottomtemp"), F("2. Speicher Bodentemperatur (TS5)"))
|
||||
MAKE_PSTR_LIST(heatExchangerTemp, F("heatexchangertemp"), F("wärmetauscher Temperatur (TS6)"))
|
||||
MAKE_PSTR_LIST(cylMiddleTemp, F("cylmiddletemp"), F("cylinder middle temperature (TS3)"))
|
||||
MAKE_PSTR_LIST(retHeatAssist, F("retheatassist"), F("return temperature heat assistance (TS4)"))
|
||||
// correct name for M1? value not found, try this:
|
||||
MAKE_PSTR_LIST(m1Valve, F("heatassistvalve"), F("heat assistance valve (M1)"))
|
||||
MAKE_PSTR_LIST(m1Power, F("heatassistpower"), F("heat assistance valve power (M1)"))
|
||||
MAKE_PSTR_LIST(collectorMaxTemp, F("collectormaxtemp"), F("maximale Kollektortemperatur"))
|
||||
MAKE_PSTR_LIST(collectorMinTemp, F("collectormintemp"), F("minimale Kollektortemperatur"))
|
||||
MAKE_PSTR_LIST(cylMaxTemp, F("cylmaxtemp"), F("maximale Speichertemperatur"))
|
||||
// MAKE_PSTR_LIST(cyl2MaxTemp, F("cyl2maxtemp"), F("maximum cylinder 2 temperature"))
|
||||
MAKE_PSTR_LIST(solarPumpMod, F("solarpumpmod"), F("Pumpenmodulation (PS1)"))
|
||||
MAKE_PSTR_LIST(cylPumpMod, F("cylpumpmod"), F("Speicherpumpenmodulation (PS5)"))
|
||||
MAKE_PSTR_LIST(solarPump, F("solarpump"), F("Pumpe (PS1)"))
|
||||
MAKE_PSTR_LIST(solarPump2, F("solarpump2"), F("pump 2 (PS4)"))
|
||||
MAKE_PSTR_LIST(solarPump2Mod, F("solarpump2mod"), F("pump 2 modulation (PS4)"))
|
||||
MAKE_PSTR_LIST(valveStatus, F("valvestatus"), F("ventilstatus"))
|
||||
MAKE_PSTR_LIST(cylHeated, F("cylheated"), F("Speichertemperatur erreicht"))
|
||||
MAKE_PSTR_LIST(collectorShutdown, F("collectorshutdown"), F("Kollektorabschaltung"))
|
||||
MAKE_PSTR_LIST(pumpWorkTime, F("pumpworktime"), F("Pumpenlaufzeit"))
|
||||
MAKE_PSTR_LIST(pump2WorkTime, F("pump2worktime"), F("Pumpe 2 Laufzeit"))
|
||||
MAKE_PSTR_LIST(m1WorkTime, F("m1worktime"), F("Differenzregelung Arbeitszeit"))
|
||||
MAKE_PSTR_LIST(energyLastHour, F("energylasthour"), F("Energie letzte Std"))
|
||||
MAKE_PSTR_LIST(energyTotal, F("energytotal"), F("Gesamtenergie"))
|
||||
MAKE_PSTR_LIST(energyToday, F("energytoday"), F("Energie heute"))
|
||||
MAKE_PSTR_LIST(pumpMinMod, F("pumpminmod"), F("minimum pump modulation"))
|
||||
MAKE_PSTR_LIST(maxFlow, F("maxflow"), F("maximum solar flow"))
|
||||
MAKE_PSTR_LIST(solarPower, F("solarpower"), F("actual solar power"))
|
||||
MAKE_PSTR_LIST(solarPumpTurnonDiff, F("turnondiff"), F("pump turn on difference"))
|
||||
MAKE_PSTR_LIST(solarPumpTurnoffDiff, F("turnoffdiff"), F("pump turn off difference"))
|
||||
MAKE_PSTR_LIST(pump2MinMod, F("pump2minmod"), F("minimum pump 2 modulation"))
|
||||
MAKE_PSTR_LIST(solarPump2TurnonDiff, F("turnondiff2"), F("pump 2 turn on difference"))
|
||||
MAKE_PSTR_LIST(solarPump2TurnoffDiff, F("turnoffdiff2"), F("pump 2 turn off difference"))
|
||||
|
||||
// solar ww
|
||||
MAKE_PSTR_LIST(wwTemp1, F("wwtemp1"), F("Temperatur 1"))
|
||||
MAKE_PSTR_LIST(wwTemp3, F("wwtemp3"), F("Temperatur 3"))
|
||||
MAKE_PSTR_LIST(wwTemp4, F("wwtemp4"), F("Temperatur 4"))
|
||||
MAKE_PSTR_LIST(wwTemp5, F("wwtemp5"), F("Temperatur 5"))
|
||||
MAKE_PSTR_LIST(wwTemp7, F("wwtemp7"), F("Temperatur 7"))
|
||||
MAKE_PSTR_LIST(wwPump, F("wwpump"), F("Pumpe"))
|
||||
// solar ww and mixer wwc
|
||||
MAKE_PSTR_LIST(wwMinTemp, F("wwmintemp"), F("minimale Temperatur"))
|
||||
MAKE_PSTR_LIST(wwRedTemp, F("wwredtemp"), F("redizierte Temperatur"))
|
||||
MAKE_PSTR_LIST(wwDailyTemp, F("wwdailytemp"), F("tägl. Temperatur"))
|
||||
MAKE_PSTR_LIST(wwKeepWarm, F("wwkeepwarm"), F("Warmhalten"))
|
||||
MAKE_PSTR_LIST(wwStatus2, F("wwstatus2"), F("Status 2"))
|
||||
MAKE_PSTR_LIST(enum_wwStatus2, F(""), F(""), F(""), F("no_heat"), F(""), F(""), F("heatrequest"), F(""), F("disinfecting"), F("hold"))
|
||||
MAKE_PSTR_LIST(wwPumpMod, F("wwpumpmod"), F("Pumpen Modulation"))
|
||||
MAKE_PSTR_LIST(wwFlow, F("wwflow"), F("Flussrate"))
|
||||
// extra mixer ww
|
||||
MAKE_PSTR_LIST(wwRequiredTemp, F("wwrequiredtemp"), F("benötigte Temperatur"))
|
||||
MAKE_PSTR_LIST(wwDiffTemp, F("wwdifftemp"), F("Start Differential Temperatur"))
|
||||
|
||||
//SM100
|
||||
MAKE_PSTR_LIST(heatTransferSystem, F("heattransfersystem"), F("Wärmetransfer System"))
|
||||
MAKE_PSTR_LIST(externalCyl, F("externalcyl"), F("Externer Speicher"))
|
||||
MAKE_PSTR_LIST(thermalDisinfect, F("thermaldisinfect"), F("Thermische Desinfektion"))
|
||||
MAKE_PSTR_LIST(heatMetering, F("heatmetering"), F("Wärmemessung"))
|
||||
MAKE_PSTR_LIST(solarIsEnabled, F("solarenabled"), F("Solarmodul aktiviert"))
|
||||
|
||||
// telegram 0x035A
|
||||
MAKE_PSTR_LIST(solarPumpMode, F("solarpumpmode"), F("solar Pumpen Einst."))
|
||||
MAKE_PSTR_LIST(solarPumpKick, F("pumpkick"), F("pumpkick"))
|
||||
MAKE_PSTR_LIST(plainWaterMode, F("plainwatermode"), F("plain water mode"))
|
||||
MAKE_PSTR_LIST(doubleMatchFlow, F("doublematchflow"), F("doublematchflow"))
|
||||
MAKE_PSTR_LIST(solarPump2Mode, F("pump2mode"), F("pump 2 mode"))
|
||||
MAKE_PSTR_LIST(solarPump2Kick, F("pump2kick"), F("pumpkick 2"))
|
||||
|
||||
// telegram 0x035F
|
||||
MAKE_PSTR_LIST(cylPriority, F("cylpriority"), F("Speicher Priorität"))
|
||||
|
||||
// telegram 0x380
|
||||
MAKE_PSTR_LIST(climateZone, F("climatezone"), F("climate zone"))
|
||||
MAKE_PSTR_LIST(collector1Area, F("collector1area"), F("Kollektor 1 Fläche"))
|
||||
MAKE_PSTR_LIST(collector1Type, F("collector1type"), F("Kollektor 1 Type"))
|
||||
MAKE_PSTR_LIST(collector2Area, F("collector2area"), F("Kollektor 2 Fläche"))
|
||||
MAKE_PSTR_LIST(collector2Type, F("collector2type"), F("Kollektor 2 Type"))
|
||||
|
||||
// telegram 0x0363 heatCounter
|
||||
MAKE_PSTR_LIST(heatCntFlowTemp, F("heatcntflowtemp"), F("Wärmezähler Fluss-Temperatur"))
|
||||
MAKE_PSTR_LIST(heatCntRetTemp, F("heatcntrettemp"), F("Wärmezähler Rückfluss-Temperatur"))
|
||||
MAKE_PSTR_LIST(heatCnt, F("heatcnt"), F("Wärmezäler Impulse"))
|
||||
MAKE_PSTR_LIST(swapFlowTemp, F("swapflowtemp"), F("Austausch Fluss-Temperatur (TS14)"))
|
||||
MAKE_PSTR_LIST(swapRetTemp, F("swaprettemp"), F("Austausch Rückfluss-Temperatur (TS15)"))
|
||||
|
||||
// switch
|
||||
MAKE_PSTR_LIST(activated, F("activated"), F("aktiviert"))
|
||||
MAKE_PSTR_LIST(status, F("status"), F("Status"))
|
||||
|
||||
// unknown fields to track (SM10)
|
||||
MAKE_PSTR_LIST(data11, F("data11"), F("unknown datafield 11"))
|
||||
MAKE_PSTR_LIST(data12, F("data12"), F("unknown datafield 12"))
|
||||
MAKE_PSTR_LIST(data8, F("data8"), F("unknown datafield 8"))
|
||||
MAKE_PSTR_LIST(data0, F("data0"), F("unknown datafield 0"))
|
||||
MAKE_PSTR_LIST(data1, F("data1"), F("unknown datafield 1"))
|
||||
MAKE_PSTR_LIST(setting3, F("setting3"), F("unknown setting 3"))
|
||||
MAKE_PSTR_LIST(setting4, F("setting4"), F("unknown setting 4"))
|
||||
|
||||
// RF sensor, id 0x40, telegram 0x435
|
||||
MAKE_PSTR_LIST(RFTemp, F("rftemp"), F("RF Raumtemperatur Sensor"));
|
||||
848
src/locale_EN.h
848
src/locale_EN.h
@@ -1,848 +0,0 @@
|
||||
/*
|
||||
* EMS-ESP - https://github.com/emsesp/EMS-ESP
|
||||
* Copyright 2020 Paul Derbyshire
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
// common words
|
||||
MAKE_PSTR_WORD(debug)
|
||||
MAKE_PSTR_WORD(exit)
|
||||
MAKE_PSTR_WORD(help)
|
||||
MAKE_PSTR_WORD(log)
|
||||
MAKE_PSTR_WORD(logout)
|
||||
MAKE_PSTR_WORD(enabled)
|
||||
MAKE_PSTR_WORD(disabled)
|
||||
MAKE_PSTR_WORD(set)
|
||||
MAKE_PSTR_WORD(show)
|
||||
MAKE_PSTR_WORD(on)
|
||||
MAKE_PSTR_WORD(off)
|
||||
MAKE_PSTR_WORD(ON)
|
||||
MAKE_PSTR_WORD(OFF)
|
||||
MAKE_PSTR_WORD(su)
|
||||
MAKE_PSTR_WORD(name)
|
||||
MAKE_PSTR_WORD(auto)
|
||||
MAKE_PSTR_WORD(scan)
|
||||
MAKE_PSTR_WORD(password)
|
||||
MAKE_PSTR_WORD(read)
|
||||
MAKE_PSTR_WORD(version)
|
||||
MAKE_PSTR_WORD(values)
|
||||
MAKE_PSTR_WORD(system)
|
||||
MAKE_PSTR_WORD(fetch)
|
||||
MAKE_PSTR_WORD(restart)
|
||||
MAKE_PSTR_WORD(format)
|
||||
MAKE_PSTR_WORD(raw)
|
||||
MAKE_PSTR_WORD(watch)
|
||||
MAKE_PSTR_WORD(syslog)
|
||||
MAKE_PSTR_WORD(send)
|
||||
MAKE_PSTR_WORD(telegram)
|
||||
MAKE_PSTR_WORD(bus_id)
|
||||
MAKE_PSTR_WORD(tx_mode)
|
||||
MAKE_PSTR_WORD(ems)
|
||||
MAKE_PSTR_WORD(devices)
|
||||
MAKE_PSTR_WORD(shower)
|
||||
MAKE_PSTR_WORD(mqtt)
|
||||
MAKE_PSTR_WORD(emsesp)
|
||||
MAKE_PSTR_WORD(connected)
|
||||
MAKE_PSTR_WORD(disconnected)
|
||||
MAKE_PSTR_WORD(passwd)
|
||||
MAKE_PSTR_WORD(hostname)
|
||||
MAKE_PSTR_WORD(wifi)
|
||||
MAKE_PSTR_WORD(reconnect)
|
||||
MAKE_PSTR_WORD(ssid)
|
||||
MAKE_PSTR_WORD(heartbeat)
|
||||
MAKE_PSTR_WORD(users)
|
||||
MAKE_PSTR_WORD(publish)
|
||||
MAKE_PSTR_WORD(timeout)
|
||||
MAKE_PSTR_WORD(board_profile)
|
||||
MAKE_PSTR_WORD(setvalue)
|
||||
|
||||
// for commands
|
||||
MAKE_PSTR_WORD(call)
|
||||
MAKE_PSTR_WORD(cmd)
|
||||
MAKE_PSTR_WORD(id)
|
||||
MAKE_PSTR_WORD(hc)
|
||||
MAKE_PSTR_WORD(wwc)
|
||||
MAKE_PSTR_WORD(device)
|
||||
MAKE_PSTR_WORD(data)
|
||||
MAKE_PSTR_WORD(command)
|
||||
MAKE_PSTR_WORD(commands)
|
||||
MAKE_PSTR_WORD(info)
|
||||
MAKE_PSTR_WORD(settings)
|
||||
MAKE_PSTR_WORD(customizations)
|
||||
MAKE_PSTR_WORD(value)
|
||||
MAKE_PSTR_WORD(error)
|
||||
MAKE_PSTR_WORD(entities)
|
||||
|
||||
// devices
|
||||
MAKE_PSTR_WORD(boiler)
|
||||
MAKE_PSTR_WORD(thermostat)
|
||||
MAKE_PSTR_WORD(switch)
|
||||
MAKE_PSTR_WORD(solar)
|
||||
MAKE_PSTR_WORD(mixer)
|
||||
MAKE_PSTR_WORD(gateway)
|
||||
MAKE_PSTR_WORD(controller)
|
||||
MAKE_PSTR_WORD(connect)
|
||||
MAKE_PSTR_WORD(heatpump)
|
||||
MAKE_PSTR_WORD(generic)
|
||||
MAKE_PSTR_WORD(analogsensor)
|
||||
MAKE_PSTR_WORD(unknown)
|
||||
MAKE_PSTR_WORD(dallassensor)
|
||||
|
||||
// format strings
|
||||
MAKE_PSTR(host_fmt, "Host: %s")
|
||||
MAKE_PSTR(port_fmt, "Port: %d")
|
||||
MAKE_PSTR(hostname_fmt, "Hostname: %s")
|
||||
MAKE_PSTR(board_profile_fmt, "Board Profile: %s")
|
||||
MAKE_PSTR(mark_interval_fmt, "Mark interval: %lus")
|
||||
MAKE_PSTR(wifi_ssid_fmt, "WiFi SSID: %s")
|
||||
MAKE_PSTR(wifi_password_fmt, "WiFi Password: %S")
|
||||
MAKE_PSTR(tx_mode_fmt, "Tx mode: %d")
|
||||
MAKE_PSTR(bus_id_fmt, "Bus ID: %02X")
|
||||
MAKE_PSTR(log_level_fmt, "Log level: %s")
|
||||
|
||||
MAKE_STR(productid_fmt, "%s EMS ProductID")
|
||||
|
||||
MAKE_PSTR_LIST(enum_syslog_level, F_(off), F("emerg"), F("alert"), F("crit"), F_(error), F("warn"), F("notice"), F_(info), F_(debug), F("trace"), F("all"))
|
||||
MAKE_PSTR_LIST(enum_watch, F_(off), F_(on), F_(raw), F_(unknown))
|
||||
MAKE_PSTR_LIST(enum_sensortype, F("none"), F("digital in"), F("counter"), F("adc"), F("timer"), F("rate"), F("digital out"), F("pwm 0"), F("pwm 1"), F("pwm 2"))
|
||||
|
||||
// strings
|
||||
MAKE_PSTR(EMSESP, "EMS-ESP")
|
||||
MAKE_PSTR(cmd_optional, "[cmd]")
|
||||
MAKE_PSTR(ha_optional, "[ha]")
|
||||
MAKE_PSTR(deep_optional, "[deep]")
|
||||
MAKE_PSTR(watchid_optional, "[ID]")
|
||||
MAKE_PSTR(watch_format_optional, "[off | on | raw | unknown]")
|
||||
MAKE_PSTR(invalid_watch, "Invalid watch type")
|
||||
MAKE_PSTR(data_mandatory, "\"XX XX ...\"")
|
||||
MAKE_PSTR(asterisks, "********")
|
||||
MAKE_PSTR(n_mandatory, "<n>")
|
||||
MAKE_PSTR(sensorid_optional, "[sensor ID]")
|
||||
MAKE_PSTR(id_optional, "[id|hc]")
|
||||
MAKE_PSTR(data_optional, "[data]")
|
||||
MAKE_PSTR(offset_optional, "[offset]")
|
||||
MAKE_PSTR(length_optional, "[length]")
|
||||
MAKE_PSTR(typeid_mandatory, "<type ID>")
|
||||
MAKE_PSTR(deviceid_mandatory, "<device ID>")
|
||||
MAKE_PSTR(device_type_optional, "[device]")
|
||||
MAKE_PSTR(invalid_log_level, "Invalid log level")
|
||||
MAKE_PSTR(log_level_optional, "[level]")
|
||||
MAKE_PSTR(name_mandatory, "<name>")
|
||||
MAKE_PSTR(name_optional, "[name]")
|
||||
MAKE_PSTR(new_password_prompt1, "Enter new password: ")
|
||||
MAKE_PSTR(new_password_prompt2, "Retype new password: ")
|
||||
MAKE_PSTR(password_prompt, "Password: ")
|
||||
MAKE_PSTR(unset, "<unset>")
|
||||
|
||||
// command descriptions
|
||||
MAKE_PSTR(info_cmd, "lists all values")
|
||||
MAKE_PSTR(commands_cmd, "lists all commands")
|
||||
MAKE_PSTR(entities_cmd, "lists all entities")
|
||||
|
||||
MAKE_PSTR_WORD(number)
|
||||
MAKE_PSTR_WORD(enum)
|
||||
MAKE_PSTR_WORD(text)
|
||||
|
||||
MAKE_PSTR_WORD(2)
|
||||
MAKE_PSTR_WORD(4)
|
||||
MAKE_PSTR_WORD(10)
|
||||
MAKE_PSTR_WORD(100)
|
||||
MAKE_PSTR_WORD(60)
|
||||
|
||||
MAKE_PSTR_LIST(div2, F_(2))
|
||||
MAKE_PSTR_LIST(div4, F_(4))
|
||||
MAKE_PSTR_LIST(div10, F_(10))
|
||||
MAKE_PSTR_LIST(div60, F_(60))
|
||||
MAKE_PSTR_LIST(div100, F_(100))
|
||||
MAKE_PSTR_LIST(mul5, F("-5"))
|
||||
MAKE_PSTR_LIST(mul10, F("-10"))
|
||||
MAKE_PSTR_LIST(mul15, F("-15"))
|
||||
|
||||
// Unit Of Measurement mapping - maps to DeviceValueUOM_s in emsdevice.cpp
|
||||
// uom - also used with HA see https://github.com/home-assistant/core/blob/d7ac4bd65379e11461c7ce0893d3533d8d8b8cbf/homeassistant/const.py#L384
|
||||
MAKE_PSTR(blank, " ")
|
||||
MAKE_PSTR(percent, "%")
|
||||
MAKE_PSTR(degrees, "°C")
|
||||
MAKE_PSTR(kwh, "kWh")
|
||||
MAKE_PSTR(wh, "Wh")
|
||||
MAKE_PSTR(bar, "bar")
|
||||
MAKE_PSTR(minutes, "minutes")
|
||||
MAKE_PSTR(hours, "hours")
|
||||
MAKE_PSTR(days, "days")
|
||||
MAKE_PSTR(ua, "uA")
|
||||
MAKE_PSTR(lmin, "l/min")
|
||||
MAKE_PSTR(kw, "kW")
|
||||
MAKE_PSTR(w, "W")
|
||||
MAKE_PSTR(kb, "KB")
|
||||
MAKE_PSTR(seconds, "seconds")
|
||||
MAKE_PSTR(dbm, "dBm")
|
||||
MAKE_PSTR(fahrenheit, "°F")
|
||||
MAKE_PSTR(mv, "mV")
|
||||
MAKE_PSTR(sqm, "sqm")
|
||||
MAKE_PSTR(m3, "m3")
|
||||
MAKE_PSTR(l, "l")
|
||||
// MAKE_PSTR(times, "times")
|
||||
// MAKE_PSTR(oclock, "o'clock")
|
||||
|
||||
// TAG mapping - maps to DeviceValueTAG_s in emsdevice.cpp
|
||||
// use empty string if want to suppress showing tags
|
||||
// mqtt tags must not have spaces
|
||||
MAKE_PSTR(tag_none, "")
|
||||
MAKE_PSTR(tag_heartbeat, "")
|
||||
MAKE_PSTR(tag_boiler_data_ww, "dhw")
|
||||
MAKE_PSTR(tag_device_data, "")
|
||||
MAKE_PSTR(tag_device_data_ww, "dhw")
|
||||
MAKE_PSTR(tag_hc1, "hc1")
|
||||
MAKE_PSTR(tag_hc2, "hc2")
|
||||
MAKE_PSTR(tag_hc3, "hc3")
|
||||
MAKE_PSTR(tag_hc4, "hc4")
|
||||
MAKE_PSTR(tag_hc5, "hc5")
|
||||
MAKE_PSTR(tag_hc6, "hc6")
|
||||
MAKE_PSTR(tag_hc7, "hc7")
|
||||
MAKE_PSTR(tag_hc8, "hc8")
|
||||
MAKE_PSTR(tag_wwc1, "wwc1")
|
||||
MAKE_PSTR(tag_wwc2, "wwc2")
|
||||
MAKE_PSTR(tag_wwc3, "wwc3")
|
||||
MAKE_PSTR(tag_wwc4, "wwc4")
|
||||
MAKE_PSTR(tag_wwc5, "wwc5")
|
||||
MAKE_PSTR(tag_wwc6, "wwc6")
|
||||
MAKE_PSTR(tag_wwc7, "wwc7")
|
||||
MAKE_PSTR(tag_wwc8, "wwc8")
|
||||
MAKE_PSTR(tag_wwc9, "wwc9")
|
||||
MAKE_PSTR(tag_wwc10, "wwc10")
|
||||
MAKE_PSTR(tag_ahs, "ahs")
|
||||
MAKE_PSTR(tag_hs1, "hs1")
|
||||
MAKE_PSTR(tag_hs2, "hs2")
|
||||
MAKE_PSTR(tag_hs3, "hs3")
|
||||
MAKE_PSTR(tag_hs4, "hs4")
|
||||
MAKE_PSTR(tag_hs5, "hs5")
|
||||
MAKE_PSTR(tag_hs6, "hs6")
|
||||
MAKE_PSTR(tag_hs7, "hs7")
|
||||
MAKE_PSTR(tag_hs8, "hs8")
|
||||
MAKE_PSTR(tag_hs9, "hs9")
|
||||
MAKE_PSTR(tag_hs10, "hs10")
|
||||
MAKE_PSTR(tag_hs11, "hs11")
|
||||
MAKE_PSTR(tag_hs12, "hs12")
|
||||
MAKE_PSTR(tag_hs13, "hs13")
|
||||
MAKE_PSTR(tag_hs14, "hs14")
|
||||
MAKE_PSTR(tag_hs15, "hs15")
|
||||
MAKE_PSTR(tag_hs16, "hs16")
|
||||
|
||||
// MQTT topic names
|
||||
// MAKE_PSTR(tag_heartbeat_mqtt, "heartbeat")
|
||||
// MAKE_PSTR(tag_boiler_data_mqtt, "")
|
||||
MAKE_PSTR(tag_boiler_data_ww_mqtt, "ww")
|
||||
MAKE_PSTR(tag_device_data_ww_mqtt, "")
|
||||
|
||||
// boiler
|
||||
MAKE_PSTR_WORD(time)
|
||||
MAKE_PSTR_WORD(date)
|
||||
MAKE_PSTR_WORD(1x3min)
|
||||
MAKE_PSTR_WORD(2x3min)
|
||||
MAKE_PSTR_WORD(3x3min)
|
||||
MAKE_PSTR_WORD(4x3min)
|
||||
MAKE_PSTR_WORD(5x3min)
|
||||
MAKE_PSTR_WORD(6x3min)
|
||||
MAKE_PSTR_WORD(continuous)
|
||||
MAKE_PSTR(3wayvalve, "3-way valve")
|
||||
MAKE_PSTR(chargepump, "charge pump")
|
||||
MAKE_PSTR_WORD(hot)
|
||||
MAKE_PSTR_WORD(high_comfort)
|
||||
MAKE_PSTR_WORD(eco)
|
||||
MAKE_PSTR_WORD(intelligent)
|
||||
MAKE_PSTR_WORD(flow)
|
||||
MAKE_PSTR_WORD(manual)
|
||||
MAKE_PSTR_WORD(buffer)
|
||||
MAKE_PSTR(bufferedflow, "buffered flow")
|
||||
MAKE_PSTR(layeredbuffer, "layered buffer")
|
||||
MAKE_PSTR_WORD(maintenance)
|
||||
MAKE_PSTR_WORD(heating)
|
||||
MAKE_PSTR_WORD(cooling)
|
||||
|
||||
// boiler lists
|
||||
MAKE_PSTR_LIST(tpl_date, F("Format: < dd.mm.yyyy >")) // template for text input
|
||||
MAKE_PSTR_LIST(enum_off_time_date_manual, F_(off), F_(time), F_(date), F_(manual))
|
||||
MAKE_PSTR_LIST(enum_freq, F_(off), F_(1x3min), F_(2x3min), F_(3x3min), F_(4x3min), F_(5x3min), F_(6x3min), F_(continuous))
|
||||
MAKE_PSTR_LIST(enum_charge, F_(chargepump), F_(3wayvalve))
|
||||
MAKE_PSTR_LIST(enum_comfort, F_(hot), F_(eco), F_(intelligent))
|
||||
MAKE_PSTR_LIST(enum_comfort1, F_(high_comfort), F_(eco))
|
||||
MAKE_PSTR_LIST(enum_flow, F_(off), F_(flow), F_(bufferedflow), F_(buffer), F_(layeredbuffer))
|
||||
MAKE_PSTR_LIST(enum_reset, F("-"), F_(maintenance), F_(error))
|
||||
// MAKE_PSTR_LIST(enum_bool, F_(off), F_(on))
|
||||
|
||||
// AM200 lists
|
||||
MAKE_PSTR_LIST(enum_vr2Config, F_(off), F("bypass"));
|
||||
MAKE_PSTR_LIST(enum_aPumpSignal, F_(off), F("pwm"), F("pwm_invers"));
|
||||
MAKE_PSTR_LIST(enum_bufBypass, F("no"), F_(mixer), F("valve"));
|
||||
MAKE_PSTR_LIST(enum_bufConfig, F("monovalent"), F("bivalent"));
|
||||
MAKE_PSTR_LIST(enum_blockMode, F_(off), F_(auto), F("blocking"));
|
||||
MAKE_PSTR_LIST(enum_blockTerm, F("n_o"), F("n_c"));
|
||||
|
||||
//heatpump
|
||||
MAKE_PSTR_LIST(enum_hpactivity, F("none"), F_(heating), F_(cooling), F("hot_water"), F("pool"))
|
||||
|
||||
// mixer
|
||||
MAKE_PSTR_LIST(enum_shunt, F("stopped"), F("opening"), F("closing"), F("open"), F("close"))
|
||||
|
||||
// thermostat
|
||||
MAKE_PSTR_WORD(light)
|
||||
MAKE_PSTR_WORD(medium)
|
||||
MAKE_PSTR_WORD(heavy)
|
||||
MAKE_PSTR_WORD(own_prog)
|
||||
MAKE_PSTR_WORD(start)
|
||||
MAKE_PSTR_WORD(heat)
|
||||
MAKE_PSTR_WORD(hold)
|
||||
MAKE_PSTR_WORD(cool)
|
||||
MAKE_PSTR_WORD(end)
|
||||
MAKE_PSTR_WORD(german)
|
||||
MAKE_PSTR_WORD(dutch)
|
||||
MAKE_PSTR_WORD(french)
|
||||
MAKE_PSTR_WORD(italian)
|
||||
MAKE_PSTR_WORD(high)
|
||||
MAKE_PSTR_WORD(low)
|
||||
MAKE_PSTR_WORD(radiator)
|
||||
MAKE_PSTR_WORD(convector)
|
||||
MAKE_PSTR_WORD(floor)
|
||||
MAKE_PSTR_WORD(summer)
|
||||
MAKE_PSTR_WORD(winter)
|
||||
MAKE_PSTR_WORD(outdoor)
|
||||
MAKE_PSTR_WORD(mpc)
|
||||
MAKE_PSTR_WORD(room)
|
||||
MAKE_PSTR_WORD(room_outdoor)
|
||||
MAKE_PSTR_WORD(power)
|
||||
MAKE_PSTR_WORD(constant)
|
||||
MAKE_PSTR_WORD(simple)
|
||||
MAKE_PSTR_WORD(optimized)
|
||||
MAKE_PSTR_WORD(nofrost)
|
||||
MAKE_PSTR_WORD(comfort)
|
||||
MAKE_PSTR_WORD(night)
|
||||
MAKE_PSTR_WORD(day)
|
||||
MAKE_PSTR_WORD(holiday)
|
||||
MAKE_PSTR_WORD(reduce)
|
||||
MAKE_PSTR_WORD(noreduce)
|
||||
MAKE_PSTR_WORD(offset)
|
||||
MAKE_PSTR_WORD(design)
|
||||
MAKE_PSTR_WORD(tempauto)
|
||||
MAKE_PSTR_WORD(minflow)
|
||||
MAKE_PSTR_WORD(maxflow)
|
||||
MAKE_PSTR_WORD(rc3x)
|
||||
MAKE_PSTR_WORD(rc20)
|
||||
|
||||
MAKE_PSTR(internal_temperature, "internal temperature")
|
||||
MAKE_PSTR(internal_setpoint, "internal setpoint")
|
||||
MAKE_PSTR(external_temperature, "external temperature")
|
||||
MAKE_PSTR(burner_temperature, "burner temperature")
|
||||
MAKE_PSTR(ww_temperature, "ww temperature")
|
||||
MAKE_PSTR(functioning_mode, "functioning mode")
|
||||
MAKE_PSTR(smoke_temperature, "smoke temperature")
|
||||
|
||||
// thermostat lists
|
||||
MAKE_PSTR_LIST(tpl_datetime, F("Format: < NTP | dd.mm.yyyy-hh:mm:ss-day(0-6)-dst(0/1) >"))
|
||||
MAKE_PSTR_LIST(tpl_switchtime, F("Format: <nn> [ not_set | day hh:mm on|off ]"))
|
||||
MAKE_PSTR_LIST(tpl_switchtime1, F("Format: <nn> [ not_set | day hh:mm Tn ]"))
|
||||
MAKE_PSTR_LIST(tpl_holidays, F("format: < dd.mm.yyyy-dd.mm.yyyy >"))
|
||||
MAKE_PSTR_LIST(enum_ibaMainDisplay,
|
||||
F_(internal_temperature),
|
||||
F_(internal_setpoint),
|
||||
F_(external_temperature),
|
||||
F_(burner_temperature),
|
||||
F_(ww_temperature),
|
||||
F_(functioning_mode),
|
||||
F_(time),
|
||||
F_(date),
|
||||
F_(smoke_temperature))
|
||||
MAKE_PSTR_LIST(enum_ibaLanguage, F_(german), F_(dutch), F_(french), F_(italian))
|
||||
MAKE_PSTR_LIST(enum_ibaLanguage_RC30, F_(german), F_(dutch))
|
||||
MAKE_PSTR_LIST(enum_floordrystatus, F_(off), F_(start), F_(heat), F_(hold), F_(cool), F_(end))
|
||||
MAKE_PSTR_LIST(enum_ibaBuildingType, F_(light), F_(medium), F_(heavy))
|
||||
MAKE_PSTR_LIST(enum_PID, F("fast"), F_(medium), F("slow"))
|
||||
MAKE_PSTR_LIST(enum_wwMode, F_(off), F("normal"), F_(comfort), F_(auto), F_(own_prog), F_(eco))
|
||||
MAKE_PSTR_LIST(enum_wwCircMode, F_(off), F_(on), F_(auto), F_(own_prog))
|
||||
MAKE_PSTR_LIST(enum_wwMode2, F_(off), F_(on), F_(auto))
|
||||
MAKE_PSTR_LIST(enum_wwMode3, F_(on), F_(off), F_(auto))
|
||||
MAKE_PSTR_LIST(enum_heatingtype, F_(off), F_(radiator), F_(convector), F_(floor))
|
||||
MAKE_PSTR_LIST(enum_summermode, F_(summer), F_(auto), F_(winter))
|
||||
MAKE_PSTR_LIST(enum_hpoperatingmode, F_(off), F_(auto), F_(heating), F_(cooling))
|
||||
MAKE_PSTR_LIST(enum_summer, F_(winter), F_(summer))
|
||||
MAKE_PSTR_LIST(enum_operatingstate, F_(heating), F_(off), F_(cooling))
|
||||
|
||||
MAKE_PSTR_LIST(enum_mode, F_(manual), F_(auto)) // RC100, RC300, RC310
|
||||
MAKE_PSTR_LIST(enum_mode2, F_(off), F_(manual), F_(auto)) // RC20
|
||||
MAKE_PSTR_LIST(enum_mode3, F_(night), F_(day), F_(auto)) // RC35, RC30, RC25
|
||||
MAKE_PSTR_LIST(enum_mode4, F_(nofrost), F_(eco), F_(heat), F_(auto)) // JUNKERS
|
||||
MAKE_PSTR_LIST(enum_mode5, F_(auto), F_(off)) // CRF
|
||||
MAKE_PSTR_LIST(enum_mode6, F_(nofrost), F_(night), F_(day)) // RC10
|
||||
|
||||
MAKE_PSTR_LIST(enum_modetype, F_(eco), F_(comfort))
|
||||
// MAKE_PSTR_LIST(enum_modetype2, F_(day))
|
||||
MAKE_PSTR_LIST(enum_modetype3, F_(night), F_(day))
|
||||
MAKE_PSTR_LIST(enum_modetype4, F_(nofrost), F_(eco), F_(heat))
|
||||
MAKE_PSTR_LIST(enum_modetype5, F_(off), F_(on))
|
||||
|
||||
MAKE_PSTR_LIST(enum_reducemode, F_(nofrost), F_(reduce), F_(room), F_(outdoor))
|
||||
MAKE_PSTR_LIST(enum_reducemode1, F_(outdoor), F_(room), F_(reduce)) // RC310 values: 1-3
|
||||
MAKE_PSTR_LIST(enum_nofrostmode, F_(off), F_(room), F_(outdoor))
|
||||
MAKE_PSTR_LIST(enum_nofrostmode1, F_(room), F_(outdoor), F_(room_outdoor))
|
||||
|
||||
MAKE_PSTR_LIST(enum_controlmode, F_(off), F_(optimized), F_(simple), F_(mpc), F_(room), F_(power), F_(constant))
|
||||
MAKE_PSTR_LIST(enum_controlmode1, F("weather-compensated"), F("outside-basepoint"), F("n/a"), F_(room)) // RC310 1-4
|
||||
MAKE_PSTR_LIST(enum_controlmode2, F_(outdoor), F_(room))
|
||||
// MAKE_PSTR_LIST(enum_controlmode3, F_(off), F_(room), F_(outdoor), F("room+outdoor"))
|
||||
MAKE_PSTR_LIST(enum_control, F_(off), F_(rc20), F_(rc3x))
|
||||
MAKE_PSTR_LIST(enum_j_control, F_(off), F("fb10"), F("fb100"))
|
||||
|
||||
MAKE_PSTR_LIST(enum_wwProgMode, F("std_prog"), F_(own_prog))
|
||||
MAKE_PSTR_LIST(enum_dayOfWeek, F("mo"), F("tu"), F("we"), F("th"), F("fr"), F("sa"), F("su"), F("all"))
|
||||
MAKE_PSTR_LIST(enum_progMode, F("prog_1"), F("prog_2"))
|
||||
MAKE_PSTR_LIST(enum_progMode2, F("own_1"), F("family"), F("morning"), F("evening"), F("am"), F("pm"), F("midday"), F("singles"), F("seniors"), F("new"), F("own_2"))
|
||||
MAKE_PSTR_LIST(enum_progMode3, F("family"), F("morning"), F("evening"), F("am"), F("pm"), F("midday"), F("singles"), F("seniors"))
|
||||
MAKE_PSTR_LIST(enum_progMode4, F("prog_a"), F("prog_b"), F("prog_c"), F("prog_d"), F("prog_e"), F("prog_f"))
|
||||
|
||||
MAKE_PSTR_LIST(enum_switchmode, F_(off), F_(eco), F_(comfort), F_(heat))
|
||||
MAKE_PSTR_LIST(enum_climate, F("selTemp"), F("roomTemp"))
|
||||
|
||||
// solar list
|
||||
MAKE_PSTR_LIST(enum_solarmode, F_(constant), F("pwm"), F("analog"))
|
||||
MAKE_PSTR_LIST(enum_collectortype, F("flat"), F("vacuum"))
|
||||
MAKE_PSTR_LIST(enum_cylprio, F("cyl_1"), F("cyl_2"))
|
||||
|
||||
// id used to store the device ID. empty full name so only gets displayed in the MQTT payload
|
||||
MAKE_PSTR_LIST(ID, F_(id))
|
||||
|
||||
// Boiler
|
||||
// extra commands, with no json output
|
||||
MAKE_PSTR_LIST(wwtapactivated, F("wwtapactivated"), F("turn on/off"))
|
||||
MAKE_PSTR_LIST(reset, F("reset"), F("reset"))
|
||||
|
||||
// single mqtt topics
|
||||
MAKE_PSTR_WORD(heating_active)
|
||||
MAKE_PSTR_WORD(tapwater_active)
|
||||
MAKE_PSTR_WORD(response)
|
||||
|
||||
// mqtt, commands and text
|
||||
MAKE_PSTR_LIST(heatingActive, F("heatingactive"), F("heating active"))
|
||||
MAKE_PSTR_LIST(tapwaterActive, F("tapwateractive"), F("tapwater active"))
|
||||
MAKE_PSTR_LIST(selFlowTemp, F("selflowtemp"), F("selected flow temperature"))
|
||||
MAKE_PSTR_LIST(selBurnPow, F("selburnpow"), F("burner selected max power"))
|
||||
MAKE_PSTR_LIST(heatingPumpMod, F("heatingpumpmod"), F("heating pump modulation"))
|
||||
MAKE_PSTR_LIST(heatingPump2Mod, F("heatingpump2mod"), F("heating pump 2 modulation"))
|
||||
MAKE_PSTR_LIST(outdoorTemp, F("outdoortemp"), F("outside temperature"))
|
||||
MAKE_PSTR_LIST(curFlowTemp, F("curflowtemp"), F("current flow temperature"))
|
||||
MAKE_PSTR_LIST(retTemp, F("rettemp"), F("return temperature"))
|
||||
MAKE_PSTR_LIST(switchTemp, F("switchtemp"), F("mixing switch temperature"))
|
||||
MAKE_PSTR_LIST(sysPress, F("syspress"), F("system pressure"))
|
||||
MAKE_PSTR_LIST(boilTemp, F("boiltemp"), F("actual boiler temperature"))
|
||||
MAKE_PSTR_LIST(exhaustTemp, F("exhausttemp"), F("exhaust temperature"))
|
||||
MAKE_PSTR_LIST(burnGas, F("burngas"), F("gas"))
|
||||
MAKE_PSTR_LIST(burnGas2, F("burngas2"), F("gas stage 2"))
|
||||
MAKE_PSTR_LIST(flameCurr, F("flamecurr"), F("flame current"))
|
||||
MAKE_PSTR_LIST(heatingPump, F("heatingpump"), F("heating pump"))
|
||||
MAKE_PSTR_LIST(fanWork, F("fanwork"), F("fan"))
|
||||
MAKE_PSTR_LIST(ignWork, F("ignwork"), F("ignition"))
|
||||
MAKE_PSTR_LIST(oilPreHeat, F("oilpreheat"), F("oil preheating"))
|
||||
MAKE_PSTR_LIST(heatingActivated, F("heatingactivated"), F("heating activated"))
|
||||
MAKE_PSTR_LIST(heatingTemp, F("heatingtemp"), F("heating temperature"))
|
||||
MAKE_PSTR_LIST(pumpModMax, F("pumpmodmax"), F("burner pump max power"))
|
||||
MAKE_PSTR_LIST(pumpModMin, F("pumpmodmin"), F("burner pump min power"))
|
||||
MAKE_PSTR_LIST(pumpDelay, F("pumpdelay"), F("pump delay"))
|
||||
MAKE_PSTR_LIST(burnMinPeriod, F("burnminperiod"), F("burner min period"))
|
||||
MAKE_PSTR_LIST(burnMinPower, F("burnminpower"), F("burner min power"))
|
||||
MAKE_PSTR_LIST(burnMaxPower, F("burnmaxpower"), F("burner max power"))
|
||||
MAKE_PSTR_LIST(boilHystOn, F("boilhyston"), F("hysteresis on temperature"))
|
||||
MAKE_PSTR_LIST(boilHystOff, F("boilhystoff"), F("hysteresis off temperature"))
|
||||
MAKE_PSTR_LIST(setFlowTemp, F("setflowtemp"), F("set flow temperature"))
|
||||
MAKE_PSTR_LIST(setBurnPow, F("setburnpow"), F("burner set power"))
|
||||
MAKE_PSTR_LIST(curBurnPow, F("curburnpow"), F("burner current power"))
|
||||
MAKE_PSTR_LIST(burnStarts, F("burnstarts"), F("burner starts"))
|
||||
MAKE_PSTR_LIST(burnWorkMin, F("burnworkmin"), F("total burner operating time"))
|
||||
MAKE_PSTR_LIST(burn2WorkMin, F("burn2workmin"), F("burner stage 2 operating time"))
|
||||
MAKE_PSTR_LIST(heatWorkMin, F("heatworkmin"), F("total heat operating time"))
|
||||
MAKE_PSTR_LIST(UBAuptime, F("ubauptime"), F("total UBA operating time"))
|
||||
MAKE_PSTR_LIST(lastCode, F("lastcode"), F("last error code"))
|
||||
MAKE_PSTR_LIST(serviceCode, F("servicecode"), F("service code"))
|
||||
MAKE_PSTR_LIST(serviceCodeNumber, F("servicecodenumber"), F("service code number"))
|
||||
MAKE_PSTR_LIST(maintenanceMessage, F("maintenancemessage"), F("maintenance message"))
|
||||
MAKE_PSTR_LIST(maintenanceDate, F("maintenancedate"), F("next maintenance date"))
|
||||
MAKE_PSTR_LIST(maintenanceType, F_(maintenance), F("maintenance scheduled"))
|
||||
MAKE_PSTR_LIST(maintenanceTime, F("maintenancetime"), F("time to next maintenance"))
|
||||
MAKE_PSTR_LIST(emergencyOps, F("emergencyops"), F("emergency operation"))
|
||||
MAKE_PSTR_LIST(emergencyTemp, F("emergencytemp"), F("emergency temperature"))
|
||||
|
||||
// heatpump/compress specific
|
||||
MAKE_PSTR_LIST(upTimeControl, F("uptimecontrol"), F("total operating time heat"))
|
||||
MAKE_PSTR_LIST(upTimeCompHeating, F("uptimecompheating"), F("operating time compressor heating"))
|
||||
MAKE_PSTR_LIST(upTimeCompCooling, F("uptimecompcooling"), F("operating time compressor cooling"))
|
||||
MAKE_PSTR_LIST(upTimeCompWw, F("uptimecompww"), F("operating time compressor dhw"))
|
||||
MAKE_PSTR_LIST(upTimeCompPool, F("uptimecomppool"), F("operating time compressor pool"))
|
||||
MAKE_PSTR_LIST(totalCompStarts, F("totalcompstarts"), F("total compressor control starts"))
|
||||
MAKE_PSTR_LIST(heatingStarts, F("heatingstarts"), F("heating control starts"))
|
||||
MAKE_PSTR_LIST(coolingStarts, F("coolingstarts"), F("cooling control starts"))
|
||||
MAKE_PSTR_LIST(poolStarts, F("poolstarts"), F("pool control starts"))
|
||||
MAKE_PSTR_LIST(nrgConsTotal, F("nrgconstotal"), F("total energy consumption"))
|
||||
MAKE_PSTR_LIST(nrgConsCompTotal, F("nrgconscomptotal"), F("total energy consumption compressor"))
|
||||
MAKE_PSTR_LIST(nrgConsCompHeating, F("nrgconscompheating"), F("energy consumption compressor heating"))
|
||||
MAKE_PSTR_LIST(nrgConsCompWw, F("nrgconscompww"), F("energy consumption compressor dhw"))
|
||||
MAKE_PSTR_LIST(nrgConsCompCooling, F("nrgconscompcooling"), F("energy consumption compressor cooling"))
|
||||
MAKE_PSTR_LIST(nrgConsCompPool, F("nrgconscomppool"), F("energy consumption compressor pool"))
|
||||
MAKE_PSTR_LIST(nrgSuppTotal, F("nrgsupptotal"), F("total energy supplied"))
|
||||
MAKE_PSTR_LIST(nrgSuppHeating, F("nrgsuppheating"), F("total energy supplied heating"))
|
||||
MAKE_PSTR_LIST(nrgSuppWw, F("nrgsuppww"), F("total energy warm supplied dhw"))
|
||||
MAKE_PSTR_LIST(nrgSuppCooling, F("nrgsuppcooling"), F("total energy supplied cooling"))
|
||||
MAKE_PSTR_LIST(nrgSuppPool, F("nrgsupppool"), F("total energy supplied pool"))
|
||||
MAKE_PSTR_LIST(auxElecHeatNrgConsTotal, F("auxelecheatnrgconstotal"), F("total auxiliary electrical heater energy consumption"))
|
||||
MAKE_PSTR_LIST(auxElecHeatNrgConsHeating, F("auxelecheatnrgconsheating"), F("auxiliary electrical heater energy consumption heating"))
|
||||
MAKE_PSTR_LIST(auxElecHeatNrgConsWW, F("auxelecheatnrgconsww"), F("auxiliary electrical heater energy consumption dhw"))
|
||||
MAKE_PSTR_LIST(auxElecHeatNrgConsPool, F("auxelecheatnrgconspool"), F("auxiliary electrical heater energy consumption pool"))
|
||||
|
||||
MAKE_PSTR_LIST(hpPower, F("hppower"), F("compressor power output"))
|
||||
MAKE_PSTR_LIST(hpCompOn, F("hpcompon"), F("hp compressor"))
|
||||
MAKE_PSTR_LIST(hpHeatingOn, F("hpheatingon"), F("hp heating"))
|
||||
MAKE_PSTR_LIST(hpCoolingOn, F("hpcoolingon"), F("hp cooling"))
|
||||
MAKE_PSTR_LIST(hpWwOn, F("hpwwon"), F("hp dhw"))
|
||||
MAKE_PSTR_LIST(hpPoolOn, F("hppoolon"), F("hp pool"))
|
||||
MAKE_PSTR_LIST(hpBrinePumpSpd, F("hpbrinepumpspd"), F("brine pump speed"))
|
||||
MAKE_PSTR_LIST(hpCompSpd, F("hpcompspd"), F("compressor speed"))
|
||||
MAKE_PSTR_LIST(hpCircSpd, F("hpcircspd"), F("circulation pump speed"))
|
||||
MAKE_PSTR_LIST(hpBrineIn, F("hpbrinein"), F("brine in/evaporator"))
|
||||
MAKE_PSTR_LIST(hpBrineOut, F("hpbrineout"), F("brine out/condenser"))
|
||||
MAKE_PSTR_LIST(hpSuctionGas, F("hpsuctiongas"), F("suction gas"))
|
||||
MAKE_PSTR_LIST(hpHotGas, F("hphotgas"), F("hot gas/compressed"))
|
||||
MAKE_PSTR_LIST(hpSwitchValve, F("hpswitchvalve"), F("switch valve"))
|
||||
MAKE_PSTR_LIST(hpActivity, F("hpactivity"), F("compressor activity"))
|
||||
MAKE_PSTR_LIST(hpTc0, F("hptc0"), F("heat carrier return (TC0)"))
|
||||
MAKE_PSTR_LIST(hpTc1, F("hptc1"), F("heat carrier forward (TC1)"))
|
||||
MAKE_PSTR_LIST(hpTc3, F("hptc3"), F("condenser temperature (TC3)"))
|
||||
MAKE_PSTR_LIST(hpTr3, F("hptr3"), F("refrigerant temperature liquid side (condenser output) (TR3)"))
|
||||
MAKE_PSTR_LIST(hpTr4, F("hptr4"), F("evaporator inlet temperature (TR4)"))
|
||||
MAKE_PSTR_LIST(hpTr5, F("hptr5"), F("compressor Inlet temperature (TR5)"))
|
||||
MAKE_PSTR_LIST(hpTr6, F("hptr6"), F("compressor outlet temperature (TR6)"))
|
||||
MAKE_PSTR_LIST(hpTr7, F("hptr7"), F("refrigerant temperature gas side (condenser input) (TR7)"))
|
||||
MAKE_PSTR_LIST(hpTl2, F("hptl2"), F("air inlet temperature (TL2)"))
|
||||
MAKE_PSTR_LIST(hpPl1, F("hppl1"), F("low pressure side temperature (PL1)"))
|
||||
MAKE_PSTR_LIST(hpPh1, F("hpph1"), F("high pressure side temperature (PH1)"))
|
||||
|
||||
// hybrid heatpump
|
||||
MAKE_PSTR_LIST(enum_hybridStrategy, F("co2-optimized"), F("cost-optimized"), F("outside-temp-switched"), F("co2-cost-mix"))
|
||||
MAKE_PSTR_LIST(hybridStrategy, F("hybridstrategy"), F("hybrid control strategy"))
|
||||
MAKE_PSTR_LIST(switchOverTemp, F("switchovertemp"), F("outside switchover temperature"))
|
||||
MAKE_PSTR_LIST(energyCostRatio, F("energycostratio"), F("energy cost ratio"))
|
||||
MAKE_PSTR_LIST(fossileFactor, F("fossilefactor"), F("fossile energy factor"))
|
||||
MAKE_PSTR_LIST(electricFactor, F("electricfactor"), F("electric energy factor"))
|
||||
MAKE_PSTR_LIST(delayBoiler, F("delayboiler"), F("delay boiler support"))
|
||||
MAKE_PSTR_LIST(tempDiffBoiler, F("tempdiffboiler"), F("tempediff boiler support"))
|
||||
|
||||
// alternative heatsource AM200
|
||||
MAKE_PSTR_LIST(aCylTopTemp, F("cyltoptemp"), F("cylinder top temperature"))
|
||||
MAKE_PSTR_LIST(aCylCenterTemp, F("cylcentertemp"), F("cylinder center temperature"))
|
||||
MAKE_PSTR_LIST(aCylBottomTemp, F("cylbottomtemp"), F("cylinder bottom temperature"))
|
||||
MAKE_PSTR_LIST(aFlowTemp, F("altflowtemp"), F("alternative hs flow temperature"))
|
||||
MAKE_PSTR_LIST(aRetTemp, F("altrettemp"), F("alternative hs return temperature"))
|
||||
MAKE_PSTR_LIST(sysFlowTemp, F("sysflowtemp"), F("system flow temperature"))
|
||||
MAKE_PSTR_LIST(sysRetTemp, F("sysrettemp"), F("system return temperature"))
|
||||
MAKE_PSTR_LIST(valveByPass, F("valvebypass"), F("bypass valve"))
|
||||
MAKE_PSTR_LIST(valveBuffer, F("valvebuffer"), F("buffer valve"))
|
||||
MAKE_PSTR_LIST(valveReturn, F("valvereturn"), F("return valve"))
|
||||
MAKE_PSTR_LIST(aPumpMod, F("altpumpmod"), F("alternative hs pump modulation"))
|
||||
MAKE_PSTR_LIST(heatSource, F("heatsource"), F("alternative heating active"))
|
||||
|
||||
MAKE_PSTR_LIST(vr2Config, F("vr2config"), F("vr2 configuration"))
|
||||
MAKE_PSTR_LIST(ahsActivated, F("ahsactivated"), F("alternate heat source activation"))
|
||||
MAKE_PSTR_LIST(aPumpConfig, F("apumpconfig"), F("primary pump config"))
|
||||
MAKE_PSTR_LIST(aPumpSignal, F("apumpsignal"), F("output for pr1 pump"))
|
||||
MAKE_PSTR_LIST(aPumpMin, F("apumpmin"), F("min output pump pr1"))
|
||||
MAKE_PSTR_LIST(tempRise, F("temprise"), F("ahs return temp rise"))
|
||||
MAKE_PSTR_LIST(setReturnTemp, F("setreturntemp"), F("set temp return"))
|
||||
MAKE_PSTR_LIST(mixRuntime, F("mixruntime"), F("mixer run time"))
|
||||
// MAKE_PSTR_LIST(setFlowTemp, F("setflowtemp"), F("set flow temp"))
|
||||
MAKE_PSTR_LIST(bufBypass, F("bufbypass"), F("buffer bypass config"))
|
||||
MAKE_PSTR_LIST(bufMixRuntime, F("bufmixruntime"), F("bypass mixer run time"))
|
||||
MAKE_PSTR_LIST(bufConfig, F("bufconfig"), F("dhw buffer config"))
|
||||
MAKE_PSTR_LIST(blockMode, F("blockmode"), F("config htg. blocking mode"))
|
||||
MAKE_PSTR_LIST(blockTerm, F("blockterm"), F("config of block terminal"))
|
||||
MAKE_PSTR_LIST(blockHyst, F("blockhyst"), F("hyst. for bolier block"))
|
||||
MAKE_PSTR_LIST(releaseWait, F("releasewait"), F("boiler release wait time"))
|
||||
|
||||
// the following are dhw for the boiler and automatically tagged with 'ww'
|
||||
MAKE_PSTR_LIST(wwSelTemp, F("wwseltemp"), F("selected temperature"))
|
||||
MAKE_PSTR_LIST(wwSelTempLow, F("wwseltemplow"), F("selected lower temperature"))
|
||||
MAKE_PSTR_LIST(wwSelTempOff, F("wwseltempoff"), F("selected temperature for off"))
|
||||
MAKE_PSTR_LIST(wwSelTempSingle, F("wwseltempsingle"), F("single charge temperature"))
|
||||
MAKE_PSTR_LIST(wwSetTemp, F("wwsettemp"), F("set temperature"))
|
||||
MAKE_PSTR_LIST(wwType, F("wwtype"), F("type"))
|
||||
MAKE_PSTR_LIST(wwComfort, F("wwcomfort"), F("comfort"))
|
||||
MAKE_PSTR_LIST(wwComfort1, F("wwcomfort1"), F("comfort mode"))
|
||||
MAKE_PSTR_LIST(wwFlowTempOffset, F("wwflowtempoffset"), F("flow temperature offset"))
|
||||
MAKE_PSTR_LIST(wwMaxPower, F("wwmaxpower"), F("max power"))
|
||||
MAKE_PSTR_LIST(wwCircPump, F("wwcircpump"), F("circulation pump available"))
|
||||
MAKE_PSTR_LIST(wwChargeType, F("wwchargetype"), F("charging type"))
|
||||
MAKE_PSTR_LIST(wwDisinfectionTemp, F("wwdisinfectiontemp"), F("disinfection temperature"))
|
||||
MAKE_PSTR_LIST(wwCircMode, F("wwcircmode"), F("circulation pump mode")) // also used in thermostat
|
||||
MAKE_PSTR_LIST(wwCirc, F("wwcirc"), F("circulation active"))
|
||||
MAKE_PSTR_LIST(wwCurTemp, F("wwcurtemp"), F("current intern temperature"))
|
||||
MAKE_PSTR_LIST(wwCurTemp2, F("wwcurtemp2"), F("current extern temperature"))
|
||||
MAKE_PSTR_LIST(wwCurFlow, F("wwcurflow"), F("current tap water flow"))
|
||||
MAKE_PSTR_LIST(wwStorageTemp1, F("wwstoragetemp1"), F("storage intern temperature"))
|
||||
MAKE_PSTR_LIST(wwStorageTemp2, F("wwstoragetemp2"), F("storage extern temperature"))
|
||||
MAKE_PSTR_LIST(wwActivated, F("wwactivated"), F("activated"))
|
||||
MAKE_PSTR_LIST(wwOneTime, F("wwonetime"), F("one time charging"))
|
||||
MAKE_PSTR_LIST(wwDisinfecting, F("wwdisinfecting"), F("disinfecting"))
|
||||
MAKE_PSTR_LIST(wwCharging, F("wwcharging"), F("charging"))
|
||||
MAKE_PSTR_LIST(wwChargeOptimization, F("wwchargeoptimization"), F("charge optimization"))
|
||||
MAKE_PSTR_LIST(wwRecharging, F("wwrecharging"), F("recharging"))
|
||||
MAKE_PSTR_LIST(wwTempOK, F("wwtempok"), F("temperature ok"))
|
||||
MAKE_PSTR_LIST(wwActive, F("wwactive"), F("active"))
|
||||
MAKE_PSTR_LIST(ww3wayValve, F("ww3wayvalve"), F("3way valve active"))
|
||||
MAKE_PSTR_LIST(wwSetPumpPower, F("wwsetpumppower"), F("set pump power"))
|
||||
MAKE_PSTR_LIST(wwMixerTemp, F("wwmixertemp"), F("mixer temperature"))
|
||||
MAKE_PSTR_LIST(wwCylMiddleTemp, F("wwcylmiddletemp"), F("cylinder middle temperature (TS3)"))
|
||||
MAKE_PSTR_LIST(wwStarts, F("wwstarts"), F("starts"))
|
||||
MAKE_PSTR_LIST(wwStarts2, F("wwstarts2"), F("control starts2"))
|
||||
MAKE_PSTR_LIST(wwWorkM, F("wwworkm"), F("active time"))
|
||||
MAKE_PSTR_LIST(wwHystOn, F("wwhyston"), F("hysteresis on temperature"))
|
||||
MAKE_PSTR_LIST(wwHystOff, F("wwhystoff"), F("hysteresis off temperature"))
|
||||
MAKE_PSTR_LIST(wwProgMode, F("wwprogmode"), F("program"))
|
||||
MAKE_PSTR_LIST(wwCircProg, F("wwcircprog"), F("circulation program"))
|
||||
MAKE_PSTR_LIST(wwMaxTemp, F("wwmaxtemp"), F("maximum temperature"))
|
||||
MAKE_PSTR_LIST(wwOneTimeKey, F("wwonetimekey"), F("one time key function"))
|
||||
|
||||
// mqtt values / commands
|
||||
MAKE_PSTR_LIST(switchtime, F("switchtime"), F("program switchtime"))
|
||||
MAKE_PSTR_LIST(switchtime1, F("switchtime1"), F("own1 program switchtime"))
|
||||
MAKE_PSTR_LIST(switchtime2, F("switchtime2"), F("own2 program switchtime"))
|
||||
MAKE_PSTR_LIST(wwswitchtime, F("wwswitchtime"), F("program switchtime"))
|
||||
MAKE_PSTR_LIST(wwcircswitchtime, F("wwcircswitchtime"), F("circulation program switchtime"))
|
||||
MAKE_PSTR_LIST(dateTime, F("datetime"), F("date/time"))
|
||||
MAKE_PSTR_LIST(errorCode, F("errorcode"), F("error code"))
|
||||
MAKE_PSTR_LIST(ibaMainDisplay, F("display"), F("display"))
|
||||
MAKE_PSTR_LIST(ibaLanguage, F("language"), F("language"))
|
||||
MAKE_PSTR_LIST(ibaClockOffset, F("clockoffset"), F("clock offset"))
|
||||
MAKE_PSTR_LIST(ibaBuildingType, F("building"), F("building type"))
|
||||
MAKE_PSTR_LIST(heatingPID, F("heatingpid"), F("heating PID"))
|
||||
MAKE_PSTR_LIST(ibaCalIntTemperature, F("intoffset"), F("internal temperature offset"))
|
||||
MAKE_PSTR_LIST(ibaMinExtTemperature, F("minexttemp"), F("minimal external temperature"))
|
||||
MAKE_PSTR_LIST(backlight, F("backlight"), F("key backlight"))
|
||||
MAKE_PSTR_LIST(damping, F("damping"), F("damping outdoor temperature"))
|
||||
MAKE_PSTR_LIST(tempsensor1, F("inttemp1"), F("temperature sensor 1"))
|
||||
MAKE_PSTR_LIST(tempsensor2, F("inttemp2"), F("temperature sensor 2"))
|
||||
MAKE_PSTR_LIST(dampedoutdoortemp, F("dampedoutdoortemp"), F("damped outdoor temperature"))
|
||||
MAKE_PSTR_LIST(floordrystatus, F("floordry"), F("floor drying"))
|
||||
MAKE_PSTR_LIST(floordrytemp, F("floordrytemp"), F("floor drying temperature"))
|
||||
MAKE_PSTR_LIST(brightness, F("brightness"), F("screen brightness"))
|
||||
MAKE_PSTR_LIST(autodst, F("autodst"), F("automatic change daylight saving time"))
|
||||
MAKE_PSTR_LIST(preheating, F("preheating"), F("preheating in the clock program"))
|
||||
MAKE_PSTR_LIST(offtemp, F("offtemp"), F("temperature when mode is off"))
|
||||
MAKE_PSTR_LIST(mixingvalves, F("mixingvalves"), F("mixing valves"))
|
||||
// thermostat ww
|
||||
MAKE_PSTR_LIST(wwMode, F("wwmode"), F("mode"))
|
||||
MAKE_PSTR_LIST(wwSetTempLow, F("wwsettemplow"), F("set low temperature"))
|
||||
MAKE_PSTR_LIST(wwCharge, F("wwcharge"), F("charge"))
|
||||
MAKE_PSTR_LIST(wwChargeDuration, F("wwchargeduration"), F("charge duration"))
|
||||
MAKE_PSTR_LIST(wwDisinfect, F("wwdisinfect"), F("disinfection"))
|
||||
MAKE_PSTR_LIST(wwDisinfectDay, F("wwdisinfectday"), F("disinfection day"))
|
||||
MAKE_PSTR_LIST(wwDisinfectHour, F("wwdisinfecthour"), F("disinfection hour"))
|
||||
MAKE_PSTR_LIST(wwDisinfectTime, F("wwdisinfecttime"), F("disinfection time"))
|
||||
MAKE_PSTR_LIST(wwExtra1, F("wwextra1"), F("circuit 1 extra"))
|
||||
MAKE_PSTR_LIST(wwExtra2, F("wwextra2"), F("circuit 2 extra"))
|
||||
MAKE_PSTR_LIST(wwDailyHeating, F("wwdailyheating"), F("daily heating"))
|
||||
MAKE_PSTR_LIST(wwDailyHeatTime, F("wwdailyheattime"), F("daily heating time"))
|
||||
MAKE_PSTR_LIST(wwWhenModeOff, F("wwwhenmodeoff"), F("when thermostat mode off"))
|
||||
// thermostat hc
|
||||
MAKE_PSTR_LIST(climate, F("HA climate config creation")) // no full-name, hidden, only for creation
|
||||
MAKE_PSTR_LIST(selRoomTemp, F("seltemp"), F("selected room temperature"))
|
||||
MAKE_PSTR_LIST(roomTemp, F("currtemp"), F("current room temperature"))
|
||||
MAKE_PSTR_LIST(mode, F("mode"), F("mode"))
|
||||
MAKE_PSTR_LIST(modetype, F("modetype"), F("mode type"))
|
||||
MAKE_PSTR_LIST(fastheatup, F("fastheatup"), F("fast heatup"))
|
||||
MAKE_PSTR_LIST(daytemp, F("daytemp"), F("day temperature"))
|
||||
MAKE_PSTR_LIST(daylowtemp, F("daytemp2"), F("day temperature T2"))
|
||||
MAKE_PSTR_LIST(daymidtemp, F("daytemp3"), F("day temperature T3"))
|
||||
MAKE_PSTR_LIST(dayhightemp, F("daytemp4"), F("day temperature T4"))
|
||||
MAKE_PSTR_LIST(heattemp, F("heattemp"), F("heat temperature"))
|
||||
MAKE_PSTR_LIST(nighttemp, F("nighttemp"), F("night temperature"))
|
||||
MAKE_PSTR_LIST(nighttemp2, F("nighttemp"), F("night temperature T1"))
|
||||
MAKE_PSTR_LIST(ecotemp, F("ecotemp"), F("eco temperature"))
|
||||
MAKE_PSTR_LIST(manualtemp, F("manualtemp"), F("manual temperature"))
|
||||
MAKE_PSTR_LIST(tempautotemp, F("tempautotemp"), F("temporary set temperature automode"))
|
||||
MAKE_PSTR_LIST(remoteseltemp, F("remoteseltemp"), F("temporary set temperature from remote"))
|
||||
MAKE_PSTR_LIST(comforttemp, F("comforttemp"), F("comfort temperature"))
|
||||
MAKE_PSTR_LIST(summertemp, F("summertemp"), F("summer temperature"))
|
||||
MAKE_PSTR_LIST(designtemp, F("designtemp"), F("design temperature"))
|
||||
MAKE_PSTR_LIST(offsettemp, F("offsettemp"), F("offset temperature"))
|
||||
MAKE_PSTR_LIST(minflowtemp, F("minflowtemp"), F("min flow temperature"))
|
||||
MAKE_PSTR_LIST(maxflowtemp, F("maxflowtemp"), F("max flow temperature"))
|
||||
MAKE_PSTR_LIST(roominfluence, F("roominfluence"), F("room influence"))
|
||||
MAKE_PSTR_LIST(roominfl_factor, F("roominflfactor"), F("room influence factor"))
|
||||
MAKE_PSTR_LIST(curroominfl, F("curroominfl"), F("current room influence"))
|
||||
MAKE_PSTR_LIST(nofrosttemp, F("nofrosttemp"), F("nofrost temperature"))
|
||||
MAKE_PSTR_LIST(targetflowtemp, F("targetflowtemp"), F("target flow temperature"))
|
||||
MAKE_PSTR_LIST(heatingtype, F("heatingtype"), F("heating type"))
|
||||
MAKE_PSTR_LIST(summersetmode, F("summersetmode"), F("set summer mode"))
|
||||
MAKE_PSTR_LIST(hpoperatingmode, F("hpoperatingmode"), F("heatpump operating mode"))
|
||||
MAKE_PSTR_LIST(hpoperatingstate, F("hpoperatingstate"), F("heatpump operating state"))
|
||||
MAKE_PSTR_LIST(controlmode, F("controlmode"), F("control mode"))
|
||||
MAKE_PSTR_LIST(control, F("control"), F("control device"))
|
||||
MAKE_PSTR_LIST(wwHolidays, F("wwholidays"), F("holiday dates"))
|
||||
MAKE_PSTR_LIST(wwVacations, F("wwvacations"), F("vacation dates"))
|
||||
MAKE_PSTR_LIST(holidays, F("holidays"), F("holiday dates"))
|
||||
MAKE_PSTR_LIST(vacations, F("vacations"), F("vacation dates"))
|
||||
MAKE_PSTR_LIST(program, F("program"), F("program"))
|
||||
MAKE_PSTR_LIST(pause, F("pause"), F("pause time"))
|
||||
MAKE_PSTR_LIST(party, F("party"), F("party time"))
|
||||
MAKE_PSTR_LIST(wwprio, F("wwprio"), F("dhw priority"))
|
||||
MAKE_PSTR_LIST(holidaytemp, F("holidaytemp"), F("holiday temperature"))
|
||||
MAKE_PSTR_LIST(summermode, F("summermode"), F("summer mode"))
|
||||
MAKE_PSTR_LIST(holidaymode, F("holidaymode"), F("holiday mode"))
|
||||
MAKE_PSTR_LIST(flowtempoffset, F("flowtempoffset"), F("flow temperature offset for mixer"))
|
||||
MAKE_PSTR_LIST(reducemode, F("reducemode"), F("reduce mode"))
|
||||
MAKE_PSTR_LIST(noreducetemp, F("noreducetemp"), F("no reduce below temperature"))
|
||||
MAKE_PSTR_LIST(reducetemp, F("reducetemp"), F("off/reduce switch temperature"))
|
||||
MAKE_PSTR_LIST(vacreducetemp, F("vacreducetemp"), F("vacations off/reduce switch temperature"))
|
||||
MAKE_PSTR_LIST(vacreducemode, F("vacreducemode"), F("vacations reduce mode"))
|
||||
MAKE_PSTR_LIST(nofrostmode, F("nofrostmode"), F("nofrost mode"))
|
||||
MAKE_PSTR_LIST(nofrostmode1, F("nofrostmode1"), F("nofrost mode")) // RC310
|
||||
MAKE_PSTR_LIST(remotetemp, F("remotetemp"), F("room temperature from remote"))
|
||||
MAKE_PSTR_LIST(reducehours, F("reducehours"), F("duration for nighttemp"))
|
||||
MAKE_PSTR_LIST(reduceminutes, F("reduceminutes"), F("remaining time for nightmode"))
|
||||
MAKE_PSTR_LIST(switchonoptimization, F("switchonoptimization"), F("switch-on optimization"))
|
||||
|
||||
// heatpump
|
||||
MAKE_PSTR_LIST(airHumidity, F("airhumidity"), F("relative air humidity"))
|
||||
MAKE_PSTR_LIST(dewTemperature, F("dewtemperature"), F("dew point temperature"))
|
||||
|
||||
// mixer
|
||||
MAKE_PSTR_LIST(flowSetTemp, F("flowsettemp"), F("setpoint flow temperature"))
|
||||
MAKE_PSTR_LIST(flowTempHc, F("flowtemphc"), F("flow temperature (TC1)"))
|
||||
MAKE_PSTR_LIST(pumpStatus, F("pumpstatus"), F("pump status (PC1)"))
|
||||
MAKE_PSTR_LIST(mixerStatus, F("valvestatus"), F("mixing valve actuator (VC1)"))
|
||||
MAKE_PSTR_LIST(flowTempVf, F("flowtempvf"), F("flow temperature in header (T0/Vf)"))
|
||||
MAKE_PSTR_LIST(mixerSetTime, F("valvesettime"), F("time to set valve"))
|
||||
// mixer prefixed with wwc
|
||||
MAKE_PSTR_LIST(wwPumpStatus, F("pumpstatus"), F("pump status in assigned wwc (PC1)"))
|
||||
MAKE_PSTR_LIST(wwTempStatus, F("wwtempstatus"), F("temperature switch in assigned wwc (MC1)"))
|
||||
MAKE_PSTR_LIST(wwTemp, F("wwtemp"), F("current temperature"))
|
||||
// mixer pool
|
||||
MAKE_PSTR_LIST(poolSetTemp, F("poolsettemp"), F("pool set temperature"))
|
||||
MAKE_PSTR_LIST(poolTemp, F("pooltemp"), F("pool temperature"))
|
||||
MAKE_PSTR_LIST(poolShuntStatus, F("poolshuntstatus"), F("pool shunt status opening/closing"))
|
||||
MAKE_PSTR_LIST(poolShunt, F("poolshunt"), F("pool shunt open/close (0% = pool / 100% = heat)"))
|
||||
MAKE_PSTR_LIST(hydrTemp, F("hydrTemp"), F("hydraulic header temperature"))
|
||||
|
||||
// solar
|
||||
MAKE_PSTR_LIST(collectorTemp, F("collectortemp"), F("collector temperature (TS1)"))
|
||||
MAKE_PSTR_LIST(collector2Temp, F("collector2temp"), F("collector 2 temperature (TS7)"))
|
||||
MAKE_PSTR_LIST(cylBottomTemp, F("cylbottomtemp"), F("cylinder bottom temperature (TS2)"))
|
||||
MAKE_PSTR_LIST(cyl2BottomTemp, F("cyl2bottomtemp"), F("second cylinder bottom temperature (TS5)"))
|
||||
MAKE_PSTR_LIST(heatExchangerTemp, F("heatexchangertemp"), F("heat exchanger temperature (TS6)"))
|
||||
MAKE_PSTR_LIST(cylMiddleTemp, F("cylmiddletemp"), F("cylinder middle temperature (TS3)"))
|
||||
MAKE_PSTR_LIST(retHeatAssist, F("retheatassist"), F("return temperature heat assistance (TS4)"))
|
||||
// correct name for M1? value not found, try this:
|
||||
MAKE_PSTR_LIST(m1Valve, F("heatassistvalve"), F("heat assistance valve (M1)"))
|
||||
MAKE_PSTR_LIST(m1Power, F("heatassistpower"), F("heat assistance valve power (M1)"))
|
||||
MAKE_PSTR_LIST(collectorMaxTemp, F("collectormaxtemp"), F("maximum collector temperature"))
|
||||
MAKE_PSTR_LIST(collectorMinTemp, F("collectormintemp"), F("minimum collector temperature"))
|
||||
MAKE_PSTR_LIST(cylMaxTemp, F("cylmaxtemp"), F("maximum cylinder temperature"))
|
||||
// MAKE_PSTR_LIST(cyl2MaxTemp, F("cyl2maxtemp"), F("maximum cylinder 2 temperature"))
|
||||
MAKE_PSTR_LIST(solarPumpMod, F("solarpumpmod"), F("pump modulation (PS1)"))
|
||||
MAKE_PSTR_LIST(cylPumpMod, F("cylpumpmod"), F("cylinder pump modulation (PS5)"))
|
||||
MAKE_PSTR_LIST(solarPump, F("solarpump"), F("pump (PS1)"))
|
||||
MAKE_PSTR_LIST(solarPump2, F("solarpump2"), F("pump 2 (PS4)"))
|
||||
MAKE_PSTR_LIST(solarPump2Mod, F("solarpump2mod"), F("pump 2 modulation (PS4)"))
|
||||
MAKE_PSTR_LIST(valveStatus, F("valvestatus"), F("valve status"))
|
||||
MAKE_PSTR_LIST(cylHeated, F("cylheated"), F("cyl heated"))
|
||||
MAKE_PSTR_LIST(collectorShutdown, F("collectorshutdown"), F("collector shutdown"))
|
||||
MAKE_PSTR_LIST(pumpWorkTime, F("pumpworktime"), F("pump working time"))
|
||||
MAKE_PSTR_LIST(pump2WorkTime, F("pump2worktime"), F("pump 2 working time"))
|
||||
MAKE_PSTR_LIST(m1WorkTime, F("m1worktime"), F("differential control working time"))
|
||||
MAKE_PSTR_LIST(energyLastHour, F("energylasthour"), F("energy last hour"))
|
||||
MAKE_PSTR_LIST(energyTotal, F("energytotal"), F("total energy"))
|
||||
MAKE_PSTR_LIST(energyToday, F("energytoday"), F("total energy today"))
|
||||
MAKE_PSTR_LIST(pumpMinMod, F("pumpminmod"), F("minimum pump modulation"))
|
||||
MAKE_PSTR_LIST(maxFlow, F("maxflow"), F("maximum solar flow"))
|
||||
MAKE_PSTR_LIST(solarPower, F("solarpower"), F("actual solar power"))
|
||||
MAKE_PSTR_LIST(solarPumpTurnonDiff, F("turnondiff"), F("pump turn on difference"))
|
||||
MAKE_PSTR_LIST(solarPumpTurnoffDiff, F("turnoffdiff"), F("pump turn off difference"))
|
||||
MAKE_PSTR_LIST(pump2MinMod, F("pump2minmod"), F("minimum pump 2 modulation"))
|
||||
MAKE_PSTR_LIST(solarPump2TurnonDiff, F("turnondiff2"), F("pump 2 turn on difference"))
|
||||
MAKE_PSTR_LIST(solarPump2TurnoffDiff, F("turnoffdiff2"), F("pump 2 turn off difference"))
|
||||
|
||||
// solar ww
|
||||
MAKE_PSTR_LIST(wwTemp1, F("wwtemp1"), F("temperature 1"))
|
||||
MAKE_PSTR_LIST(wwTemp3, F("wwtemp3"), F("temperature 3"))
|
||||
MAKE_PSTR_LIST(wwTemp4, F("wwtemp4"), F("temperature 4"))
|
||||
MAKE_PSTR_LIST(wwTemp5, F("wwtemp5"), F("temperature 5"))
|
||||
MAKE_PSTR_LIST(wwTemp7, F("wwtemp7"), F("temperature 7"))
|
||||
MAKE_PSTR_LIST(wwPump, F("wwpump"), F("pump"))
|
||||
// solar ww and mixer wwc
|
||||
MAKE_PSTR_LIST(wwMinTemp, F("wwmintemp"), F("minimum temperature"))
|
||||
MAKE_PSTR_LIST(wwRedTemp, F("wwredtemp"), F("reduced temperature"))
|
||||
MAKE_PSTR_LIST(wwDailyTemp, F("wwdailytemp"), F("daily temperature"))
|
||||
MAKE_PSTR_LIST(wwKeepWarm, F("wwkeepwarm"), F("keep warm"))
|
||||
MAKE_PSTR_LIST(wwStatus2, F("wwstatus2"), F("status 2"))
|
||||
MAKE_PSTR_LIST(enum_wwStatus2, F(""), F(""), F(""), F("no_heat"), F(""), F(""), F("heatrequest"), F(""), F("disinfecting"), F("hold"))
|
||||
MAKE_PSTR_LIST(wwPumpMod, F("wwpumpmod"), F("pump modulation"))
|
||||
MAKE_PSTR_LIST(wwFlow, F("wwflow"), F("flow rate"))
|
||||
// extra mixer ww
|
||||
MAKE_PSTR_LIST(wwRequiredTemp, F("wwrequiredtemp"), F("required temperature"))
|
||||
MAKE_PSTR_LIST(wwDiffTemp, F("wwdifftemp"), F("start differential temperature"))
|
||||
|
||||
//SM100
|
||||
MAKE_PSTR_LIST(heatTransferSystem, F("heattransfersystem"), F("heattransfer system"))
|
||||
MAKE_PSTR_LIST(externalCyl, F("externalcyl"), F("external cylinder"))
|
||||
MAKE_PSTR_LIST(thermalDisinfect, F("thermaldisinfect"), F("thermal disinfection"))
|
||||
MAKE_PSTR_LIST(heatMetering, F("heatmetering"), F("heatmetering"))
|
||||
MAKE_PSTR_LIST(solarIsEnabled, F("solarenabled"), F("solarmodule enabled"))
|
||||
|
||||
// telegram 0x035A
|
||||
MAKE_PSTR_LIST(solarPumpMode, F("solarpumpmode"), F("pump mode"))
|
||||
MAKE_PSTR_LIST(solarPumpKick, F("pumpkick"), F("pumpkick"))
|
||||
MAKE_PSTR_LIST(plainWaterMode, F("plainwatermode"), F("plain water mode"))
|
||||
MAKE_PSTR_LIST(doubleMatchFlow, F("doublematchflow"), F("doublematchflow"))
|
||||
MAKE_PSTR_LIST(solarPump2Mode, F("pump2mode"), F("pump 2 mode"))
|
||||
MAKE_PSTR_LIST(solarPump2Kick, F("pump2kick"), F("pumpkick 2"))
|
||||
|
||||
// telegram 0x035F
|
||||
MAKE_PSTR_LIST(cylPriority, F("cylpriority"), F("cylinder priority"))
|
||||
|
||||
// telegram 0x380
|
||||
MAKE_PSTR_LIST(climateZone, F("climatezone"), F("climate zone"))
|
||||
MAKE_PSTR_LIST(collector1Area, F("collector1area"), F("collector 1 area"))
|
||||
MAKE_PSTR_LIST(collector1Type, F("collector1type"), F("collector 1 type"))
|
||||
MAKE_PSTR_LIST(collector2Area, F("collector2area"), F("collector 2 area"))
|
||||
MAKE_PSTR_LIST(collector2Type, F("collector2type"), F("collector 2 type"))
|
||||
|
||||
// telegram 0x0363 heatCounter
|
||||
MAKE_PSTR_LIST(heatCntFlowTemp, F("heatcntflowtemp"), F("heat counter flow temperature"))
|
||||
MAKE_PSTR_LIST(heatCntRetTemp, F("heatcntrettemp"), F("heat counter return temperature"))
|
||||
MAKE_PSTR_LIST(heatCnt, F("heatcnt"), F("heat counter impulses"))
|
||||
MAKE_PSTR_LIST(swapFlowTemp, F("swapflowtemp"), F("swap flow temperature (TS14)"))
|
||||
MAKE_PSTR_LIST(swapRetTemp, F("swaprettemp"), F("swap return temperature (TS15)"))
|
||||
|
||||
// switch
|
||||
MAKE_PSTR_LIST(activated, F("activated"), F("activated"))
|
||||
MAKE_PSTR_LIST(status, F("status"), F("status"))
|
||||
|
||||
// unknown fields to track (SM10)
|
||||
MAKE_PSTR_LIST(data11, F("data11"), F("unknown datafield 11"))
|
||||
MAKE_PSTR_LIST(data12, F("data12"), F("unknown datafield 12"))
|
||||
MAKE_PSTR_LIST(data8, F("data8"), F("unknown datafield 8"))
|
||||
MAKE_PSTR_LIST(data0, F("data0"), F("unknown datafield 0"))
|
||||
MAKE_PSTR_LIST(data1, F("data1"), F("unknown datafield 1"))
|
||||
MAKE_PSTR_LIST(setting3, F("setting3"), F("unknown setting 3"))
|
||||
MAKE_PSTR_LIST(setting4, F("setting4"), F("unknown setting 4"))
|
||||
|
||||
// RF sensor, id 0x40, telegram 0x435
|
||||
MAKE_PSTR_LIST(RFTemp, F("rftemp"), F("RF room temperature sensor"));
|
||||
336
src/locale_common.h
Normal file
336
src/locale_common.h
Normal file
@@ -0,0 +1,336 @@
|
||||
/*
|
||||
* EMS-ESP - https://github.com/emsesp/EMS-ESP
|
||||
* Copyright 2020 Paul Derbyshire
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wunused-variable"
|
||||
|
||||
// clang-format off
|
||||
|
||||
/*
|
||||
* THIS FILE CONTAINS STANDARD STRING LITERALS THAT DON'T NEED LANGUAGE TRANSLATIONS
|
||||
*/
|
||||
|
||||
// common words
|
||||
MAKE_PSTR_WORD(debug)
|
||||
MAKE_PSTR_WORD(exit)
|
||||
MAKE_PSTR_WORD(help)
|
||||
MAKE_PSTR_WORD(log)
|
||||
MAKE_PSTR_WORD(logout)
|
||||
MAKE_PSTR_WORD(enabled)
|
||||
MAKE_PSTR_WORD(disabled)
|
||||
MAKE_PSTR_WORD(set)
|
||||
MAKE_PSTR_WORD(show)
|
||||
MAKE_PSTR_WORD(su)
|
||||
MAKE_PSTR_WORD(name)
|
||||
MAKE_PSTR_WORD(scan)
|
||||
MAKE_PSTR_WORD(password)
|
||||
MAKE_PSTR_WORD(read)
|
||||
MAKE_PSTR_WORD(version)
|
||||
MAKE_PSTR_WORD(values)
|
||||
MAKE_PSTR_WORD(system)
|
||||
MAKE_PSTR_WORD(fetch)
|
||||
MAKE_PSTR_WORD(restart)
|
||||
MAKE_PSTR_WORD(format)
|
||||
MAKE_PSTR_WORD(raw)
|
||||
MAKE_PSTR_WORD(watch)
|
||||
MAKE_PSTR_WORD(syslog)
|
||||
MAKE_PSTR_WORD(send)
|
||||
MAKE_PSTR_WORD(telegram)
|
||||
MAKE_PSTR_WORD(bus_id)
|
||||
MAKE_PSTR_WORD(tx_mode)
|
||||
MAKE_PSTR_WORD(ems)
|
||||
MAKE_PSTR_WORD(devices)
|
||||
MAKE_PSTR_WORD(shower)
|
||||
MAKE_PSTR_WORD(mqtt)
|
||||
MAKE_PSTR_WORD(emsesp)
|
||||
MAKE_PSTR_WORD(connected)
|
||||
MAKE_PSTR_WORD(disconnected)
|
||||
MAKE_PSTR_WORD(passwd)
|
||||
MAKE_PSTR_WORD(hostname)
|
||||
MAKE_PSTR_WORD(wifi)
|
||||
MAKE_PSTR_WORD(reconnect)
|
||||
MAKE_PSTR_WORD(ssid)
|
||||
MAKE_PSTR_WORD(heartbeat)
|
||||
MAKE_PSTR_WORD(users)
|
||||
MAKE_PSTR_WORD(publish)
|
||||
MAKE_PSTR_WORD(timeout)
|
||||
MAKE_PSTR_WORD(board_profile)
|
||||
MAKE_PSTR_WORD(setvalue)
|
||||
|
||||
// for commands
|
||||
MAKE_PSTR_WORD(call)
|
||||
MAKE_PSTR_WORD(cmd)
|
||||
MAKE_PSTR_WORD(id)
|
||||
MAKE_PSTR_WORD(hc)
|
||||
MAKE_PSTR_WORD(wwc)
|
||||
MAKE_PSTR_WORD(device)
|
||||
MAKE_PSTR_WORD(data)
|
||||
MAKE_PSTR_WORD(command)
|
||||
MAKE_PSTR_WORD(commands)
|
||||
MAKE_PSTR_WORD(info)
|
||||
MAKE_PSTR_WORD(settings)
|
||||
MAKE_PSTR_WORD(customizations)
|
||||
MAKE_PSTR_WORD(value)
|
||||
MAKE_PSTR_WORD(entities)
|
||||
|
||||
// device types - lowercase, used in MQTT
|
||||
MAKE_PSTR_WORD(boiler)
|
||||
MAKE_PSTR_WORD(thermostat)
|
||||
MAKE_PSTR_WORD(switch)
|
||||
MAKE_PSTR_WORD(solar)
|
||||
MAKE_PSTR_WORD(mixer)
|
||||
MAKE_PSTR_WORD(gateway)
|
||||
MAKE_PSTR_WORD(controller)
|
||||
MAKE_PSTR_WORD(connect)
|
||||
MAKE_PSTR_WORD(heatpump)
|
||||
MAKE_PSTR_WORD(generic)
|
||||
MAKE_PSTR_WORD(analogsensor)
|
||||
MAKE_PSTR_WORD(dallassensor)
|
||||
MAKE_PSTR_WORD(alert)
|
||||
MAKE_PSTR_WORD(pump)
|
||||
MAKE_PSTR_WORD(heatsource)
|
||||
|
||||
MAKE_PSTR(number, "number")
|
||||
MAKE_PSTR(enum, "enum")
|
||||
MAKE_PSTR(text, "text")
|
||||
|
||||
// Console
|
||||
MAKE_PSTR(EMSESP, "EMS-ESP")
|
||||
MAKE_PSTR(host_fmt, "Host: %s")
|
||||
MAKE_PSTR(port_fmt, "Port: %d")
|
||||
MAKE_PSTR(hostname_fmt, "Hostname: %s")
|
||||
MAKE_PSTR(board_profile_fmt, "Board Profile: %s")
|
||||
MAKE_PSTR(mark_interval_fmt, "Mark interval: %lus")
|
||||
MAKE_PSTR(wifi_ssid_fmt, "WiFi SSID: %s")
|
||||
MAKE_PSTR(wifi_password_fmt, "WiFi Password: %S")
|
||||
MAKE_PSTR(tx_mode_fmt, "Tx mode: %d")
|
||||
MAKE_PSTR(bus_id_fmt, "Bus ID: %02X")
|
||||
MAKE_PSTR(log_level_fmt, "Log level: %s")
|
||||
MAKE_PSTR(cmd_optional, "[cmd]")
|
||||
MAKE_PSTR(ha_optional, "[ha]")
|
||||
MAKE_PSTR(deep_optional, "[deep]")
|
||||
MAKE_PSTR(watchid_optional, "[ID]")
|
||||
MAKE_PSTR(watch_format_optional, "[off | on | raw | unknown]")
|
||||
MAKE_PSTR(invalid_watch, "Invalid watch type")
|
||||
MAKE_PSTR(data_mandatory, "\"XX XX ...\"")
|
||||
MAKE_PSTR(asterisks, "********")
|
||||
MAKE_PSTR(n_mandatory, "<n>")
|
||||
MAKE_PSTR(sensorid_optional, "[sensor ID]")
|
||||
MAKE_PSTR(id_optional, "[id|hc]")
|
||||
MAKE_PSTR(data_optional, "[data]")
|
||||
MAKE_PSTR(offset_optional, "[offset]")
|
||||
MAKE_PSTR(length_optional, "[length]")
|
||||
MAKE_PSTR(typeid_mandatory, "<type ID>")
|
||||
MAKE_PSTR(deviceid_mandatory, "<device ID>")
|
||||
MAKE_PSTR(device_type_optional, "[device]")
|
||||
MAKE_PSTR(invalid_log_level, "Invalid log level")
|
||||
MAKE_PSTR(log_level_optional, "[level]")
|
||||
MAKE_PSTR(name_mandatory, "<name>")
|
||||
MAKE_PSTR(name_optional, "[name]")
|
||||
MAKE_PSTR(new_password_prompt1, "Enter new password: ")
|
||||
MAKE_PSTR(new_password_prompt2, "Retype new password: ")
|
||||
MAKE_PSTR(password_prompt, "Password: ")
|
||||
MAKE_PSTR(unset, "<unset>")
|
||||
|
||||
// more common names that don't need translations
|
||||
MAKE_PSTR_LIST(1x3min, "1x3min")
|
||||
MAKE_PSTR_LIST(2x3min, "2x3min")
|
||||
MAKE_PSTR_LIST(3x3min, "3x3min")
|
||||
MAKE_PSTR_LIST(4x3min, "4x3min")
|
||||
MAKE_PSTR_LIST(5x3min, "5x3min")
|
||||
MAKE_PSTR_LIST(6x3min, "6x3min")
|
||||
MAKE_PSTR_LIST(auto, "auto")
|
||||
MAKE_PSTR_LIST(rc3x, "RC3x")
|
||||
MAKE_PSTR_LIST(rc20, "RC20")
|
||||
MAKE_PSTR_LIST(fb10, "FB10")
|
||||
MAKE_PSTR_LIST(fb100, "FB100")
|
||||
MAKE_PSTR_LIST(dash, "-")
|
||||
MAKE_PSTR_LIST(BLANK, "")
|
||||
MAKE_PSTR_LIST(pwm, "pwm")
|
||||
MAKE_PSTR_LIST(pwm_invers, "pwm inverse")
|
||||
MAKE_PSTR_LIST(mpc, "mpc")
|
||||
MAKE_PSTR_LIST(tempauto, "temp auto")
|
||||
MAKE_PSTR_LIST(bypass, "bypass")
|
||||
MAKE_PSTR_LIST(mixer, "mixer")
|
||||
MAKE_PSTR_LIST(monovalent, "monovalent")
|
||||
MAKE_PSTR_LIST(bivalent, "bivalent")
|
||||
MAKE_PSTR_LIST(n_o, "n_o")
|
||||
MAKE_PSTR_LIST(n_c, "n_c")
|
||||
MAKE_PSTR_LIST(prog1, "prog 1")
|
||||
MAKE_PSTR_LIST(prog2, "prog 2")
|
||||
MAKE_PSTR_LIST(proga, "prog a")
|
||||
MAKE_PSTR_LIST(progb, "prog b")
|
||||
MAKE_PSTR_LIST(progc, "prog c")
|
||||
MAKE_PSTR_LIST(progd, "prog d")
|
||||
MAKE_PSTR_LIST(proge, "prog e")
|
||||
MAKE_PSTR_LIST(progf, "prog f")
|
||||
MAKE_PSTR_LIST(rc35, "RC35")
|
||||
MAKE_PSTR_LIST(0kW, "0 kW")
|
||||
MAKE_PSTR_LIST(2kW, "2 kW")
|
||||
MAKE_PSTR_LIST(3kW, "3 kW")
|
||||
MAKE_PSTR_LIST(4kW, "4 kW")
|
||||
MAKE_PSTR_LIST(6kW, "6 kW")
|
||||
MAKE_PSTR_LIST(9kW, "9 kW")
|
||||
|
||||
// templates - this are not translated and will be saved under options_single
|
||||
MAKE_PSTR_LIST(tpl_datetime, "Format: < NTP | dd.mm.yyyy-hh:mm:ss-day(0-6)-dst(0/1) >")
|
||||
MAKE_PSTR_LIST(tpl_switchtime, "Format: <nn> [ not_set | day hh:mm on|off ]")
|
||||
MAKE_PSTR_LIST(tpl_switchtime1, "Format: <nn> [ not_set | day hh:mm Tn ]")
|
||||
MAKE_PSTR_LIST(tpl_holidays, "Format: < dd.mm.yyyy-dd.mm.yyyy >")
|
||||
MAKE_PSTR_LIST(tpl_date, "Format: < dd.mm.yyyy >")
|
||||
MAKE_PSTR_LIST(tpl_input, "Format: <inv>[<evu1><evu2><evu3><comp><aux><cool><heat><dhw><pv>]")
|
||||
MAKE_PSTR_LIST(tpl_input4, "Format: <inv>[<comp><aux><cool><heat><dhw><pv>]")
|
||||
|
||||
// Unit Of Measurement mapping - maps to DeviceValueUOM_s in emsdevice.cpp
|
||||
// Translating hours/minute/seconds are done in emsdevice.cpp (uom_to_string())
|
||||
MAKE_PSTR(uom_blank, " ")
|
||||
MAKE_PSTR(uom_percent, "%")
|
||||
MAKE_PSTR(uom_degrees, "°C")
|
||||
MAKE_PSTR(uom_kwh, "kWh")
|
||||
MAKE_PSTR(uom_wh, "Wh")
|
||||
MAKE_PSTR(uom_bar, "bar")
|
||||
MAKE_PSTR(uom_ua, "µA")
|
||||
MAKE_PSTR(uom_lmin, "l/min")
|
||||
MAKE_PSTR(uom_kw, "kW")
|
||||
MAKE_PSTR(uom_w, "W")
|
||||
MAKE_PSTR(uom_kb, "KB")
|
||||
MAKE_PSTR(uom_dbm, "dBm")
|
||||
MAKE_PSTR(uom_fahrenheit, "°F")
|
||||
MAKE_PSTR(uom_mv, "mV")
|
||||
MAKE_PSTR(uom_sqm, "m²")
|
||||
MAKE_PSTR(uom_m3, "m³")
|
||||
MAKE_PSTR(uom_l, "l")
|
||||
MAKE_PSTR(uom_kmin, "K*min")
|
||||
MAKE_PSTR(uom_k, "K")
|
||||
|
||||
// MQTT topics and prefixes
|
||||
MAKE_PSTR(heating_active, "heating_active")
|
||||
MAKE_PSTR(tapwater_active, "tapwater_active")
|
||||
MAKE_PSTR(response, "response")
|
||||
MAKE_PSTR(tag_boiler_data_ww_mqtt, "ww")
|
||||
MAKE_PSTR(tag_device_data_ww_mqtt, "")
|
||||
|
||||
// Home Assistant - this is special and has no translations
|
||||
MAKE_PSTR_LIST(climate, "HA climate config creation")
|
||||
|
||||
// syslog
|
||||
MAKE_PSTR_LIST(list_syslog_level, "off", "emerg", "alert", "crit", "error", "warn", "notice", "info", "debug", "trace", "all")
|
||||
|
||||
// sensors
|
||||
MAKE_PSTR_LIST(counter, "counter")
|
||||
MAKE_PSTR_LIST(digital_out, "digital_out")
|
||||
MAKE_PSTR_LIST(list_sensortype, "none", "digital in", "counter", "adc", "timer", "rate", "digital out", "pwm 0", "pwm 1", "pwm 2")
|
||||
|
||||
// watch
|
||||
MAKE_PSTR_LIST(list_watch, "off", "on", "raw", "unknown")
|
||||
|
||||
/*
|
||||
* The rest below are Enums and generated from translations lists
|
||||
*/
|
||||
|
||||
MAKE_PSTR_ENUM(enum_cylprio, FL_(cyl1), FL_(cyl2))
|
||||
MAKE_PSTR_ENUM(enum_progMode, FL_(prog1), FL_(prog2))
|
||||
MAKE_PSTR_ENUM(enum_progMode4, FL_(proga), FL_(progb), FL_(progc), FL_(progd), FL_(proge), FL_(progf))
|
||||
MAKE_PSTR_ENUM(enum_climate, FL_(seltemp), FL_(roomtemp))
|
||||
MAKE_PSTR_ENUM(enum_charge, FL_(chargepump), FL_(3wayvalve))
|
||||
MAKE_PSTR_ENUM(enum_freq, FL_(off), FL_(1x3min), FL_(2x3min), FL_(3x3min), FL_(4x3min), FL_(5x3min), FL_(6x3min), FL_(continuous))
|
||||
MAKE_PSTR_ENUM(enum_off_time_date_manual, FL_(off), FL_(time), FL_(date), FL_(manual))
|
||||
MAKE_PSTR_ENUM(enum_comfort, FL_(hot), FL_(eco), FL_(intelligent))
|
||||
MAKE_PSTR_ENUM(enum_comfort1, FL_(high_comfort), FL_(eco))
|
||||
MAKE_PSTR_ENUM(enum_comfort2, FL_(eco), FL_(high_comfort))
|
||||
MAKE_PSTR_ENUM(enum_flow, FL_(off), FL_(flow), FL_(bufferedflow), FL_(buffer), FL_(layeredbuffer))
|
||||
MAKE_PSTR_ENUM(enum_reset, FL_(dash), FL_(maintenance), FL_(error))
|
||||
MAKE_PSTR_ENUM(enum_maxHeat, FL_(0kW), FL_(2kW), FL_(3kW), FL_(4kW), FL_(6kW), FL_(9kW))
|
||||
MAKE_PSTR_ENUM(enum_pumpMode, FL_(proportional), FL_(deltaP1), FL_(deltaP2), FL_(deltaP3), FL_(deltaP4))
|
||||
|
||||
// thermostat lists
|
||||
MAKE_PSTR_ENUM(enum_ibaMainDisplay, FL_(internal_temperature), FL_(internal_setpoint), FL_(external_temperature), FL_(burner_temperature), FL_(ww_temperature), FL_(functioning_mode), FL_(time), FL_(date), FL_(smoke_temperature))
|
||||
MAKE_PSTR_ENUM(enum_ibaLanguage, FL_(german), FL_(dutch), FL_(french), FL_(italian))
|
||||
MAKE_PSTR_ENUM(enum_ibaLanguage_RC30, FL_(german), FL_(dutch))
|
||||
MAKE_PSTR_ENUM(enum_floordrystatus, FL_(off), FL_(start), FL_(heat), FL_(hold), FL_(cool), FL_(end))
|
||||
MAKE_PSTR_ENUM(enum_ibaBuildingType, FL_(light), FL_(medium), FL_(heavy))
|
||||
MAKE_PSTR_ENUM(enum_PID, FL_(fast), FL_(medium), FL_(slow))
|
||||
MAKE_PSTR_ENUM(enum_wwMode, FL_(off), FL_(normal), FL_(comfort), FL_(auto), FL_(own_prog), FL_(eco))
|
||||
MAKE_PSTR_ENUM(enum_wwCircMode, FL_(off), FL_(on), FL_(auto), FL_(own_prog))
|
||||
MAKE_PSTR_ENUM(enum_wwMode2, FL_(off), FL_(on), FL_(auto))
|
||||
MAKE_PSTR_ENUM(enum_wwMode3, FL_(on), FL_(off), FL_(auto))
|
||||
MAKE_PSTR_ENUM(enum_heatingtype, FL_(off), FL_(radiator), FL_(convector), FL_(floor))
|
||||
MAKE_PSTR_ENUM(enum_summermode, FL_(summer), FL_(auto), FL_(winter))
|
||||
MAKE_PSTR_ENUM(enum_hpoperatingmode, FL_(off), FL_(auto), FL_(heating), FL_(cooling))
|
||||
MAKE_PSTR_ENUM(enum_summer, FL_(winter), FL_(summer))
|
||||
MAKE_PSTR_ENUM(enum_operatingstate, FL_(heating), FL_(off), FL_(cooling))
|
||||
|
||||
MAKE_PSTR_ENUM(enum_mode, FL_(manual), FL_(auto)) // RC100, RC300, RC310
|
||||
MAKE_PSTR_ENUM(enum_mode2, FL_(off), FL_(manual), FL_(auto)) // RC20, RC30
|
||||
MAKE_PSTR_ENUM(enum_mode3, FL_(night), FL_(day), FL_(auto)) // RC35, RC30_N, RC25, RC20_N
|
||||
MAKE_PSTR_ENUM(enum_mode4, FL_(nofrost), FL_(eco), FL_(heat), FL_(auto)) // JUNKERS
|
||||
MAKE_PSTR_ENUM(enum_mode5, FL_(auto), FL_(off)) // CRF
|
||||
MAKE_PSTR_ENUM(enum_mode6, FL_(nofrost), FL_(night), FL_(day)) // RC10
|
||||
MAKE_PSTR_ENUM(enum_mode_ha, FL_(off), FL_(heat), FL_(auto)) // HA climate
|
||||
|
||||
MAKE_PSTR_ENUM(enum_modetype, FL_(eco), FL_(comfort))
|
||||
MAKE_PSTR_ENUM(enum_modetype3, FL_(night), FL_(day))
|
||||
MAKE_PSTR_ENUM(enum_modetype4, FL_(nofrost), FL_(eco), FL_(heat))
|
||||
MAKE_PSTR_ENUM(enum_modetype5, FL_(off), FL_(on))
|
||||
|
||||
MAKE_PSTR_ENUM(enum_reducemode, FL_(nofrost), FL_(reduce), FL_(room), FL_(outdoor))
|
||||
MAKE_PSTR_ENUM(enum_reducemode1, FL_(outdoor), FL_(room), FL_(reduce)) // RC310 values: 1-3
|
||||
MAKE_PSTR_ENUM(enum_nofrostmode, FL_(off), FL_(room), FL_(outdoor))
|
||||
MAKE_PSTR_ENUM(enum_nofrostmode1, FL_(room), FL_(outdoor), FL_(room_outdoor))
|
||||
|
||||
MAKE_PSTR_ENUM(enum_controlmode, FL_(off), FL_(optimized), FL_(simple), FL_(mpc), FL_(room), FL_(power), FL_(constant))
|
||||
MAKE_PSTR_ENUM(enum_controlmode1, FL_(weather_compensated), FL_(outside_basepoint), FL_(na), FL_(room), FL_(power), FL_(constant)) // RC310 1-4
|
||||
MAKE_PSTR_ENUM(enum_controlmode2, FL_(outdoor), FL_(room))
|
||||
MAKE_PSTR_ENUM(enum_control, FL_(off), FL_(rc20), FL_(rc3x))
|
||||
MAKE_PSTR_ENUM(enum_j_control, FL_(off), FL_(fb10), FL_(fb100))
|
||||
MAKE_PSTR_ENUM(enum_roomsensor, FL_(extern), FL_(intern), FL_(auto))
|
||||
|
||||
MAKE_PSTR_ENUM(enum_switchmode, FL_(off), FL_(eco), FL_(comfort), FL_(heat))
|
||||
|
||||
MAKE_PSTR_ENUM(enum_dayOfWeek, FL_(day_mo), FL_(day_tu), FL_(day_we), FL_(day_th), FL_(day_fr), FL_(day_sa), FL_(day_su), FL_(all))
|
||||
MAKE_PSTR_ENUM(enum_progMode2, FL_(own_1), FL_(family), FL_(morning), FL_(evening), FL_(am), FL_(pm), FL_(midday), FL_(singles), FL_(seniors), FL_(new), FL_(own_2))
|
||||
MAKE_PSTR_ENUM(enum_progMode3, FL_(family), FL_(morning), FL_(evening), FL_(am), FL_(pm), FL_(midday), FL_(singles), FL_(seniors))
|
||||
MAKE_PSTR_ENUM(enum_hybridStrategy, FL_(co2_optimized), FL_(cost_optimized), FL_(outside_temp_switched), FL_(co2_cost_mix))
|
||||
MAKE_PSTR_ENUM(enum_hybridStrategy1, FL_(cost_optimized), FL_(co2_optimized), FL_(outside_temp_alt), FL_(outside_temp_par), FL_(hp_prefered), FL_(boiler_only))
|
||||
MAKE_PSTR_ENUM(enum_lowNoiseMode, FL_(off), FL_(reduced_output), FL_(switchoff), FL_(perm))
|
||||
|
||||
// heat pump
|
||||
MAKE_PSTR_ENUM(enum_hpactivity, FL_(none), FL_(heating), FL_(cooling), FL_(hot_water), FL_(pool), FL_(unknown), FL_(defrost))
|
||||
MAKE_PSTR_ENUM(enum_silentMode, FL_(off), FL_(auto), FL_(on))
|
||||
|
||||
// solar
|
||||
MAKE_PSTR_ENUM(enum_solarmode, FL_(constant), FL_(pwm), FL_(analog))
|
||||
MAKE_PSTR_ENUM(enum_collectortype, FL_(flat), FL_(vacuum))
|
||||
MAKE_PSTR_ENUM(enum_wwStatus2, FL_(BLANK), FL_(BLANK), FL_(BLANK), FL_(no_heat), FL_(BLANK), FL_(BLANK), FL_(heatrequest), FL_(BLANK), FL_(disinfecting), FL_(hold))
|
||||
|
||||
// mixer
|
||||
MAKE_PSTR_ENUM(enum_shunt, FL_(stopped), FL_(opening), FL_(closing), FL_(open), FL_(close))
|
||||
MAKE_PSTR_ENUM(enum_wwProgMode, FL_(std_prog), FL_(own_prog))
|
||||
|
||||
// AM200 lists
|
||||
MAKE_PSTR_ENUM(enum_vr2Config, FL_(off), FL_(bypass))
|
||||
MAKE_PSTR_ENUM(enum_aPumpSignal, FL_(off), FL_(pwm), FL_(pwm_invers))
|
||||
MAKE_PSTR_ENUM(enum_bufBypass, FL_(no), FL_(mixer), FL_(valve))
|
||||
MAKE_PSTR_ENUM(enum_blockMode, FL_(off), FL_(auto), FL_(blocking))
|
||||
MAKE_PSTR_ENUM(enum_bufConfig, FL_(off), FL_(monovalent), FL_(bivalent))
|
||||
MAKE_PSTR_ENUM(enum_blockTerm, FL_(n_o), FL_(n_c))
|
||||
|
||||
#pragma GCC diagnostic pop
|
||||
|
||||
// clang-format on
|
||||
765
src/locale_translations.h
Normal file
765
src/locale_translations.h
Normal file
@@ -0,0 +1,765 @@
|
||||
/*
|
||||
* EMS-ESP - https://github.com/emsesp/EMS-ESP
|
||||
* Copyright 2020 Paul Derbyshire
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
// clang-format off
|
||||
|
||||
// Define languages here
|
||||
// Makes sure they are also added in same order to languages[] in system.cpp
|
||||
#define EMSESP_LOCALE_EN "en"
|
||||
#define EMSESP_LOCALE_DE "de"
|
||||
#define EMSESP_LOCALE_NL "nl"
|
||||
#define EMSESP_LOCALE_SV "sv"
|
||||
#define EMSESP_LOCALE_PL "pl"
|
||||
#define EMSESP_LOCALE_NO "no"
|
||||
#define EMSESP_LOCALE_FR "fr"
|
||||
|
||||
// translations are in order en, de, nl, sv, pl, no, fr, ....
|
||||
// if there is no translation, it will default to en
|
||||
|
||||
// device types, as display in Web and Console
|
||||
// TODO need completed translations
|
||||
MAKE_PSTR_LIST(boiler_device, "Boiler", "Kessel", "Boiler", "Värmepanna", "Kocioł", "", "") // TODO translate
|
||||
MAKE_PSTR_LIST(thermostat_device, "Thermostat", "Thermostat", "Thermostaat", "Termostat", "Termostat", "", "") // TODO translate
|
||||
MAKE_PSTR_LIST(heatpump_device, "Heat Pump", "Wärmepumpe", "Warmtepomp", "Värmepump", "Pompa ciepła", "", "") // TODO translate
|
||||
MAKE_PSTR_LIST(solar_device, "Solar Module", "Solarmodul", "Solar Module", "Solmodul", "Moduł solarny", "", "") // TODO translate
|
||||
MAKE_PSTR_LIST(connect_device, "Connect Module", "Verbindungsmodul", "Connect Module", "Uppkopplingsmodul", "Moduł przyłączeniowy", "", "") // TODO translate
|
||||
MAKE_PSTR_LIST(mixer_device, "Mixer Module", "Mischermodul", "Mixer Module", "Blandningsmodul", "Moduł mieszacza", "", "") // TODO translate
|
||||
MAKE_PSTR_LIST(controller_device, "Controller Module", "Kontrollmodul", "Controller Module", "Styrmodul", "Moduł sterujący", "", "") // TODO translate
|
||||
MAKE_PSTR_LIST(switch_device, "Switch Module", "Schaltmodul", "Switch Module", "Relämodul", "Moduł przełączający", "", "") // TODO translate
|
||||
MAKE_PSTR_LIST(gateway_device, "Gateway Module", "Gateway Modul", "Gateway Module", "Gateway", "Moduł IP", "", "") // TODO translate
|
||||
MAKE_PSTR_LIST(alert_device, "Alert Module", "Alarmmodul", "Alert Module", "Larmmodul", "Moduł alarmowy", "", "") // TODO translate
|
||||
MAKE_PSTR_LIST(pump_device, "Pump Module", "Pumpenmodul", "Pump Module", "Pumpmodul", "Moduł pompy", "", "") // TODO translate
|
||||
MAKE_PSTR_LIST(heatsource_device, "Heatsource", "Heizquelle", "Heatsource", "Värmekälla", "Źródło ciepła", "", "") // TODO translate
|
||||
MAKE_PSTR_LIST(unknown_device, "Unknown", "Unbekannt", "Onbekend", "Okänt", "Nieznane urządzenie", "Ukjent", "Inconnu")
|
||||
MAKE_PSTR_LIST(sensors_device, "Sensors", "Sensoren", "Sensoren", "Sensorer", "Czujniki", "Sensorer", "Capteurs")
|
||||
|
||||
// commands
|
||||
MAKE_PSTR_LIST(info_cmd, "lists all values", "Liste aller Werte")
|
||||
MAKE_PSTR_LIST(commands_cmd, "lists all commands", "Liste aller Kommandos")
|
||||
MAKE_PSTR_LIST(entities_cmd, "lists all entities", "Liste aller Entitäten")
|
||||
MAKE_PSTR_LIST(send_cmd, "send a telegram", "Sende EMS-Telegramm")
|
||||
MAKE_PSTR_LIST(setiovalue_cmd, "set io value", "Setze Wertevorgabe")
|
||||
MAKE_PSTR_LIST(changeloglevel_cmd, "change log level", "Ändere Sysloglevel")
|
||||
MAKE_PSTR_LIST(fetch_cmd, "refresh all EMS values", "Lese alle EMS-Werte neu")
|
||||
MAKE_PSTR_LIST(restart_cmd, "restart EMS-ESP", "Neustart")
|
||||
MAKE_PSTR_LIST(watch_cmd, "watch incoming telegrams", "Watch auf eingehende Telegramme")
|
||||
MAKE_PSTR_LIST(publish_cmd, "publish all to MQTT", "Publiziere MQTT")
|
||||
MAKE_PSTR_LIST(system_info_cmd, "show system status", "Zeige System-Status")
|
||||
|
||||
#if defined(EMSESP_DEBUG)
|
||||
MAKE_PSTR_LIST(test_cmd, "run a test")
|
||||
#endif
|
||||
|
||||
// TAG mapping - maps to DeviceValueTAG_s in emsdevice.cpp
|
||||
// use empty string if want to suppress showing tags
|
||||
// mqtt tags must not have spaces
|
||||
MAKE_PSTR_LIST(tag_none, "")
|
||||
MAKE_PSTR_LIST(tag_heartbeat, "")
|
||||
MAKE_PSTR_LIST(tag_boiler_data_ww, "dhw", "WW", "dhw", "VV", "CWU", "dhw", "ecs")
|
||||
MAKE_PSTR_LIST(tag_device_data, "")
|
||||
MAKE_PSTR_LIST(tag_device_data_ww, "dhw", "WW", "dhw", "VV", "CWU", "dhw", "ecs")
|
||||
MAKE_PSTR_LIST(tag_hc1, "hc1", "HK1", "hc1", "VK1", "OG1", "hc1", "hc1")
|
||||
MAKE_PSTR_LIST(tag_hc2, "hc2", "HK2", "hc2", "VK2", "OG2", "hc2", "hc2")
|
||||
MAKE_PSTR_LIST(tag_hc3, "hc3", "HK3", "hc3", "VK3", "OG3", "hc3", "hc3")
|
||||
MAKE_PSTR_LIST(tag_hc4, "hc4", "HK4", "hc4", "VK4", "OG4", "hc4", "hc4")
|
||||
MAKE_PSTR_LIST(tag_hc5, "hc5", "HK5", "hc5", "VK5", "OG5", "hc5", "hc5")
|
||||
MAKE_PSTR_LIST(tag_hc6, "hc6", "HK6", "hc6", "vk6", "OG6", "hc6", "hc6")
|
||||
MAKE_PSTR_LIST(tag_hc7, "hc7", "HK7", "hc7", "VK7", "OG7", "hc7", "hc7")
|
||||
MAKE_PSTR_LIST(tag_hc8, "hc8", "HK8", "hc8", "VK8", "OG8", "hc8", "hc8")
|
||||
MAKE_PSTR_LIST(tag_wwc1, "wwc1", "WWK1", "wwc1", "VVK1", "CWU1", "wwc1", "wwc1")
|
||||
MAKE_PSTR_LIST(tag_wwc2, "wwc2", "WWK2", "wwc2", "VVK2", "CWU2", "wwc2", "wwc2")
|
||||
MAKE_PSTR_LIST(tag_wwc3, "wwc3", "WWK3", "wwc3", "VVK3", "CWU3", "wwc3", "wwc3")
|
||||
MAKE_PSTR_LIST(tag_wwc4, "wwc4", "WWK4", "wwc4", "VVK4", "CWU4", "wwc4", "wwc4")
|
||||
MAKE_PSTR_LIST(tag_wwc5, "wwc5", "WWK5", "wwc5", "VVK5", "CWU5", "wwc5", "wwc5")
|
||||
MAKE_PSTR_LIST(tag_wwc6, "wwc6", "WWK6", "wwc6", "VVK6", "CWU6", "wwc6", "wwc6")
|
||||
MAKE_PSTR_LIST(tag_wwc7, "wwc7", "WWK7", "wwc7", "VVK7", "CWU7", "wwc7", "wwc7")
|
||||
MAKE_PSTR_LIST(tag_wwc8, "wwc8", "WWK8", "wwc8", "VVK8", "CWU8", "wwc8", "wwc8")
|
||||
MAKE_PSTR_LIST(tag_wwc9, "wwc9", "WWK9", "wwc9", "VVK9", "CWU9", "wwc9", "wwc9")
|
||||
MAKE_PSTR_LIST(tag_wwc10, "wwc10", "WWK10", "wwc10", "VVK10", "CWU10", "wwc10", "wwc10")
|
||||
MAKE_PSTR_LIST(tag_ahs1, "ahs1", "AHQ1", "ahs1", "AVK1", "AŹC1", "ahs1", "ahs1")
|
||||
MAKE_PSTR_LIST(tag_hs1, "hs1", "hs1", "hs1", "VK1", "ŹC1", "hs1", "hs1")
|
||||
MAKE_PSTR_LIST(tag_hs2, "hs2", "hs2", "hs2", "VK2", "ŹC2", "hs2", "hs2")
|
||||
MAKE_PSTR_LIST(tag_hs3, "hs3", "hs3", "hs3", "VK3", "ŹC3", "hs3", "hs3")
|
||||
MAKE_PSTR_LIST(tag_hs4, "hs4", "hs4", "hs4", "VK4", "ŹC4", "hs4", "hs4")
|
||||
MAKE_PSTR_LIST(tag_hs5, "hs5", "hs5", "hs5", "VK5", "ŹC5", "hs5", "hs5")
|
||||
MAKE_PSTR_LIST(tag_hs6, "hs6", "hs6", "hs6", "VK6", "ŹC6", "hs6", "hs6")
|
||||
MAKE_PSTR_LIST(tag_hs7, "hs7", "hs7", "hs7", "VK7", "ŹC7", "hs7", "hs7")
|
||||
MAKE_PSTR_LIST(tag_hs8, "hs8", "hs8", "hs8", "VK8", "ŹC8", "hs8", "hs8")
|
||||
MAKE_PSTR_LIST(tag_hs9, "hs9", "hs9", "hs9", "VK9", "ŹC9", "hs9", "hs9")
|
||||
MAKE_PSTR_LIST(tag_hs10, "hs10", "hs10", "hs10", "VK10", "ŹC10", "hs10", "hs10")
|
||||
MAKE_PSTR_LIST(tag_hs11, "hs11", "hs11", "hs11", "VK11", "ŹC11", "hs11", "hs11")
|
||||
MAKE_PSTR_LIST(tag_hs12, "hs12", "hs12", "hs12", "VK12", "ŹC12", "hs12", "hs12")
|
||||
MAKE_PSTR_LIST(tag_hs13, "hs13", "hs13", "hs13", "VK13", "ŹC13", "hs13", "hs13")
|
||||
MAKE_PSTR_LIST(tag_hs14, "hs14", "hs14", "hs14", "VK14", "ŹC14", "hs14", "hs14")
|
||||
MAKE_PSTR_LIST(tag_hs15, "hs15", "hs15", "hs15", "VK15", "ŹC15", "hs15", "hs15")
|
||||
MAKE_PSTR_LIST(tag_hs16, "hs16", "hs16", "hs16", "VK16", "ŹC16", "hs16", "hs16")
|
||||
|
||||
// General
|
||||
MAKE_PSTR_LIST(on, "on", "an", "aan", "på", "włączono", "på", "on")
|
||||
MAKE_PSTR_LIST(off, "off", "aus", "uit", "av", "wyłączono", "av", "off")
|
||||
MAKE_PSTR_LIST(ON, "ON", "AN", "AAN", "PÅ", "wł.", "PÅ", "ON")
|
||||
MAKE_PSTR_LIST(OFF, "OFF", "AUS", "UIT", "AV", "wył.", "AV", "OFF")
|
||||
|
||||
// Unit Of Measurement mapping - maps to DeviceValueUOM_s in emsdevice.cpp
|
||||
// uom - also used with HA see https://github.com/home-assistant/core/blob/d7ac4bd65379e11461c7ce0893d3533d8d8b8cbf/homeassistant/const.py#L384
|
||||
MAKE_PSTR_LIST(minutes, "minutes", "Minuten", "Minuten", "Minuter", "minut", "Minutter", "minutes")
|
||||
MAKE_PSTR_LIST(hours, "hours", "Stunden", "Uren", "Timmar", "godzin", "Timer", "heures")
|
||||
MAKE_PSTR_LIST(days, "days", "Tage", "Dagen", "Dagar", "dni", "Dager", "jours")
|
||||
MAKE_PSTR_LIST(seconds, "seconds", "Sekunden", "Seconden", "Sekunder", "sekund", "Sekunder", "secondes")
|
||||
|
||||
// Enum translations
|
||||
// general
|
||||
MAKE_PSTR_LIST(day_mo, "mo", "Mo", "Mo", "Må", "poniedziałek", "Ma", "lun")
|
||||
MAKE_PSTR_LIST(day_tu, "tu", "Di", "Di", "Ti", "wtorek", "Ti", "mar")
|
||||
MAKE_PSTR_LIST(day_we, "we", "Mi", "Wo", "On", "środa", "On", "mer")
|
||||
MAKE_PSTR_LIST(day_th, "th", "Do", "Do", "To", "czwartek", "To", "jeu")
|
||||
MAKE_PSTR_LIST(day_fr, "fr", "Fr", "Vr", "Fr", "piątek", "Fr", "ven")
|
||||
MAKE_PSTR_LIST(day_sa, "sa", "Sa", "Za", "Lö", "sobota", "Lø", "sam")
|
||||
MAKE_PSTR_LIST(day_su, "su", "So", "Zo", "Sö", "niedziela", "Sø", "dim")
|
||||
MAKE_PSTR_LIST(all, "all", "Alle", "Alle", "Alla", "codziennie", "alle", "tous")
|
||||
MAKE_PSTR_LIST(own_1, "own 1", "Eigen 1", "Eigen 1", "Egen 1", "własny 1", "Egen 1", "propre 1")
|
||||
MAKE_PSTR_LIST(family, "family", "Familie", "Familie", "Familj", "rodzina", "familie", "famille")
|
||||
MAKE_PSTR_LIST(morning, "morning", "Morgends", "'s ochtends", "Morgon", "zmiana 1", "morgen", "matin")
|
||||
MAKE_PSTR_LIST(evening, "evening", "Abends", "'s avonds", "Kväll", "zmiana 2", "kveld", "soir")
|
||||
MAKE_PSTR_LIST(seniors, "seniors", "Senioren", "Senioren", "Seniorer", "senior", "seniorer", "séniors")
|
||||
MAKE_PSTR_LIST(no, "no", "nein", "nee", "nej", "nie", "nei", "non")
|
||||
MAKE_PSTR_LIST(new, "new", "Neu", "Nieuw", "Ny", "nowy", "ny", "nouveau")
|
||||
MAKE_PSTR_LIST(own_2, "own 2", "Eigen 2", "Eigen 2", "Egen 2", "własny 2", "egen 2", "propre 2")
|
||||
MAKE_PSTR_LIST(singles, "singles", "Singles", "Singles", "Singlar", "osoba samotna", "single", "seuls")
|
||||
MAKE_PSTR_LIST(am, "am", "Vormittag", "Ochtend", "Förmiddag", "do południa", "formiddag", "matin")
|
||||
MAKE_PSTR_LIST(pm, "pm", "Nachmittag", "Namiddag", "Eftermiddag", "po południu", "ettermiddag", "après-midi")
|
||||
MAKE_PSTR_LIST(midday, "midday", "Mittag", "Middag", "Middag", "południe", "middag", "midi")
|
||||
MAKE_PSTR_LIST(unknown, "unknown", "Unbekannt", "Onbekend", "Okänt", "nieznany", "ukjent", "inconnu")
|
||||
MAKE_PSTR_LIST(flat, "flat", "flach", "vlak", "Platt", "płaski", "flat", "plat")
|
||||
MAKE_PSTR_LIST(vacuum, "vacuum", "Vakuum", "vacuum", "Vakuum", "próżnia", "vakum", "vide")
|
||||
MAKE_PSTR_LIST(co2_optimized, "co2 optimized", "CO2 optimiert", "CO2 geoptimaliseerd", "CO2-optimerad", "optymalizacja CO2", "co2 optimalisert", "optimisé en CO2")
|
||||
MAKE_PSTR_LIST(cost_optimized, "cost optimized", "kostenoptimiert", "kosten geoptimaliseerd", "kostnadsoptimerad", "optymalizacja kosztów", "kostnadsoptimalisert", "optimisé en coût")
|
||||
MAKE_PSTR_LIST(outside_temp_switched, "outside temp switched", "Außentemp. gesteuert", "Buitentemp. gestuurd", "Utomhustemp korrigerad", "temperatura zewn. przeł.", "utetemp optimalisert", "contrôle par temp. ext.")
|
||||
MAKE_PSTR_LIST(co2_cost_mix, "co2 cost mix", "Kostenmix", "Kostenmix", "Kostnadsmix", "mieszany koszt CO2", "", "coût mixte CO2") // TODO translate
|
||||
MAKE_PSTR_LIST(analog, "analog", "analog", "analoog", "analog", "analogowy", "analog", "analogique")
|
||||
MAKE_PSTR_LIST(normal, "normal", "normal", "normaal", "normal", "normalny", "normal", "normal")
|
||||
MAKE_PSTR_LIST(blocking, "blocking", "Blockierung", "Blokkering", "Blockering", "blokowanie", "blokkering", "bloquant")
|
||||
MAKE_PSTR_LIST(extern, "extern", "extern", "extern", "extern", "zewnętrzny", "ekstern", "externe")
|
||||
MAKE_PSTR_LIST(intern, "intern", "intern", "intern", "intern", "wewnętrzny", "intern", "interne")
|
||||
MAKE_PSTR_LIST(lower, "lower", "niedirger", "lager", "lägre", "mniejszy", "nedre", "inférieur")
|
||||
MAKE_PSTR_LIST(error, "error", "Fehler", "error", "Fel", "błąd", "", "erreur") // TODO translate
|
||||
MAKE_PSTR_LIST(na, "n/a", "n/a", "n/a", "n/a", "nd.", "", "n/c") // TODO translate
|
||||
|
||||
// boiler
|
||||
MAKE_PSTR_LIST(time, "time", "Zeit", "Tijd", "Tid", "godzina", "tid", "heure")
|
||||
MAKE_PSTR_LIST(date, "date", "Datum", "Datum", "Datum", "data", "dato", "date")
|
||||
MAKE_PSTR_LIST(continuous, "continuous", "kontinuierlich", "continue", "kontinuerlig", "ciągły", "kontinuerlig", "continu")
|
||||
MAKE_PSTR_LIST(3wayvalve, "3-way valve", "3-Wege Ventil", "3-weg klep", "trevägsventil", "zawór 3-drogowy", "treveisventil", "vanne 3 voies")
|
||||
MAKE_PSTR_LIST(chargepump, "chargepump", "Ladepumpe", "laadpomp", "laddpump", "pompa ładująca", "ladepumpe", "pompe de charge")
|
||||
MAKE_PSTR_LIST(hot, "hot", "Heiß", "Heet", "Het", "gorący", "het", "chaud")
|
||||
MAKE_PSTR_LIST(high_comfort, "high comfort", "gehobener Komfort", "Verhoogd comfort", "Förhöjd komfort", "wysoki komfort", "høy komfort", "comfort")
|
||||
MAKE_PSTR_LIST(eco, "eco", "Eco", "Eco", "Eko", "eko", "øko", "éco")
|
||||
MAKE_PSTR_LIST(intelligent, "intelligent", "Intelligent", "Intelligent", "Intelligent", "inteligentny", "intelligent", "intelligent")
|
||||
MAKE_PSTR_LIST(flow, "flow", "Durchfluss", "Volumestroom", "Flöde", "przepływ", "strømme", "débit")
|
||||
MAKE_PSTR_LIST(manual, "manual", "Manuell", "Hamdmatig", "Manuell", "ręczny", "manuell", "manuel")
|
||||
MAKE_PSTR_LIST(buffer, "buffer", "Speicher", "Buffer", "Buffert", "bufor", "buffer", "buffer")
|
||||
MAKE_PSTR_LIST(bufferedflow, "buffered flow", "Durchlaufspeicher", "Doorstroombuffer", "Buffertflöde", "przepływ buforowany", "bufret strømning", "") // TODO translate
|
||||
MAKE_PSTR_LIST(layeredbuffer, "layered buffer", "Schichtspeicher", "Gelaagde buffer", "Lagrad buffert", "bufor warstwowy", "lagdelt buffer", "") // TODO translate
|
||||
MAKE_PSTR_LIST(maintenance, "maintenance", "Wartung", "Onderhoud", "Underhåll", "przegląd", "vedlikehold", "maintenance")
|
||||
MAKE_PSTR_LIST(heating, "heating", "Heizen", "Verwarmen", "Uppvärmning", "ogrzewanie", "oppvarming", "chauffage")
|
||||
MAKE_PSTR_LIST(cooling, "cooling", "Kühlen", "Koelen", "Kyler", "chłodzenie", "kjøling", "refroidissement")
|
||||
MAKE_PSTR_LIST(disinfecting, "disinfecting", "Desinfizieren", "Desinfecteren", "Desinficerar", "dezynfekcja termiczna", "desinfisering", "désinfection")
|
||||
MAKE_PSTR_LIST(no_heat, "no heat", "keine Wärme", "Geen warmte", "Ingen värme", "brak ciepła", "ingen varme", "pas de chauffage")
|
||||
MAKE_PSTR_LIST(heatrequest, "heat request", "Wärmeanforderung", "Verwarmignsverzoek", "Värmeförfrågan", "zapotrzebowanie na ciepło", "varmeforespørsel", "demande de chauffage")
|
||||
MAKE_PSTR_LIST(valve, "valve", "Ventil", "Klep", "Ventil", "zawór", "ventil", "valve")
|
||||
MAKE_PSTR_LIST(proportional, "proportional", "", "", "", "", "", "", "") // TODO translate
|
||||
MAKE_PSTR_LIST(deltaP1, "deltaP-1", "", "", "", "", "", "", "") // TODO translate
|
||||
MAKE_PSTR_LIST(deltaP2, "deltaP-2", "", "", "", "", "", "", "") // TODO translate
|
||||
MAKE_PSTR_LIST(deltaP3, "deltaP-3", "", "", "", "", "", "", "") // TODO translate
|
||||
MAKE_PSTR_LIST(deltaP4, "deltaP-4", "", "", "", "", "", "", "") // TODO translate
|
||||
|
||||
// heatpump
|
||||
MAKE_PSTR_LIST(none, "none", "keine", "geen", "ingen", "brak", "ingen", "aucun")
|
||||
MAKE_PSTR_LIST(hot_water, "hot water", "Warmwasser", "warm water", "varmvatten", "c.w.u.", "varmtvann", "eau chaude")
|
||||
MAKE_PSTR_LIST(pool, "pool", "Pool", "zwembad", "pool", "basen", "basseng", "piscine")
|
||||
MAKE_PSTR_LIST(outside_temp_alt, "outside temperature alt.", "Außentemp. alternativ", "", "Alternativ utomhustemp.", "temp. zewn. alternat.", "", "température extérieure alternative") // TODO translate
|
||||
MAKE_PSTR_LIST(outside_temp_par, "outside temperature parallel", "Außentemp. parallel", "", "Parallell utomhustemp.", "temp. zewn. równoległa", "", "température extérieure parallèle") // TODO translate
|
||||
MAKE_PSTR_LIST(hp_prefered, "heatpump prefered", "Wärmepumpe bevorzugt", "", "Värmepump föredraget", "preferowana pompa ciepła", "", "pompe à chaleur préférée") // TODO translate
|
||||
MAKE_PSTR_LIST(boiler_only, "boiler only", "nur Kessel", "", "Värmepanna enbart", "tylko kocioł", "", "chaudière uniquement") // TODO translate
|
||||
MAKE_PSTR_LIST(reduced_output, "reduced output", "Reduzierte Leistung", "", "Reducerad produktion", "zmniejszona wydajność", "", "sortie réduite") // TODO translate
|
||||
MAKE_PSTR_LIST(switchoff, "switch off hp", "WP ausschalten", "", "Värmepump avstängd", "wyłącz pompę ciepła", "", "éteindre la PAC") // TODO translate
|
||||
MAKE_PSTR_LIST(perm, "perm. reduced", "perm. reduziert", "", "Permanent reducerad", "stale zmniejszona wydajność", "", "réduction permanente") // TODO translate
|
||||
|
||||
// thermostat
|
||||
MAKE_PSTR_LIST(seltemp, "selTemp", "Solltemperatur", "Doeltemperatuur", "Börtemperatur", "temperatura zadana", "innstilt temperatur", "consigne température")
|
||||
MAKE_PSTR_LIST(roomtemp, "roomTemp", "Raumtemperatur", "Kamertemperatuur", "Rumstemperatur", "temperatura w pomieszczeniu", "romstemperatur", "température de la pièce")
|
||||
MAKE_PSTR_LIST(own_prog, "own prog", "Eigenprog.", "Eigen prog.", "Egen prog.", "program własny", "eget prog.", "programme propre")
|
||||
MAKE_PSTR_LIST(std_prog, "std prog", "Standardprog.", "Standaard prog.", "Standardprog.", "program standardowy", "standardprog.", "programme standard")
|
||||
MAKE_PSTR_LIST(light, "light", "Leicht", "Licht", "Lätt", "lekki", "lett", "léger")
|
||||
MAKE_PSTR_LIST(medium, "medium", "Mittel", "Middel", "Medel", "średni", "medium", "medium")
|
||||
MAKE_PSTR_LIST(heavy, "heavy", "Schwer", "Zwaar", "Tung", "ciężki", "tung", "lourd")
|
||||
MAKE_PSTR_LIST(start, "start", "Start", "Start", "Start", "start", "start", "début")
|
||||
MAKE_PSTR_LIST(heat, "heat", "Heizen", "Verwarmen", "Värme", "ciepło", "varmer", "chaleur")
|
||||
MAKE_PSTR_LIST(hold, "hold", "Halten", "Pauzeren", "Paus", "pauza", "pause", "pause")
|
||||
MAKE_PSTR_LIST(cool, "cool", "Kühlen", "Koelen", "Kyla", "zimno", "kjøler", "froid")
|
||||
MAKE_PSTR_LIST(end, "end", "Ende", "Einde", "Slut", "koniec", "slutt", "fin")
|
||||
MAKE_PSTR_LIST(german, "german", "Deutsch", "Duits", "Tyska", "niemiecki", "tysk", "allemand")
|
||||
MAKE_PSTR_LIST(dutch, "dutch", "Niederländisch", "Nederlands", "Nederländska", "niderlandzki", "nederlandsk", "néerlandais")
|
||||
MAKE_PSTR_LIST(french, "french", "Französisch", "Frans", "Franska", "francuski", "fransk", "français")
|
||||
MAKE_PSTR_LIST(italian, "italian", "Italienisch", "Italiaans", "Italienska", "włoski", "italiensk", "italien")
|
||||
MAKE_PSTR_LIST(high, "high", "hoch", "hoog", "Hög", "wysoki", "", "haut") // TODO translate
|
||||
MAKE_PSTR_LIST(low, "low", "niedrig", "laag", "Låg", "niski", "lav", "bas")
|
||||
MAKE_PSTR_LIST(radiator, "radiator", "Heizkörper", "Radiator", "Radiator", "grzejniki", "radiator", "radiateur")
|
||||
MAKE_PSTR_LIST(convector, "convector", "Konvektor", "Convector", "Konvektor", "konwektory", "konvektor", "convecteur")
|
||||
MAKE_PSTR_LIST(floor, "floor", "Fussboden", "Vloer", "Golv", "podłoga", "gulv", "sol")
|
||||
MAKE_PSTR_LIST(summer, "summer", "Sommer", "Zomer", "Sommar", "lato", "sommer", "été")
|
||||
MAKE_PSTR_LIST(winter, "winter", "Winter", "Winter", "Vinter", "zima", "vinter", "hiver")
|
||||
MAKE_PSTR_LIST(outdoor, "outdoor", "Außen", "Buiten", "Utomhus", "temp. zewnętrzna", "utendørs", "extérieur")
|
||||
MAKE_PSTR_LIST(room, "room", "Raum", "Kamer", "Rum", "temp. w pomieszczeniu", "", "pièce") // TODO translate
|
||||
MAKE_PSTR_LIST(room_outdoor, "room outdoor", "Raum+Außen", "Kamer+Buiten", "Rum+Ute", "temp. w pom. i zewn.", "rom utendørs", "pièce extérieure")
|
||||
MAKE_PSTR_LIST(power, "power", "Leistung", "Vermogen", "Effekt", "moc", "effekt", "puissance")
|
||||
MAKE_PSTR_LIST(constant, "constant", "konstant", "constant", "Konstant", "stały", "konstant", "constant")
|
||||
MAKE_PSTR_LIST(simple, "simple", "einfach", "simpel", "enkel", "prosty", "enkel", "simple")
|
||||
MAKE_PSTR_LIST(optimized, "optimized", "optimiert", "geoptimaliseerd", "optimerad", "zoptymalizowany", "optimalisert", "optimisé")
|
||||
MAKE_PSTR_LIST(nofrost, "nofrost", "Frostschutz", "Vorstbescherming", "Frostskydd", "ochrona przed zamarzaniem", "frostsikring", "protection gel")
|
||||
MAKE_PSTR_LIST(defrost, "defrost", "Abtauen", "ontdooien", "avfrostning", "rozmrażać", "tine", "dégivrage")
|
||||
MAKE_PSTR_LIST(comfort, "comfort", "Komfort", "Comfort", "Komfort", "komfort", "komfort", "comfort")
|
||||
MAKE_PSTR_LIST(night, "night", "Nacht", "Nacht", "Natt", "noc", "natt", "nuit")
|
||||
MAKE_PSTR_LIST(day, "day", "Tag", "Dag", "Dag", "dzień", "dag", "jour")
|
||||
MAKE_PSTR_LIST(holiday, "holiday", "Urlaub", "Vakantie", "Helgdag", "urlop?", "ferie", "vacances")
|
||||
MAKE_PSTR_LIST(reduce, "reduce", "reduziert", "gereduceerd", "Reducera", "zredukowany", "redusere", "réduit")
|
||||
MAKE_PSTR_LIST(noreduce, "no reduce", "unreduziert", "niet gerduceerd", "oreducerad", "bez redukcji", "ingen reduksjon", "pas de réduction")
|
||||
MAKE_PSTR_LIST(offset, "offset", "Anhebung", "offset", "Förskutning", "przesunięcie", "kompensasjon", "offset")
|
||||
MAKE_PSTR_LIST(design, "design", "Auslegung", "Ontwero", "Design", "projekt", "design", "design")
|
||||
MAKE_PSTR_LIST(minflow, "min flow", "min. Durchfluss", "Min. Doorstroom", "Min flöde", "minimalny przepływ", "min strømming", "flux min")
|
||||
MAKE_PSTR_LIST(maxflow, "max flow", "max. Durchfluss", "Max. Doorstroom", "Max flöde", "maksymalny przepływ", "maks strømming", "flux max")
|
||||
MAKE_PSTR_LIST(fast, "fast", "schnell", "snel", "snabb", "szybkie", "hurtig", "rapide")
|
||||
MAKE_PSTR_LIST(slow, "slow", "langsam", "langzaam", "långsam", "powolne", "langsom", "lent")
|
||||
MAKE_PSTR_LIST(internal_temperature, "internal temperature", "Interne Temperatur", "Interne Temperatuur", "Interntemperatur", "temperatura wewnętrzna", "interntemperatur", "température interne")
|
||||
MAKE_PSTR_LIST(internal_setpoint, "internal setpoint", "Interner Sollwert", "Interne Streeftemperatuur", "Internt börvärde", "nastawa wewnętrzna", "internt settpunkt", "consigne interne")
|
||||
MAKE_PSTR_LIST(external_temperature, "external temperature", "Externe Temperatur", "Externe Temperatuur", "Extern temperatur", "temperatura zewnętrzna", "ekstern temperatur", "température externe")
|
||||
MAKE_PSTR_LIST(burner_temperature, "burner temperature", "Brennertemperatur", "Brander Temperuur", "Brännartemperatur", "temperatura palnika", "brennertemperatur", "température du brûleur")
|
||||
MAKE_PSTR_LIST(ww_temperature, "ww temperature", "Wassertemperatur", "Watertemperatuur", "Vattentemperatur", "temperatura c.w.u.", "vanntemperatur", "température de l'eau")
|
||||
MAKE_PSTR_LIST(smoke_temperature, "smoke temperature", "Abgastemperatur", "Buitentemperatuur", "Rökgastemperatur", "temperatura dymu", "røykgasstemperatur", "température des gaz d'échappement")
|
||||
MAKE_PSTR_LIST(weather_compensated, "weather compensated", "Wetter kompensiert", "Weer gecompenseerd", "Väderkompenserad", "skompensow. pogodą", "værkompensert", "compensation par l'extérieur")
|
||||
MAKE_PSTR_LIST(outside_basepoint, "outside basepoint", "Basispunkt Außentemp.", "Buiten basispunt", "Utomhus baspunkt", "temp. zewn. z pkt. pocz.", "utendørs basispunkt", "point de base temp. ext.")
|
||||
MAKE_PSTR_LIST(functioning_mode, "functioning mode", "Funktionsweise", "Functiemodus", "Driftläge", "tryb pracy", "driftsmodus", "mode de fonctionnement")
|
||||
|
||||
// mixer
|
||||
MAKE_PSTR_LIST(stopped, "stopped", "gestoppt", "gestopt", "stoppad", "zatrzymany", "stoppet", "arrêté")
|
||||
MAKE_PSTR_LIST(opening, "opening", "öffnen", "openen", "öppnar", "otwieranie", "åpner", "ouverture")
|
||||
MAKE_PSTR_LIST(closing, "closing", "schließen", "sluiten", "stänger", "zamykanie", "stenger", "fermeture")
|
||||
MAKE_PSTR_LIST(open, "open", "offen", "Open", "Öppen", "otwórz", "åpen", "ouvert")
|
||||
MAKE_PSTR_LIST(close, "close", "geschlossen", "Gesloten", "Stängd", "zamknij", "stengt", "fermé")
|
||||
|
||||
// solar ww
|
||||
MAKE_PSTR_LIST(cyl1, "cyl 1", "Zyl_1", "Cil 1", "Cyl 1", "cyl 1", "cyl 1", "cyl 1")
|
||||
MAKE_PSTR_LIST(cyl2, "cyl 2", "Zyl_2", "Cil 2", "Cyl 2", "cyl 2", "cyl 2", "cyl 2")
|
||||
|
||||
// Entity translations
|
||||
// Boiler
|
||||
MAKE_PSTR_LIST(wwtapactivated, "wwtapactivated", "turn on/off", "Durchlauferhitzer aktiv", "zet aan/uit", "på/av", "system przygotowywania", "slå på/av", "ecs activée")
|
||||
MAKE_PSTR_LIST(reset, "reset", "Reset", "Reset", "Reset", "Nollställ", "kasowanie komunikatu", "nullstill", "reset")
|
||||
MAKE_PSTR_LIST(oilPreHeat, "oilpreheat", "oil preheating", "Ölvorwärmung", "Olie voorverwarming", "Förvärmning olja", "podgrzewanie oleju", "oljeforvarming", "préchauffage de l'huile")
|
||||
MAKE_PSTR_LIST(heatingActive, "heatingactive", "heating active", "Heizen aktiv", "Verwarming actief", "Uppvärmning aktiv", "c.o. aktywne", "oppvarming aktiv", "chauffage actif")
|
||||
MAKE_PSTR_LIST(tapwaterActive, "tapwateractive", "tapwater active", "Warmwasser aktiv", "Warm water actief", "Varmvatten aktiv", "c.w.u. aktywne", "varmtvann aktiv", "eau chaude active")
|
||||
MAKE_PSTR_LIST(selFlowTemp, "selflowtemp", "selected flow temperature", "Sollwert Vorlauftemperatur", "Ingestelde aanvoertemperatuur", "Börvärde Flödestemperatur", "wybrana temperatura zasilania", "valgt turtemperatur", "température de flux selectionnée")
|
||||
MAKE_PSTR_LIST(selBurnPow, "selburnpow", "burner selected max power", "Sollwert Brennerleistung", "Ingestelde maximale brandervermogen", "Brännare vald maxeffekt", "wybrana moc źródła ciepła", "settpunkt brennerkapasitet", "puissance max du brûleur selectionnée")
|
||||
MAKE_PSTR_LIST(absBurnPow, "absburnpow", "burner current power (absolute)", "Brennerleistung (absolut)", "Brandervermogen (abs)", "Värmepanna aktuell effekt (abs)", "aktualna moc źródła ciepła (absolutna)", "brennereffekt", "puissance du brûleur actuelle (abs)")
|
||||
MAKE_PSTR_LIST(heatingPumpMod, "heatingpumpmod", "heating pump modulation", "Heizungspumpe 1 Modulation", "Modulatie verwarmingspomp", "Modulering Värmepump", "wysterowanie pompy c.o.", "varmepumpemodulering", "modulation de la pompe à chaleur")
|
||||
MAKE_PSTR_LIST(outdoorTemp, "outdoortemp", "outside temperature", "Aussentemperatur", "Buitentemperatuur", "Utomhustemperatur", "temperatura zewnętrzna", "utetemperatur", "température extérieure")
|
||||
MAKE_PSTR_LIST(curFlowTemp, "curflowtemp", "current flow temperature", "aktuelle Vorlauftemperatur", "Huidige aanvoertemperatuur", "Flödestemperatur", "temperatura zasilania", "aktuell strømmetemperatur", "température actuelle du flux")
|
||||
MAKE_PSTR_LIST(retTemp, "rettemp", "return temperature", "Rücklauftemperatur", "Retourtemperatuur", "Returtemperatur", "temperatura powrotu", "returtemperatur", "température de retour")
|
||||
MAKE_PSTR_LIST(switchTemp, "switchtemp", "mixing switch temperature", "Mischer Schalttemperatur", "Mixer temperatuur", "Blandartemperatur", "temperatura przełączania mieszacza", "Blandertemperatur", "température de bascule du mélangeur")
|
||||
MAKE_PSTR_LIST(sysPress, "syspress", "system pressure", "Systemdruck", "Systeemdruk", "Systemtryck", "ciśnienie w systemie", "systemtrykk", "pression du système")
|
||||
MAKE_PSTR_LIST(boilTemp, "boiltemp", "actual boiler temperature", "Kesseltemperatur", "Keteltemperatuur", "Temperatur Värmepanna", "temperatura zasobnika", "Temperatur Värmepanna", "température de la chaudière")
|
||||
MAKE_PSTR_LIST(exhaustTemp, "exhausttemp", "exhaust temperature", "Abgastemperatur", "Uitlaattemperatuur", "Avgastemperatur", "temperatura spalin", "røykgasstemp", "température des gaz d'échappement")
|
||||
MAKE_PSTR_LIST(burnGas, "burngas", "gas", "Gas", "Gas", "Gas", "gaz", "gass", "gaz")
|
||||
MAKE_PSTR_LIST(burnGas2, "burngas2", "gas stage 2", "Gas Stufe 2", "gas fase 2", "Gas Fas 2", "gaz 2 stopień", "gass 2", "gaz état 2")
|
||||
MAKE_PSTR_LIST(flameCurr, "flamecurr", "flame current", "Flammenstrom", "Vlammenstroom", "Lågström", "prąd palnika", "flammestrøm", "courrant de flamme")
|
||||
MAKE_PSTR_LIST(heatingPump, "heatingpump", "heating pump", "Heizungspumpe", "Verwarmingspomp", "Värmepump", "pompa ciepła", "varmepumpe", "pompe à chaleur")
|
||||
MAKE_PSTR_LIST(fanWork, "fanwork", "fan", "Gebläse", "Ventilator", "Fläkt", "wentylator", "vifte", "ventilateur")
|
||||
MAKE_PSTR_LIST(ignWork, "ignwork", "ignition", "Zündung", "Ontsteking", "Tändning", "zapłon", "tenning", "ignition")
|
||||
MAKE_PSTR_LIST(heatingActivated, "heatingactivated", "heating activated", "Heizen aktiviert", "Verwarmen geactiveerd", "Uppvärmning aktiv", "system c.o.", "oppvarming aktivert", "chauffage activé")
|
||||
MAKE_PSTR_LIST(heatingTemp, "heatingtemp", "heating temperature", "Heizungstemperatur", "Verwarmingstemperatuur", "Uppvärmningstemperatur", "temperatura grzania", "oppvarmingstemperatur", "température de chauffage")
|
||||
MAKE_PSTR_LIST(pumpModMax, "pumpmodmax", "boiler pump max power", "Kesselpumpen Maximalleistung", "Ketelpomp max vermogen", "Värmepannepump max effekt", "maksymalna moc pompy zasobnika", "varmepumpe maks effekt", "puissance max pompe à chaleur")
|
||||
MAKE_PSTR_LIST(pumpModMin, "pumpmodmin", "boiler pump min power", "Kesselpumpen Minmalleistung", "Ketelpomp min vermogen", "Värmepannepump min effekt", "minimalna moc pompy zasobnika", "varmepumpe min effekt", "puissance min pompe à chaleur")
|
||||
MAKE_PSTR_LIST(pumpDelay, "pumpdelay", "pump delay", "Pumpennachlaufzeit", "Pomp nalooptijd", "Pumpfördröjning", "opóźnienie pompy", "pumpeforsinkelse", "délai d'attente pompe")
|
||||
MAKE_PSTR_LIST(burnMinPeriod, "burnminperiod", "burner min period", "Antipendelzeit", "Antipendeltijd", "Värmepanna Min Period", "minimalny czas pracy palnika", "varmekjele min periode", "délai d'attente du brûleur")
|
||||
MAKE_PSTR_LIST(burnMinPower, "burnminpower", "burner min power", "minimale Brennerleistung", "Minimaal brandervermogen", "Värmepanna Min Effekt", "minimalna moc źródła ciepła", "varmekjele min effekt", "puissance min brûleur")
|
||||
MAKE_PSTR_LIST(burnMaxPower, "burnmaxpower", "burner max power", "maximale Brennerleistung", "Maximaal brandervermogen", "Värmepanna Max Effekt", "maksymalna moc źródła ciepła", "varmekjele maks effekt", "puissance max brûleur")
|
||||
MAKE_PSTR_LIST(boilHystOn, "boilhyston", "hysteresis on temperature", "Einschaltdifferenz", "ketel aan hysterese verschil", "Hysteres aktiveringstemperatur", "histereza załączania", "hysterese på temperatur", "hysteresis température d'allumage")
|
||||
MAKE_PSTR_LIST(boilHystOff, "boilhystoff", "hysteresis off temperature", "Ausschaltdifferenz", "ketel uit hysterese verschil", "Hysteres inaktiveringstemperatur", "histereza wyłączania", "hysterese av temperatur", "hysteresis température d'extinction")
|
||||
MAKE_PSTR_LIST(boil2HystOn, "boil2hyston", "hysteresis stage 2 on temperature", "Einschaltdifferenz Stufe 2", "ketel aan hysterese verschil 2", "Hysteres aktiveringstemperatur 2", "histereza załączania stopnia 2", "", "hysteresis état 2 température d'allumage") // TODO translate
|
||||
MAKE_PSTR_LIST(boil2HystOff, "boil2hystoff", "hysteresis stage 2 off temperature", "Ausschaltdifferenz Stufe 2", "ketel uit hysterese verschil 2", "Hysteres inaktiveringstemperatur 2", "histereza wyłączania stopnia 2", "", "hysteresis état 2 température d'extinction") // TODO translate
|
||||
MAKE_PSTR_LIST(setFlowTemp, "setflowtemp", "set flow temperature", "Sollwert Vorlauftemperatur", "Ingestelde aanvoertemperatuur", "Börvärde Flödestemperatur", "zadana temperatura zasilania", "innstilt strømmetemperatur", "température du flux définie")
|
||||
MAKE_PSTR_LIST(setBurnPow, "setburnpow", "burner set power", "Sollwert Brennerleistung", "Ingesteld brandervermogen", "Värmepanna vald Effekt", "zadana moc palnika", "varmekjele valgt effekt", "puissance du brûleur définie")
|
||||
MAKE_PSTR_LIST(curBurnPow, "curburnpow", "burner current power", "Brennerleistung", "Brandervermogen", "Värmepanna aktuell effekt", "aktualna moc źródła ciepła", "brennereffekt", "puissance du brûleur actuelle")
|
||||
MAKE_PSTR_LIST(burnStarts, "burnstarts", "burner starts", "Brenner Starts", "Aantal brander starts", "Värmepanna antal starter", "liczba uruchomień palnika", "antall brenner starter", "démarrages du brûleur")
|
||||
MAKE_PSTR_LIST(burnWorkMin, "burnworkmin", "total burner operating time", "Brenner Laufzeit", "Totale branderlooptijd", "Värmepanna aktiva timmar", "łączny czas pracy palnika", "brennersteg tid i min", "durée de fonctionnement totale du brûleur")
|
||||
MAKE_PSTR_LIST(burn2WorkMin, "burn2workmin", "burner stage 2 operating time", "Brenner Stufe 2 Laufzeit", "Totale looptijd brander fase 2", "Värmepanna steg 2 aktiva timmar", "łączny czas pracy palnika 2 stopnia", "brennersteg2 tid i min", "durée de fonctionnement totale du brûleur état 2")
|
||||
MAKE_PSTR_LIST(heatWorkMin, "heatworkmin", "total heat operating time", "Heizung Laufzeit", "Totale looptijd verwarming", "Uppvärmning aktiva timmar", "łączny czas grzania", "varmetid i min", "durée de fonctionnement du chauffage")
|
||||
MAKE_PSTR_LIST(heatStarts, "heatstarts", "burner starts heating", "Brenner Starts Heizung", "Aantal brander starts verwarming", "Uppvärmning antal starter", "liczba uruchomień palnika na ogrzewanie", "", "démarrages du chauffage") // TODO translate
|
||||
MAKE_PSTR_LIST(UBAuptime, "ubauptime", "total UBA operating time", "Anlagen-Gesamtlaufzeit", "totale looptijd branderautomaat (UBA)", "Total Tid", "łączny czas pracy układu sterowania", "totaltid", "durée de fonctionnement totale de l'appareil (UBA)")
|
||||
MAKE_PSTR_LIST(lastCode, "lastcode", "last error code", "Letzter Fehler", "Laatste foutcode", "Senaste Felkod", "ostatni błąd", "siste feilkode", "dernier code d'erreur")
|
||||
MAKE_PSTR_LIST(serviceCode, "servicecode", "service code", "Statusmeldung", "Statuscode", "Servicekod", "kod serwisowy", "servicekode", "code de service")
|
||||
MAKE_PSTR_LIST(serviceCodeNumber, "servicecodenumber", "service code number", "Statusmeldungsnummer", "Status codenummer", "Servicekod", "numer kodu serwisowego", "servicekodenummer", "numéro du code de service")
|
||||
MAKE_PSTR_LIST(maintenanceMessage, "maintenancemessage", "maintenance message", "Wartungsmeldung", "Onderhoudsmelding", "Servicemeddelande", "komunikat przeglądu", "vedlikeholdsmelding", "message de maintenance")
|
||||
MAKE_PSTR_LIST(maintenanceDate, "maintenancedate", "next maintenance date", "Wartungsdatum", "Onderhoudsdatum", "Datum nästa Service", "termin następnego przeglądu", "vedlikeholdsdato", "prochaine date de maintenance")
|
||||
MAKE_PSTR_LIST(maintenanceType, "maintenance", "maintenance scheduled", "Wartungsplan", "Onderhoud gepland", "Underhall schemlagt", "rodzaj przeglądu", "vedlikeholdstype", "maintenance prévue")
|
||||
MAKE_PSTR_LIST(maintenanceTime, "maintenancetime", "time to next maintenance", "Wartung in", "Onderhoud in", "Tid till nästa underhall", "czas do kolejnego przeglądu", "vedlikeholdstid", "durée avant la prochaine maintenance")
|
||||
MAKE_PSTR_LIST(emergencyOps, "emergencyops", "emergency operation", "Notoperation", "Noodoperatie", "Nöddrift", "praca w trybie awaryjnym", "nøddrift", "opération d'urgence")
|
||||
MAKE_PSTR_LIST(emergencyTemp, "emergencytemp", "emergency temperature", "Nottemperatur", "Noodtemperatuur", "Nöddrift temperatur", "temperatura w trybie awaryjnym", "nødtemperatur", "température d'urgence")
|
||||
MAKE_PSTR_LIST(pumpMode, "pumpmode", "boiler pump mode", "Kesselpumpen Modus", "", "", "", "", "") // TODO translate
|
||||
|
||||
// heatpump/compress specific
|
||||
MAKE_PSTR_LIST(upTimeControl, "uptimecontrol", "total operating time heat", "Betriebszeit Heizen gesamt", "Totale bedrijfstijd", "Total tid uppvärmning", "łączny czas generowania ciepła", "", "durée totale de fonctionnement chauffage") // TODO translate
|
||||
MAKE_PSTR_LIST(upTimeCompHeating, "uptimecompheating", "operating time compressor heating", "Betriebszeit Kompressor heizen", "Bedrijfstijd compressor verwarmingsbedrijf", "Total tid kompressor uppvärmning", "łączny czas ogrzewania (sprężarka)", "", "durée de fonctionnement compresseur chauffage") // TODO translate
|
||||
MAKE_PSTR_LIST(upTimeCompCooling, "uptimecompcooling", "operating time compressor cooling", "Betriebszeit Kompressor kühlen", "Bedrijfstijd compressor koelbedrijf", "Total tid kompressor kyla", "łączny czas chłodzenia (sprężarka)", "Total tid kompressor kjøling", "durée de fonctionnement compresseur refroidissement")
|
||||
MAKE_PSTR_LIST(upTimeCompWw, "uptimecompww", "operating time compressor dhw", "Betriebszeit Kompressor", "Bedrijfstijd compressor warmwaterbedrijf", "Total tid kompressor varmvatten", "łączny czas grzania c.w.u. (sprężarka)", "Total tid kompressor varmtvann", "durée de fonctionnement compresseur ecs")
|
||||
MAKE_PSTR_LIST(upTimeCompPool, "uptimecomppool", "operating time compressor pool", "Betriebszeit Kompressor Pool", "Bedrijfstijd compressor voor zwembadbedrijf", "Total tid kompressor pool", "łączny czas podgrzewania basenu (sprężarka)", "Total tid kompressor basseng", "durée de fonctionnement compresseur piscine")
|
||||
MAKE_PSTR_LIST(totalCompStarts, "totalcompstarts", "total compressor control starts", "Kompressor Starts gesamt", "Totaal compressorstarts", "Kompressorstarter Totalt", "liczba załączeń sprężarki", "kompressorstarter Totalt", "nombre démarrages total contrôle compresseur")
|
||||
MAKE_PSTR_LIST(heatingStarts, "heatingstarts", "heating control starts", "Heizen Starts", "Starts verwarmingsbedrijf", "Kompressorstarter Uppvärmning", "liczba załączeń ogrzewania", "kompressorstarter oppvarming", "démarrages contrôle chauffage")
|
||||
MAKE_PSTR_LIST(coolingStarts, "coolingstarts", "cooling control starts", "Kühlen Starts", "Starts koelbedrijf", "Kompressorstarter Kyla", "liczba załączeń chłodzenia", "kompressorstarter kjøling", "démarrages contrôle refroidissement")
|
||||
MAKE_PSTR_LIST(poolStarts, "poolstarts", "pool control starts", "Pool Starts", "Starts zwembadbedrijf", "Kompressorstarter Pool", "liczba załączeń podgrzewania basenu", "kompressorstarter basseng", "démarrages contrôle piscine")
|
||||
MAKE_PSTR_LIST(nrgConsTotal, "nrgconstotal", "total energy consumption", "Energieverbrauch gesamt", "Energieverbrauch gesamt", "Energiförbrukning totalt", "energia pobrana (sumarycznie)", "energiforbruk totalt", "consommation totale énergie")
|
||||
MAKE_PSTR_LIST(nrgConsCompTotal, "nrgconscomptotal", "total energy consumption compressor", "Energieverbrauch Kompressor gesamt", "Energieverbruik compressor totaal", "Energiförbrukning kompressor", "energia pobrana przez sprężarkę", "energiforbruk kompressor", "consommation totale énergie compresseur")
|
||||
MAKE_PSTR_LIST(nrgConsCompHeating, "nrgconscompheating", "energy consumption compressor heating", "Energieverbrauch Kompressor heizen", "Energieverbruik compressor verwarmingsbedrijf", "Energiförbrukning uppvärmning", "energia pobrana przez sprężarkę na ogrzewanie", "energiforbruk oppvarming", "consommation énergie compresseur chauffage")
|
||||
MAKE_PSTR_LIST(nrgConsCompWw, "nrgconscompww", "energy consumption compressor dhw", "Energieverbrauch Kompressor", "Energieverbruik compressor warmwaterbedrijf", "Energiförbrukning varmvatten", "energia pobrana przez sprężarkę na c.w.u.", "energiforbruk varmvann", "consommation énergie compresseur ecs")
|
||||
MAKE_PSTR_LIST(nrgConsCompCooling, "nrgconscompcooling", "energy consumption compressor cooling", "Energieverbrauch Kompressor kühlen", "Energieverbruik compressor koelbedrijf", "Energiförbrukning kyla", "energia pobrana przez sprężarkę na chłodzenie", "energiforbruk kjøling", "consommation énergie compresseur refroidissement")
|
||||
MAKE_PSTR_LIST(nrgConsCompPool, "nrgconscomppool", "energy consumption compressor pool", "Energieverbrauch Kompressor Pool", "Energiebedrijf compressor zwembadbedrijf", "Energiförbrukning pool", "energia pobrana przez sprężarkę na podgrzewanie basenu", "energiforbruk basseng", "consommation énergie compresseur piscine")
|
||||
MAKE_PSTR_LIST(nrgSuppTotal, "nrgsupptotal", "total energy supplied", "gesamte Energieabgabe", "Totaal opgewekte energie", "Genererad energi", "energia oddana (sumarycznie)", "tilført energi", "énergie totale fournie")
|
||||
MAKE_PSTR_LIST(nrgSuppHeating, "nrgsuppheating", "total energy supplied heating", "gesamte Energieabgabe heizen", "Opgewekte energie verwarmingsbedrijf", "Genererad energi Uppvärmning", "energia oddana na ogrzewanie", "tilført energi oppvarming", "énergie totale fournie chauffage")
|
||||
MAKE_PSTR_LIST(nrgSuppWw, "nrgsuppww", "total energy warm supplied dhw", "gesamte Energieabgabe", "Opgewekte energie warmwaterbedrijf", "Genererad energi Varmvatten", "energia oddana na c.w.u.", "tilført energi varmvann", "énergie chaude totale fournie ecs")
|
||||
MAKE_PSTR_LIST(nrgSuppCooling, "nrgsuppcooling", "total energy supplied cooling", "gesamte Energieabgabe kühlen", "Opgewekte energie koelbedrijf", "Genererad energi Kyla", "energia oddana na chłodzenie", "Tillført energi kjøling", "énergie totale fournie refroidissement")
|
||||
MAKE_PSTR_LIST(nrgSuppPool, "nrgsupppool", "total energy supplied pool", "gesamte Energieabgabe Pool", "Opgewekte energie zwembadbedrijf", "Genererad energi Pool", "energia oddana na podgrzewanie basenu", "tilført energi basseng", "énergie totale fournie piscine")
|
||||
MAKE_PSTR_LIST(auxElecHeatNrgConsTotal, "auxelecheatnrgconstotal", "total auxiliary electrical heater energy consumption", "Energieverbrauch el. Zusatzheizung", "Totaal energieverbruik electrisch verwarmingselement", "Energiförbrukning Eltillkott", "energia pobrana przez grzałki", "energiforbruk varmekolbe", "consommation totale énergie electrique auxiliaire chauffage")
|
||||
MAKE_PSTR_LIST(auxElecHeatNrgConsHeating, "auxelecheatnrgconsheating", "auxiliary electrical heater energy consumption heating", "Energieverbrauch el. Zusatzheizung Heizen", "Energieverbruik electrisch verwarmingselement voor verwarmingsbedrijf", "Energiförbrukning Eltillskott Uppvärmning", "energia pobrana przez grzałki na ogrzewanie", "energiforbruk varmekolbe oppvarming", "consommation énergie electrique auxiliaire chauffage")
|
||||
MAKE_PSTR_LIST(auxElecHeatNrgConsWW, "auxelecheatnrgconsww", "auxiliary electrical heater energy consumption dhw", "Energieverbrauch el. Zusatzheizung", "Energieverbruik electrisch verwarmingselement voor warmwaterbedrijf", "Energiförbrukning Eltillskott Varmvatten", "energia pobrana przez grzałki na c.w.u.", "energiförbruk varmekolbe varmvann", "consommation énergie electrique auxiliaire chauffage ecs")
|
||||
MAKE_PSTR_LIST(auxElecHeatNrgConsPool, "auxelecheatnrgconspool", "auxiliary electrical heater energy consumption pool", "Energieverbrauch el. Zusatzheizung Pool", "Energieverbruik electrisch verwarmingselement voor zwembadbedrijf", "Energiförbrukning Eltillskott Pool", "energia pobrana przez grzałki na podgrzewanie basenu", "", "consommation énergie electrique auxiliaire chauffage piscine") // TODO translate
|
||||
|
||||
MAKE_PSTR_LIST(hpCompOn, "hpcompon", "hp compressor", "WP Kompressor", "WP compressor", "VP Kompressor", "sprężarka pompy ciepła", "vp kompressor", "compresseur pompe à chaleur")
|
||||
MAKE_PSTR_LIST(hpHeatingOn, "hpheatingon", "hp heating", "WP Heizen", "WP verwarmingsbedrijf", "VP Uppvärmning", "pompa ciepła, ogrzewanie", "vp oppvarmning", "chauffe pompe à chaleur")
|
||||
MAKE_PSTR_LIST(hpCoolingOn, "hpcoolingon", "hp cooling", "WP Kühlen", "WP koelbedrijf", "VP Kyla", "pompa ciepła, chłodzenie", "vp kjøling", "refroidissement pompe à chaleur")
|
||||
MAKE_PSTR_LIST(hpWwOn, "hpwwon", "hp dhw", "WP Warmwasser", "WP warmwaterbedrijf", "VP Varmvatten", "pompa ciepła, c.w.u.", "vp varmvatten", "eau chaude pompe à chaleur")
|
||||
MAKE_PSTR_LIST(hpPoolOn, "hppoolon", "hp pool", "WP Pool", "WP zwembadbedrijf", "VP Pool", "pompa ciepła, podgrzewanie basenu", "vp basseng", "pompe à chaleur piscine")
|
||||
MAKE_PSTR_LIST(hpBrinePumpSpd, "hpbrinepumpspd", "brine pump speed", "Solepumpen-Geschw.", "Snelheid pekelpomp", "Hastighet Brine-pump", "wysterowanie pompy glikolu", "hastighet brine-pumpe", "vitesse pompe à saumure")
|
||||
MAKE_PSTR_LIST(hpCompSpd, "hpcompspd", "compressor speed", "Kompressor-Geschw.", "Snelheid compressor", "Kompressorhastighet", "wysterowanie sprężarki", "kompressorhastighet", "vitesse du compresseur")
|
||||
MAKE_PSTR_LIST(hpCircSpd, "hpcircspd", "circulation pump speed", "Zirkulationspumpen-Geschw.", "Snelheid circulatiepomp", "Hastighet Cirkulationspump", "wysterowanie pompy obiegu grzewczego", "hastighet sirkulationspumpe", "vitesse pompe à circulation")
|
||||
MAKE_PSTR_LIST(hpBrineIn, "hpbrinein", "brine in/evaporator", "Sole in/Verdampfer", "pekel in/verdamper", "Brine in (förangare)", "temperatura glikolu na wejściu kolektora (TB0)", "brine in/fordamper", "entrée saumure/évaporateur")
|
||||
MAKE_PSTR_LIST(hpBrineOut, "hpbrineout", "brine out/condenser", "Sole aus/Kondensator", "pekel uit/condensor", "Brine ut (kondensor)", "temperatura glikolu na wyjściu kolektora (TB1)", "Brine ut/kondensor", "sortie saumure/condenseur")
|
||||
MAKE_PSTR_LIST(hpSwitchValve, "hpswitchvalve", "switch valve", "Schaltventil", "schakelklep", "Växelventil", "zawór przełączający", "skifteventil", "valve de commutation")
|
||||
MAKE_PSTR_LIST(hpActivity, "hpactivity", "compressor activity", "Kompressoraktivität", "Compressoractiviteit", "Kompressoraktivitet", "pompa ciepła, aktywność sprężarki", "", "activité du compresseur") // TODO translate
|
||||
|
||||
MAKE_PSTR_LIST(hpPower, "hppower", "compressor power output", "Kompressorleistung", "Compressorvermogen", "Kompressoreffekt", "moc wyjściowa sprężarki", "kompressoreffekt", "puissance de sortie compresseur")
|
||||
MAKE_PSTR_LIST(hpTc0, "hptc0", "heat carrier return (TC0)", "Kältemittel Rücklauf (TC0)", "Koudemiddel retour (TC0)", "Värmebärare Retur (TC0)", "temperatura nośnika ciepła na powrocie (TC0)", "kjølemiddel retur (TC0)", "retour caloporteur (TC0)")
|
||||
MAKE_PSTR_LIST(hpTc1, "hptc1", "heat carrier forward (TC1)", "Kältemittel Vorlauf (TC1)", "Koudemiddel aanvoer (TC1)", "Värmebärare Framledning (TC1)", "temperatura nośnika ciepła pierwotna (TC1)", "kjølemiddel tur (TC1)", "avance caloporteur (TC1)")
|
||||
MAKE_PSTR_LIST(hpTc3, "hptc3", "condenser temperature (TC3)", "Verflüssigertemperatur (TC3)", "Condensortemperatuur (TC3)", "Kondensortemperatur (TC3)", "temperatura skraplacza/na wyjściu sprężarki (TC3)", "kondensortemperatur (TC3)", "température condensateur (TC3)")
|
||||
MAKE_PSTR_LIST(hpTr1, "hptr1", "compressor temperature (TR1)", "Kompessortemperatur (TR1)", "Compressor temperatuur (TR1)", "Kompressor temp (TR1)", "temperatura sprężarki (TR1)", "kompressor temperatur (TR1)", "température compresseur (TR1)")
|
||||
MAKE_PSTR_LIST(hpTr3, "hptr3", "refrigerant temperature liquid side (condenser output) (TR3)", "Kältemittel (flüssig) (TR3)", "Temperatuur koudemiddel vloeibare zijde (TR3)", "Köldmedium temperatur (kondensorutlopp) (TR3)", "temperatura skraplacza ogrzew. (TR3)", "kjølemiddeltemperatur på væskesiden (TR3)", "température réfrigérant côté liquide (sortie condensateur) (TR3)")
|
||||
MAKE_PSTR_LIST(hpTr4, "hptr4", "evaporator inlet temperature (TR4)", "Verdampfer Eingang (TR4)", "Verdamper ingangstemperatuur (TR4)", "Förångare inloppstemp (TR4)", "temperatura na wejściu parownika (TR4)", "innløpstemperatur for fordamperen (TR4)", "température entrée évaporateur (TR4)")
|
||||
MAKE_PSTR_LIST(hpTr5, "hptr5", "compressor inlet temperature (TR5)", "Kompessoreingang (TR5)", "Compressor ingangstemperatuur (TR5)", "Kompressor inloppstemp (TR5)", "temperatura na wejściu sprężarki (TR5)", "kompressor innløpstemp (TR5)", "température entrée compresseur (TR5)")
|
||||
MAKE_PSTR_LIST(hpTr6, "hptr6", "compressor outlet temperature (TR6)", "Kompressorausgang (TR6)", "Compressor uitgangstemperatuur (TR6)", "Kompressor utloppstemp (TR6)", "temperatura na wyjściu sprężarki (TR6)", "kompressor utløpstemp (TR6)", "température sortie compresseur (TR6)")
|
||||
MAKE_PSTR_LIST(hpTr7, "hptr7", "refrigerant temperature gas side (condenser input) (TR7)", "Kältemittel (gasförmig) (TR7)", "Temperatuur koudemiddel gasvormig (TR7)", "Köldmedium temperatur gassida (kondensorinlopp) (TR7)", "temperatura czynnika chłodniczego po stronie gazu (wejście skraplacza) (TR7)", "kjølemedium temperatur gassida (kondensatorinløp) (TR7)", "température réfrigérant côté gaz (sortie condensateur) (TR7)")
|
||||
MAKE_PSTR_LIST(hpTl2, "hptl2", "air inlet temperature (TL2)", "Außenluft-Einlasstemperatur (TL2)", "Temperatuur luchtinlaat (TL2)", "Luftintagstemperatur (TL2)", "temperatura wlotu powietrza (TL2)", "luftinntakstemperatur (TL2)", "température entrée air (TL2)")
|
||||
MAKE_PSTR_LIST(hpPl1, "hppl1", "low pressure side temperature (PL1)", "Niederdruckfühler (PL1)", "Temperatuur lage drukzijde (PL1)", "Temperatur Lågtryckssidan (PL1)", "temperatura po stronie niskiego ciśnienia (PL1)", "temperatur lavtrykksiden (PL1)", "température côté basse pression (PL1)")
|
||||
MAKE_PSTR_LIST(hpPh1, "hpph1", "high pressure side temperature (PH1)", "Hochdruckfühler (PH1)", "Temperatuur hoge drukzijde (PH1)", "Temperatur Högtryckssidan (PH1)", "temperatura po stronie wysokiego ciśnienia (PH1)", "Temperatur Høytrykksiden (PH1)", "température côté bhauteasse pression (PH1)")
|
||||
MAKE_PSTR_LIST(hpTa4, "hpta4", "drain pan temp (TA4)", "Kondensatorwanne (TA4)", "", "", "temperatura ociekacza (TA4)", "", "") // TODO translate
|
||||
|
||||
MAKE_PSTR_LIST(hpInput1, "hpin1", "input 1 state", "Eingang 1 Status", "Status input 1", "Status Ingång 1", "stan wejścia 1", "status Inggng 1", "état entrée 1")
|
||||
MAKE_PSTR_LIST(hpInput2, "hpin2", "input 2 state", "Eingang 2 Status", "Status input 2", "Status Ingång 2", "stan wejścia 2", "status Inggng 2", "état entrée 2")
|
||||
MAKE_PSTR_LIST(hpInput3, "hpin3", "input 3 state", "Eingang 3 Status", "Status input 3", "Status Ingång 3", "stan wejścia 3", "status Inggng 3", "état entrée 3")
|
||||
MAKE_PSTR_LIST(hpInput4, "hpin4", "input 4 state", "Eingang 4 Status", "Status input 4", "Status Ingång 4", "stan wejścia 4", "status Inggng 4", "état entrée 4")
|
||||
MAKE_PSTR_LIST(hpIn1Opt, "hpin1opt", "input 1 options", "Eingang 1 Einstellung", "Instelling input 1", "Inställningar Ingång 1", "opcje wejścia 1", "innstillinger inngang 1", "options entrée 1")
|
||||
MAKE_PSTR_LIST(hpIn2Opt, "hpin2opt", "input 2 options", "Eingang 2 Einstellung", "Instelling input 2", "Inställningar Ingång 2", "opcje wejścia 2", "innstillinger inngang 2", "options entrée 2")
|
||||
MAKE_PSTR_LIST(hpIn3Opt, "hpin3opt", "input 3 options", "Eingang 3 Einstellung", "Instelling input 3", "Inställningar Ingång 3", "opcje wejścia 3", "innstillinger inngang 3", "options entrée 3")
|
||||
MAKE_PSTR_LIST(hpIn4Opt, "hpin4opt", "input 4 options", "Eingang 4 Einstellung", "Instelling input 4", "Inställningar Ingång 4", "opcje wejścia 4", "innstillinger inngang 4", "options entrée 4")
|
||||
MAKE_PSTR_LIST(maxHeatComp, "maxheatcomp", "heat limit compressor", "Heizgrenze Kompressor", "heat limit compressor", "heat limit compressor", "ograniczenie mocy sprężarki", "max varmegrense kompressor", "limite chaleur compresseur")
|
||||
MAKE_PSTR_LIST(maxHeatHeat, "maxheatheat", "heat limit heating", "Heizgrenze Heizen", "heat limit heating", "heat limit heating", "ograniczenie mocy w trybie ogrzewania", "maks varmegrense oppvarming", "limite chaleur chauffage")
|
||||
MAKE_PSTR_LIST(maxHeatDhw, "maxheatdhw", "heat limit dhw", "Heizgrenze Warmwasser", "heat limit dhw", "heat limit dhw", "ograniczenie mocy w trybie c.w.u.", "varmegrense varmtvann", "limite chaleur ecs")
|
||||
|
||||
MAKE_PSTR_LIST(auxHeaterOff, "auxheateroff", "disable auxilliary heater", "Verbiete Zusatzheizer", "Bijverwarming uitsc", "Blockera eltillskott", "wyłącz dogrzewacz", "", "Désactiver chauff. d'app") // TODO translate
|
||||
MAKE_PSTR_LIST(auxHeaterStatus, "auxheaterstatus", "auxilliary heater status", "Status Zusatzheizer", "Bijverwarming", "Eltillskott Status", "status dogrzewacza", "", "Chauffage auxiliaire") // TODO translate
|
||||
MAKE_PSTR_LIST(auxHeaterOnly, "auxheateronly", "auxilliary heater only", "nur Zusatzheizer","Alleen bijverwarming", "Eltillskott Enbart", "tylko dogrzewacz", "", "Que chauffage auxiliaire") // TODO translate
|
||||
MAKE_PSTR_LIST(auxHeaterDelay, "auxheaterdelay", "auxilliary heater on delay", "Zusatzheizer verzögert ein", "Bijverw. vertraagd aan", "Eltillskottfördröjning på", "opóźnienie włączenia dogrzewacza", "Tilleggsvarmer forsinket på", "Chauff app tempo marche")
|
||||
MAKE_PSTR_LIST(silentMode, "silentmode", "silent mode", "Silentmodus", " Stiller gebruik", "Tyst läge", "tryb cichy", "", "Fct silencieux") // TODO translate
|
||||
MAKE_PSTR_LIST(minTempSilent, "mintempsilent", "min. outside temp. for silent mode", "Minimale Aussentemperatur Silentmodus", " Stiller gebruik min. buitentemp", "Tyst läge min temp", "minimalna temperatura zewnętrzna dla trybu cichego", "", "Fct silencieux: Temp. extérieure min.") // TODO translate
|
||||
MAKE_PSTR_LIST(tempParMode, "tempparmode", "outside temp. parallel mode", "Aussentemperatur Parallelmodus", "Buitentemp. parallelbedr", "Parallelläge Utomhustemp.", "maksymalna temperatura zewnętrzna dla dogrzewacza", "", "Temp. ext. fct parallèle") // TODO translate
|
||||
MAKE_PSTR_LIST(auxHeatMixValve, "auxheatmix", "aux. heater mixing valve", "Mischer Zusatzheizer", "Bijverwarming menger", "Eltilskott Blandarventil", "mieszacz dogrzewacza", "", "Chauffage auxiliaire mélangeur") // TODO translate
|
||||
MAKE_PSTR_LIST(hpHystHeat, "hphystheat", "on/off hyst heat", "Schalthysterese Heizen", "Aan/uit-hysteresis in verw. bedrijf", "Hstereses Uppvärm.", "histereza wł./wył. ogrzewania", "På/av-hysterese Oppvar.", "Hystérésis Marche en mode chauffage")
|
||||
MAKE_PSTR_LIST(hpHystCool, "hphystcool", "on/off hyst cool", "Schalthysterese Kühlen", "Aan/uit-hysteresis in koelbedrijf ", "Hystereses Kyla", "histereza wł./wył. chłodzenia", "", "Hystérésis Marche en mode refroidissement") // TODO translate
|
||||
MAKE_PSTR_LIST(hpHystPool, "hphystpool", "on/off hyst pool", "Schalthysterese Pool", "an/uit-hysteresis in zwembadbedri", "Hystereses Pool", "histereza wł./wył. podgrzewania basenu", "", "Hystérésis Marche en mode piscine") // TODO translate
|
||||
MAKE_PSTR_LIST(tempDiffHeat, "tempdiffheat", "temp. diff. TC3/TC0 heat", "Temp.diff. TC3/TC0 Heizen", "Temp.vers. TC3/TC0 verw", "Delta(T) TC3/TC0 Uppvärm.", "różnica temperatur TC3/TC0 w trakcie ogrzewania", "", "Delta T TC3/TC0 Chauff") // TODO translate
|
||||
MAKE_PSTR_LIST(tempDiffCool, "tempdiffcool", "temp. diff. TC3/TC0 cool", "Temp.diff. TC3/TC0 Kühlen", "Temp.vers. TC3/TC0 koel.", "Delta(T) TC3/TC0 Kyla", "różnica temperatur TC3/TC0 w trakcie chłodzenia", "", "Delta T TC3/TC0 Refroid.") // TODO translate
|
||||
MAKE_PSTR_LIST(silentFrom, "silentfrom", "silent mode from", "Silentmodus Start", "", "", "początek trybu cichego", "", "") // TODO translate
|
||||
MAKE_PSTR_LIST(silentTo, "silentto", "silent mode to", "Silentmodus Ende", "", "", "koniec trybu cichego", "", "") // TODO translate
|
||||
|
||||
MAKE_PSTR_LIST(wwComfOffTemp, "wwcomfoff", "comfort switch off", "Komfort Ausschalttemp", "Comfort Uitschakeltemp.", "Komfortläge avstängingstemp.", "temperatura wyłączania w trybie komfort", "", "Confort Temp. d'arrêt") // TODO translate
|
||||
MAKE_PSTR_LIST(wwEcoOffTemp, "wwecooff", "eco switch off", "ECO Ausschalttemp", "Eco Uitschakeltemp.", "Ekoläge avstängningstemp.", "temperatura wyłączania w trybie eko", "", "Eco Temp. d'arrêt") // TODO translate
|
||||
MAKE_PSTR_LIST(wwEcoPlusOffTemp, "wwecoplusoff", "eco+ switch off", "ECO+ Ausschalttemp", "Eco+ Uitschakeltemp.", "Eko+ avstängningstemp.", "temperatura wyłączania w trybie eko+", "", "Eco+ Temp. d'arrêt") // TODO translate
|
||||
|
||||
MAKE_PSTR_LIST(auxHeatMode, "auxheatrmode", "aux heater mode", "Modus Zusatzheizer", "", "", "tryb pracy dogrzewacza po blokadzie z Zakładu Energetycznego", "", "") // TODO translate
|
||||
MAKE_PSTR_LIST(auxMaxLimit, "auxmaxlimit", "aux heater max limit", "Zusatzheizer max. Grenze", "", "", "dogrzewacz, maksymalny limit", "", "") // TODO translate
|
||||
MAKE_PSTR_LIST(auxLimitStart, "auxlimitstart", "aux heater limit start", "Zusatzheizer Grenze Start", "", "", "dogrzewacz, początek ograniczenia", "", "") // TODO translate
|
||||
MAKE_PSTR_LIST(manDefrost, "mandefrost", "manual defrost", "Manuelle Enteisung", "", "", "ręczne odladzanie", "", "") // TODO translate
|
||||
MAKE_PSTR_LIST(pvCooling, "pvcooling", "Cooling only with PV", "Kühlen nur mit PV", "", "", "chłodzenie tylko z PV", "", "") // TODO translate
|
||||
MAKE_PSTR_LIST(hpCircPumpWw, "hpcircpumpww", "circulation pump available during dhw", "", "", "", "pompa cyrkulacji dostępna w trakcie c.w.u.", "", "") // TODO translate
|
||||
MAKE_PSTR_LIST(vp_cooling, "vpcooling", "valve/pump cooling", "", "", "", "zawór/pompa chłodzenia", "", "") // TODO translate
|
||||
MAKE_PSTR_LIST(VC0valve, "vc0valve", "VC0 valve", "", "", "", "zawór VC0", "", "") // TODO translate
|
||||
MAKE_PSTR_LIST(primePump, "primepump", "primary heatpump", "", "", "", "główna pompa ciepła", "", "") // TODO translate
|
||||
MAKE_PSTR_LIST(primePumpMod, "primepumpmod", "primary heatpump modulation", "", "", "", "wysterowanie głównej pompy ciepła", "", "") // TODO translate
|
||||
MAKE_PSTR_LIST(hp3wayValve, "hp3way", "3-way valve", "", "", "", "zawór 3-drogowy pompy ciepła", "", "") // TODO translate
|
||||
MAKE_PSTR_LIST(elHeatStep1, "elheatstep1", "el. heater step 1", "", "", "", "dogrzewacz poziom 1", "", "") // TODO translate
|
||||
MAKE_PSTR_LIST(elHeatStep2, "elheatstep2", "el. heater step 2", "", "", "", "dogrzewacz poziom 2", "", "") // TODO translate
|
||||
MAKE_PSTR_LIST(elHeatStep3, "elheatstep3", "el. heater step 3", "", "", "", "dogrzewacz poziom 3", "", "") // TODO translate
|
||||
MAKE_PSTR_LIST(wwAlternatingOper, "wwalternatingop", "alternating operation", "", "", "", "praca naprzemienna", "", "") // TODO translate
|
||||
MAKE_PSTR_LIST(wwAltOpPrioHeat, "wwaltopprioheat", "prioritise heating during dhw", "", "", "", "czas na ogrzewanie w trakcie c.w.u", "", "") // TODO translate
|
||||
MAKE_PSTR_LIST(wwAltOpPrioWw, "wwaltopprioww", "prioritise dhw during heating", "", "", "", "czas na c.w.u w trakcie ogrzewania", "", "") // TODO translate
|
||||
|
||||
// hybrid heatpump
|
||||
MAKE_PSTR_LIST(hybridStrategy, "hybridstrategy", "hybrid control strategy", "Hybrid Strategie", "Hybride strategie", "Hybrid kontrollstrategi", "strategia sterowania hybrydowego", "hybrid kontrollstrategi", "stratégie contrôle hybride")
|
||||
MAKE_PSTR_LIST(switchOverTemp, "switchovertemp", "outside switchover temperature", "Außentemperatur für Umschaltung", "Schakeltemperatuur buitentemperatuur", "Utomhus Omställningstemperatur", "zewnętrzna temperatura przełączania", "utendørstemp styring", "basculement par température extérieure")
|
||||
MAKE_PSTR_LIST(energyCostRatio, "energycostratio", "energy cost ratio", "Energie/Kosten-Verhältnis", "Energiekostenratio", "Energi/Kostnads-förhållande", "współczynnik energia/koszt", "energi/kostnads forhold", "ratio coût énergie")
|
||||
MAKE_PSTR_LIST(fossileFactor, "fossilefactor", "fossile energy factor", "Energiefaktor Fossil", "Energiefactor fossiele brandstof", "Energifaktor fossilenergi", "udział energii z paliw kopalnych", "energifaktor fossilenergi", "facteur énergie fossile")
|
||||
MAKE_PSTR_LIST(electricFactor, "electricfactor", "electric energy factor", "Energiefaktor elektrisch", "Energiefactor electrisch", "Elektrisk energifaktor", "udział energii elektrycznej", "elektrisk energifaktor", "facteur énergie électrique")
|
||||
MAKE_PSTR_LIST(delayBoiler, "delayboiler", "delay boiler support", "Verzögerungs-Option", "Vertragingsoptie", "Fördröjningsoption", "opcja opóźnienia", "Fördörjningsoption", "option retardement chaudière")
|
||||
MAKE_PSTR_LIST(tempDiffBoiler, "tempdiffboiler", "temp diff boiler support", "Temperaturdifferenz-Option", "Verschiltemperatuuroptie", "Temperaturskillnadsoption", "opcja różnicy temperatur", "temperatursforskjell kjele", "option différence température")
|
||||
MAKE_PSTR_LIST(lowNoiseMode, "lownoisemode", "low noise mode", "Geräuscharmer Betrieb", "", "Tyst läge", "tryb cichy", "", "mode faible bruit") // TODO translate
|
||||
MAKE_PSTR_LIST(lowNoiseStart, "lownoisestart", "low noise starttime", "Start geräuscharmer Betrieb", "", "Tyst läge starttid", "początek trybu cichego", "", "heure démarrage faible bruit") // TODO translate
|
||||
MAKE_PSTR_LIST(lowNoiseStop, "lownoisestop", "low noise stoptime", "Stopp geräuscharmer Betrieb", "", "Tyst läge stopptid", "koniec trybu cichego", "", "heure arrêt faible bruit") // TODO translate
|
||||
MAKE_PSTR_LIST(energyPriceGas, "energypricegas", "energy price gas", "Energiepreis Gas", "", "Gaspris", "cena energii z gazu", "", "prix énergie gaz") // TODO translate
|
||||
MAKE_PSTR_LIST(energyPriceEl, "energypriceel", "energy price electric", "Energiepreis Eletrizität", "", "Elpris", "cena energii elektrycznej", "", "prix énergie électrique") // TODO translate
|
||||
MAKE_PSTR_LIST(energyPricePV, "energyfeedpv", "feed in PV", "PV Einspeisevergütung", "", "PV Energi", "zasilanie energią PV", "", "alimentation PV") // TODO translate
|
||||
MAKE_PSTR_LIST(hybridDHW, "hybriddhw", "hybrid DHW", "Hybrid Warmwasser", "", "Hybridläge varmvatten", "hybrydowa c.w.u.", "", "ecs hybride") // TODO translate
|
||||
MAKE_PSTR_LIST(airPurgeMode, "airpurgemode", "air purge mode", "Luftspülung", "", "Luftreningsläge", "tryb oczyszczania powietrza", "", "mode purge air") // TODO translate
|
||||
MAKE_PSTR_LIST(heatPumpOutput, "heatpumpoutput", "heatpump output", "WP Leistung", "", "Värmepumpseffekt", "moc wyjściowa pompy ciepła", "", "sortie pompe à chaleur") // TODO translate
|
||||
MAKE_PSTR_LIST(coolingCircuit, "coolingcircuit", "cooling circuit", "Kühlkreislauf", "", "Kylkrets", "obwód chłodzący", "", "circuit refroidissement") // TODO translate
|
||||
MAKE_PSTR_LIST(compStartMod, "compstartmod", "compressor start modulation", "Kompressor Startleistung", "", "Kompressor startmodulering", "początkowa modulacja sprężarki", "", "modulation démarrage compresseur") // TODO translate
|
||||
MAKE_PSTR_LIST(heatDrainPan, "heatdrainpan", "heat drain pan", "Wärmeausgleichsgefäß", "", "Uppvärm. dränering", "zbiornik wyrównawczy ciepła", "", "bac récupération chaleur") // TODO translate
|
||||
MAKE_PSTR_LIST(heatCable, "heatcable", "heating cable", "Heizband", "heating cable", "värmekabel", "przewód grzejny", "", "câble chauffant") // TODO translate
|
||||
|
||||
// alternative heatsource AM200
|
||||
MAKE_PSTR_LIST(aCylTopTemp, "cyltoptemp", "cylinder top temperature", "Speichertemperatur Oben", "Buffer temperatuur boven", "Cylindertemperatur Toppen", "temperatura na górze cylindra", "beredertemperatur topp", "température haut cylindre")
|
||||
MAKE_PSTR_LIST(aCylCenterTemp, "cylcentertemp", "cylinder center temperature", "Speichertemperatur Mitte", "Buffer temperatuur midden", "Cylindertemperatur Mitten", "temperatura na środku cylindra", "beredertemperatur midten", "température centre cylindre")
|
||||
MAKE_PSTR_LIST(aCylBottomTemp, "cylbottomtemp", "cylinder bottom temperature", "Speichertemperatur Unten", "Buffer temperatuur onder", "Cylindertemperatur Botten", "temperatura na dole cylindra", "beredertemperatur nederst", "température fond cylindre")
|
||||
MAKE_PSTR_LIST(aFlowTemp, "altflowtemp", "alternative hs flow temperature", "Alternativer WE Vorlauftemperatur", "Alternatieve warmtebron aanvoertemperatuur", "Alternativ flödestemp värmekälla", "temperatura zasilania z alternatywnego źródła", "", "température flux hs alternative") // TODO translate
|
||||
MAKE_PSTR_LIST(aRetTemp, "altrettemp", "alternative hs return temperature", "Alternativer WE Rücklauftemperatur", "Alternatieve warmtebron retourtemperatuur", "Alternativ returtemp värmekälla", "temperatura powrotu z alternatywnego źródła", "", "température retour hs alternative") // TODO translate
|
||||
MAKE_PSTR_LIST(sysFlowTemp, "sysflowtemp", "system flow temperature", "System Vorlauftemperatur", "Systeem aanvoertemperatuur", "Systemflödestemperatur", "temperatura zasilania systemu", "", "température flux système") // TODO translate
|
||||
MAKE_PSTR_LIST(sysRetTemp, "sysrettemp", "system return temperature", "System Rücklauftemperatur", "Systeem retourtemperatuur", "Systemreturtemperatur", "temperatura powrotu z systemu", "", "température retour système") // TODO translate
|
||||
MAKE_PSTR_LIST(valveByPass, "valvebypass", "bypass valve", "Bypass-Ventil", "Bypass klep", "Bypassventil", "zawór obejścia", "", "vanne dérivation") // TODO translate
|
||||
MAKE_PSTR_LIST(valveBuffer, "valvebuffer", "buffer valve", "Puffer-Ventil", "Bufferklep", "Buffertventil", "zawór bufora", "", "vanne tampon") // TODO translate
|
||||
MAKE_PSTR_LIST(valveReturn, "valvereturn", "return valve", "Rückfluss-Ventil", "Retourklep", "Returventil", "zawór powrotu", "", "vanne retour") // TODO translate
|
||||
MAKE_PSTR_LIST(aPumpMod, "apumpmod", "alternative hs pump modulation", "Alternativer WE Pumpenmodulation", "Alternatieve warmtebron pomp modulatie", "Alternativ Pumpmodulering Värmekälla", "modulacja pompy alternatywnego źródła ciepła", "alternativ pumpemodulering varmekilde", "modulation alternative pompe hs")
|
||||
MAKE_PSTR_LIST(heatSource, "heatsource", "alternative heating active", "Alternativer Wärmeerzeuger aktiv", "Alternatieve warmtebron aktief", "Alternativ Värmekälla aktiv", "aktywne alternatywne źródło ciepła", "alternativ varmekilde aktiv", "chauffage alternatif actif")
|
||||
MAKE_PSTR_LIST(aPump, "apump", "alternative hs pump", "Alternativer WE Pumpe", "Alternatieve warmtebron pomp", "Alternativ Pump Värmekälla", "pompy alternatywnego źródła ciepła", "alternativ pumpe varmekilde", "alternative pompe hs")
|
||||
MAKE_PSTR_LIST(burner, "burner", "burner", "Brenner", "", "", "palnik", "", "") // TODO translate
|
||||
MAKE_PSTR_LIST(heatRequest, "heatrequest", "heat request", "Wärmeanforderung", "", "", "zapotrzebowanie na ciepło", "", "") // TODO translate
|
||||
MAKE_PSTR_LIST(blockRemain, "blockremain", "remaining blocktime", "verbleibende Blockzeit", "", "", "czas do końca blokady", "", "") // TODO translate
|
||||
MAKE_PSTR_LIST(blockRemainWw, "blockremainww", "remaining blocktime dhw", "verbleibende Blockzeit WW", "", "", "czas do końca blokady c.w.u.", "", "") // TODO translate
|
||||
MAKE_PSTR_LIST(flueGasTemp, "fluegastemp", "flue gas temperature", "Abgastemperatur", "", "", "temperatura spalin", "", "") // TODO translate
|
||||
|
||||
MAKE_PSTR_LIST(vr2Config, "vr2config", "vr2 configuration", "VR2 Konfiguration", "VR2 configuratie", "VR2 Konfiguration", "konfiguracja VR2", "vr2 konfigurasjon", "configuration vr2")
|
||||
MAKE_PSTR_LIST(ahsActivated, "ahsactivated", "alternate heat source activation", "Alt. Wärmeerzeuger aktiviert", "Altenatieve warmtebron geactiveerd", "Alternativ värmekälla aktivering", "aktywacja alternatywnego źródła ciepła", "alternativ varmekilde aktivering", "activation source chaleur alternative")
|
||||
MAKE_PSTR_LIST(aPumpConfig, "apumpconfig", "primary pump config", "Konfig. Hauptpumpe", "Primaire pomp configuratie", "Konfiguration Primärpump", "konfiguracja pompy głównej", "konfiguration Primærpumpe", "configuration pompe primaire")
|
||||
MAKE_PSTR_LIST(aPumpSignal, "apumpsignal", "output for pr1 pump", "Ausgang Pumpe PR1", "Output voor pomp PR1", "Utgång från pump PR1", "wyjście pompy PR1", "utgang fra pumpe PR1", "sortie pompe pr1")
|
||||
MAKE_PSTR_LIST(aPumpMin, "apumpmin", "min output pump pr1", "Minimale Pumpenansteuerung", "Minimale output pomp PR1", "Min Output Pump PR1", "minimalne wysterowanie pompy PR1", "minimal output pumpe PR1", "sortie min pompe pr1")
|
||||
MAKE_PSTR_LIST(tempRise, "temprise", "ahs return temp rise", "Rücklauf Temperaturerhöhung", "Verhoging retourtemperatuur", "Förhöjd returtemperatur", "wzrost temperatury powrotu", "forhøyd returtemperatur", "augmentation température retour ahs")
|
||||
MAKE_PSTR_LIST(setReturnTemp, "setreturntemp", "set temp return", "Soll-Rücklauftemperatur", "Streeftemperatuur retour", "Vald returtemperatur", "zadana temperatura powrotu", "valgt returtemperatur", "régler température retour")
|
||||
MAKE_PSTR_LIST(mixRuntime, "mixruntime", "mixer run time", "Mischer-Laufzeit", "Mixer looptijd", "Blandningsventil drifttid", "czas pracy miksera", "blandingsventil drifttid", "durée fonctionnement mélangeur")
|
||||
MAKE_PSTR_LIST(bufBypass, "bufbypass", "buffer bypass config", "Puffer-Bypass Konfig.", "Buffer bypass configuratie", "Konfiguration Buffer bypass", "konfiguracja z obejściem bufora", "konfigurasjon buffer bypass", "configuration contournement buffer")
|
||||
MAKE_PSTR_LIST(bufMixRuntime, "bufmixruntime", "bypass mixer run time", "Speicher-Mischer-Laufzeit", "Buffer mixer looptijd", "Blandningsventil Bypass drifttid", "czas pracy mieszacza obejścia", "blandningsventil bypass drifttid", "durée fonctionnement contournement mélangeur")
|
||||
MAKE_PSTR_LIST(bufConfig, "bufconfig", "dhw buffer config", "Konfig. Warmwasserspeicher", "Warmwater boiler configuratie", "Konfiguration Varmvattentank", "konfiguracja bufora c.w.u.", "konfigurasjon varmvannstank", "configuration buffer ecs")
|
||||
MAKE_PSTR_LIST(blockMode, "blockmode", "config htg. blocking mode", "Konfig. Sperr-Modus", "Configuratie blokeermodus", "Konfiguration Blockeringsläge", "konfiguracja trybu blokady", "konfigurasjon blokkeringsmodus", "config mode blocage htg.")
|
||||
MAKE_PSTR_LIST(blockTerm, "blockterm", "config of block terminal", "Konfig. Sperrterminal", "Configuratie blookerterminal", "Konfiguration Blockeringsterminal", "konfiguracja terminala blokującego", "konfiguration blokkeringsterminal", "config. du bloque terminal")
|
||||
MAKE_PSTR_LIST(blockHyst, "blockhyst", "hyst. for boiler block", "Hysterese Sperrmodus", "Hysterese blokeerterminal", "Hysteres Blockeringsmodul", "tryb blokowania histerezy", "hystrese blokkeringsmodus", "hyst. Blocage chaudière")
|
||||
MAKE_PSTR_LIST(releaseWait, "releasewait", "boiler release wait time", "Wartezeit Kessel-Freigabe", "Wachttijd ketel vrijgave", "Väntetid Frisläppning", "czas oczekiwania na zwolnienie kotła", "kjele ventetid frigjøring", "temps attente libération chaudière")
|
||||
|
||||
// the following are dhw for the boiler and automatically tagged with 'dhw'
|
||||
MAKE_PSTR_LIST(wwSelTemp, "wwseltemp", "selected temperature", "gewählte Temperatur", "Geselecteerd temperatuur", "Vald Temperatur", "temperatura wyższa/komfort", "valgt temperatur", "température sélectionnée")
|
||||
MAKE_PSTR_LIST(wwSelTempLow, "wwseltemplow", "selected lower temperature", "untere Solltemperatur", "Onderste streeftemperatuur", "Vald lägstatemperatur", "temperatura niższa/eko", "valgt nedre temperatur", "température basse sélectionnée")
|
||||
MAKE_PSTR_LIST(wwSelTempOff, "wwseltempoff", "selected temperature for off", "Solltemperatur bei AUS", "Streeftemperatuur bij UIT", "Vald tempereatur för AV", "temperatura gdy grzanie wyłączone", "valgt tempereatur for av", "température sélectionnée pour arrêt")
|
||||
MAKE_PSTR_LIST(wwSelTempSingle, "wwseltempsingle", "single charge temperature", "Solltemperatur Einmalladung", "Streeftemperatuur enkele lading", "Temperatur Engångsladdning", "temperatura dodatkowej ciepłej wody", "temp engangsoppvarming", "température charge unique")
|
||||
MAKE_PSTR_LIST(wwCylMiddleTemp, "wwcylmiddletemp", "cylinder middle temperature (TS3)", "Speichertemperatur Mitte", "Buffer temperatuur midden", "Cylinder Temperatur Mitten (TS3)", "temperatura środka cylindra (TS3)", "vanntank midten temperatur (TS3)", "température moyenne ballon (TS3)")
|
||||
MAKE_PSTR_LIST(wwSetTemp, "wwsettemp", "set temperature", "Solltemperatur", "Streeftemperatuut", "Börtempertur", "temperatura zadana", "innstilt temperatur", "régler température")
|
||||
MAKE_PSTR_LIST(wwType, "wwtype", "type", "Typ", "type", "Typ", "typ", "type", "type")
|
||||
MAKE_PSTR_LIST(wwComfort, "wwcomfort", "comfort", "Komfort", "Comfort", "Komfort", "komfort", "komfort", "confort")
|
||||
MAKE_PSTR_LIST(wwComfort1, "wwcomfort1", "comfort mode", "Komfort-Modus", "Comfort modus", "Komfortläge", "tryb komfortu", "komfort modus", "mode confort")
|
||||
MAKE_PSTR_LIST(wwFlowTempOffset, "wwflowtempoffset", "flow temperature offset", "Vorlauftemperaturanhebung", "Aanvoertemperatuur offset", "Flödestemperatur förskjutning", "korekta temperatury wypływu", "flyttemperaturforskyvning", "offset température flux")
|
||||
MAKE_PSTR_LIST(wwMaxPower, "wwmaxpower", "max power", "max Leistung", "Maximaal vermogen", "Max Effekt", "moc maksymalna", "maks effekt", "puissance max")
|
||||
MAKE_PSTR_LIST(wwCircPump, "wwcircpump", "circulation pump available", "Zirkulationspumpe vorhanden", "Circulatiepomp aanwezig", "Cirkulationspump tillgänglig", "pompa cyrkulacji zainstalowana", "sirkulasjonspumpe tilgjengelig", "pompe circulation disponible")
|
||||
MAKE_PSTR_LIST(wwChargeType, "wwchargetype", "charging type", "Speicher-Ladungstyp", "Buffer laadtype", "Laddningstyp", "sposób grzania zasobnika", "varmetype", "type chargement")
|
||||
MAKE_PSTR_LIST(wwDisinfectionTemp, "wwdisinfectiontemp", "disinfection temperature", "Desinfektionstemperatur", "Desinfectietemperatuur", "Desinfektionstemperatur", "temperatura dezynfekcji termicznej", "", "température désinfection") // TODO translate
|
||||
MAKE_PSTR_LIST(wwCircMode, "wwcircmode", "circulation pump mode", "Zirkulationspumpen-Modus", "Modus circulatiepomp", "Läge Cirkulationspump", "tryb pracy cyrkulacji", "modus sikulasjonspumpe", "mode pompe circulation")
|
||||
MAKE_PSTR_LIST(wwCirc, "wwcirc", "circulation active", "Zirkulation aktiv", "Circulatiepomp actief", "Cirkulation aktiv", "pompa cyrkulacji", "sirkulasjon aktiv", "circulation active")
|
||||
MAKE_PSTR_LIST(wwCurTemp, "wwcurtemp", "current intern temperature", "aktuelle interne Temperatur", "Huidige interne temperatuur", "Intern Temperatur", "temperatura zasobnika", "gjeldende intern temperatur", "température interne actuelle")
|
||||
MAKE_PSTR_LIST(wwCurTemp2, "wwcurtemp2", "current extern temperature", "aktuelle externe Temperatur", "Huidige externe temperatuur", "Extern Temperatur", "temperatura wypływu", "gjeldende ekstern temperaur", "température externe actuelle")
|
||||
MAKE_PSTR_LIST(wwCurFlow, "wwcurflow", "current tap water flow", "aktueller Durchfluss", "Hudige warmwater doorstroming", "Aktuellt tappvattenflöde", "aktualny przepływ", "gjeldende strømningshastighet", "débit actuel eau robinet")
|
||||
MAKE_PSTR_LIST(wwStorageTemp1, "wwstoragetemp1", "storage intern temperature", "interne Speichertemperatur", "Interne buffertemperatuur", "Beredare Intern Temperatur", "temperatura wewnątrz zasobnika", "intern temperatur bereder", "température interne stockage")
|
||||
MAKE_PSTR_LIST(wwStorageTemp2, "wwstoragetemp2", "storage extern temperature", "externer Speichertemperatur", "Externe buffertemperatuur", "Beredare Extern Tempereatur", "temperatura na wyjściu zasobnika", "ekstern temperatur bereder", "température externe stockage")
|
||||
MAKE_PSTR_LIST(wwActivated, "wwactivated", "activated", "aktiviert", "geactiveerd", "Aktiverad", "system przygotowywania c.w.u.", "aktivert", "activé")
|
||||
MAKE_PSTR_LIST(wwOneTime, "wwonetime", "one time charging", "Einmalladung", "Buffer eenmalig laden", "Engångsladdning", "jednorazowa dodatkowa ciepła woda", "", "charge unique") // TODO translate
|
||||
MAKE_PSTR_LIST(wwDisinfecting, "wwdisinfecting", "disinfecting", "Desinfizieren", "Desinfectie", "Desinficerar", "dezynfekcja termiczna", "desinfiserer", "désinfection")
|
||||
MAKE_PSTR_LIST(wwCharging, "wwcharging", "charging", "Laden", "Laden", "Värmer", "grzanie", "varmer", "chargement")
|
||||
MAKE_PSTR_LIST(wwChargeOptimization, "wwchargeoptimization", "charge optimization", "Ladungsoptimierung", "laadoptimalisatie", "Laddningsoptimering", "optymalizacja grzania", "oppvarmingsoptimalisering", "optimisation charge")
|
||||
MAKE_PSTR_LIST(wwRecharging, "wwrecharging", "recharging", "Nachladen", "herladen", "Laddar om", "ponowne grzanie", "varm på nytt", "en recharge")
|
||||
MAKE_PSTR_LIST(wwTempOK, "wwtempok", "temperature ok", "Temperatur ok", "Temperatuur OK", "Temperatur OK", "temperatura OK", "temperatur ok!", "température ok")
|
||||
MAKE_PSTR_LIST(wwActive, "wwactive", "active", "aktiv", "Actief", "Aktiv", "aktywna", "aktiv", "actif")
|
||||
MAKE_PSTR_LIST(ww3wayValve, "ww3wayvalve", "3-way valve active", "3-Wegeventil aktiv", "3-wegklep actief", "Trevägsventil aktiv", "zawór 3-drogowy aktywny", "aktiv trevisventil", "vanne 3 voies active")
|
||||
MAKE_PSTR_LIST(wwSetPumpPower, "wwsetpumppower", "set pump power", "Soll Pumpenleistung", "Streefwaarde pompvermogen", "Vald pumpeffekt", "ustawione wysterowanie pompy", "valgt pumpeeffekt", "régler puissance pompe")
|
||||
MAKE_PSTR_LIST(wwMixerTemp, "wwmixertemp", "mixer temperature", "Mischertemperatur", "Mixertemperatuur", "Blandningsventil-tempertur", "temperatura mieszacza", "temperatur blandeventil", "température mélangeur")
|
||||
MAKE_PSTR_LIST(wwStarts, "wwstarts", "starts", "Anzahl Starts", "Aantal starts", "Antal starter", "liczba załączeń", "antall starter", "démarrages")
|
||||
MAKE_PSTR_LIST(wwStarts2, "wwstarts2", "control starts2", "Kreis 2 Anzahl Starts", "Aantal starts circuit 2", "Antal starter Krets 2", "liczba załączeń 2", "antall starter krets 2", "démarrages contrôle 2")
|
||||
MAKE_PSTR_LIST(wwWorkM, "wwworkm", "active time", "aktive Zeit", "Actieve tijd", "Aktiv Tid", "czas aktywności", "driftstid", "temps actif")
|
||||
MAKE_PSTR_LIST(wwHystOn, "wwhyston", "hysteresis on temperature", "Einschalttemperaturdifferenz", "Inschakeltemperatuurverschil", "Hysteres PÅ-temperatur", "histereza załączania", "innkoblingstemperaturforskjell", "hystérésis température allumage")
|
||||
MAKE_PSTR_LIST(wwHystOff, "wwhystoff", "hysteresis off temperature", "Ausschalttemperaturdifferenz", "Uitschakeltemperatuurverschil", "Hysteres AV-temperatur", "histereza wyłączania", "utkoblingstemperaturforskjell", "hystérésis température extinction")
|
||||
MAKE_PSTR_LIST(wwProgMode, "wwprogmode", "program", "Programmmodus", "Programma", "Program", "program", "program", "programme")
|
||||
MAKE_PSTR_LIST(wwCircProg, "wwcircprog", "circulation program", "Zirkulationsprogramm", "Circulatieprogramma", "Cirkulationsprogram", "program cyrkulacji c.w.u.", "sirkulationsprogram", "programme circulation")
|
||||
MAKE_PSTR_LIST(wwMaxTemp, "wwmaxtemp", "maximum temperature", "Maximale Temperatur", "Maximale temperatuur", "Maximal Temperatur", "temperatura maksymalna", "", "température max") // TODO translate
|
||||
MAKE_PSTR_LIST(wwOneTimeKey, "wwonetimekey", "one time key function", "Einmalladungstaste", "Knop voor eenmalig laden buffer", "Engångsfunktion", "przycisk jednorazowego ogrzania", "engangsknapp varme", "fonction touche unique")
|
||||
MAKE_PSTR_LIST(wwSolarTemp, "wwsolartemp", "solar boiler temperature", "Solarboiler Temperatur", "Zonneboiler temperatuur", "Solpanel Temp", "temperatura zasobnika solarnego", "", "température chaudière solaire") // TODO translate
|
||||
|
||||
// mqtt values / commands
|
||||
MAKE_PSTR_LIST(switchtime, "switchtime", "program switchtime", "Programm Schaltzeit", "Programma schakeltijd", "Program Bytestid", "program czasowy", "programbyttetid", "heure commutation programme")
|
||||
MAKE_PSTR_LIST(switchtime1, "switchtime1", "own1 program switchtime", "Programm 1 Schaltzeit", "Schakeltijd programma 1", "Program 1 Bytestid", "program przełączania 1", "byttetidprogram 1", "heure de commutation programme 1")
|
||||
MAKE_PSTR_LIST(switchtime2, "switchtime2", "own2 program switchtime", "Programm 2 Schaltzeit", "Schakeltijd programma 2", "Program 2 Bytestid", "program przełączania 2", "byttetid program 2", "heure de changement programme 2")
|
||||
MAKE_PSTR_LIST(wwswitchtime, "wwswitchtime", "program switchtime", "Programm Schaltzeit", "Warm water programma schakeltijd", "Varmvattenprogram Bytestid", "program czasowy", "byttetid varmtvannsprogram", "heure commutation programme")
|
||||
MAKE_PSTR_LIST(wwcircswitchtime, "wwcircswitchtime", "circulation program switchtime", "Zirculationsprogramm Schaltzeit", "Schakeltijd circulatieprogramma", "Cirkulationsprogram Bytestid", "program cyrkulacji", "byttetid sirkulasjonsprogram", "heure commutation programme circulation")
|
||||
MAKE_PSTR_LIST(dateTime, "datetime", "date/time", "Datum/Zeit", "Datum/Tijd", "Datum/Tid", "data i godzina", "dato/tid", "date/heure")
|
||||
MAKE_PSTR_LIST(errorCode, "errorcode", "error code", "Fehlernummer", "Foutmeldingscode", "Felkod", "kod błędu", "feikode", "code erreur")
|
||||
MAKE_PSTR_LIST(ibaMainDisplay, "display", "display", "Anzeige", "Display", "Display", "wyświetlacz", "skjerm", "affichage")
|
||||
MAKE_PSTR_LIST(ibaLanguage, "language", "language", "Sprache", "Taal", "Sprak", "język", "språk", "langue")
|
||||
MAKE_PSTR_LIST(ibaClockOffset, "clockoffset", "clock offset", "Uhrkorrektur", "Klokcorrectie", "Tidskorrigering", "korekta zegara", "tidskorrigering", "offset horloge")
|
||||
MAKE_PSTR_LIST(ibaBuildingType, "building", "building type", "Gebäudetyp", "", "Byggnadstyp", "typ budynku", "bygningstype", "type bâtiment") // TODO translate
|
||||
MAKE_PSTR_LIST(heatingPID, "heatingpid", "heating PID", "Heizungs-PID", "", "Uppvärmning PID", "PID ogrzewania", "oppvarmings PID", "PID chauffage") // TODO translate
|
||||
MAKE_PSTR_LIST(ibaCalIntTemperature, "intoffset", "internal temperature offset", "Korrektur interner Temperatur", "", "Korrigering interntemperatur", "korekta temperatury w pomieszczeniu", "Korrigering interntemperatur", "offset température interne") // TODO translate
|
||||
MAKE_PSTR_LIST(ibaMinExtTemperature, "minexttemp", "minimal external temperature", "min. Aussentemperatur", "", "Min Extern Temperatur", "minimalna miejscowa temperatura zewnętrzna", "minimal eksterntemperatur", "température extérieure minimale") // TODO translate
|
||||
MAKE_PSTR_LIST(backlight, "backlight", "key backlight", "Gegenlicht", "Toetsverlichting", "Bakgrundsbelysning", "podświetlenie klawiatury", "bakgrunnsbelysning", "rétroéclairage touches")
|
||||
MAKE_PSTR_LIST(damping, "damping", "damping outdoor temperature", "Dämpfung der Außentemperatur", "Demping buitentemperatuur", "Utomhustemperatur dämpning", "tłumienie temperatury zewnętrznej", "demping av utetemperatur", "température extérieure minimale")
|
||||
MAKE_PSTR_LIST(tempsensor1, "inttemp1", "temperature sensor 1", "Temperatursensor 1", "Temperatuursensor 1", "Temperatursensor 1", "czujnik temperatury 1", "temperatursensor 1", "sonde température 1")
|
||||
MAKE_PSTR_LIST(tempsensor2, "inttemp2", "temperature sensor 2", "Temperatursensor 2", "Temperatuursensor 2", "Temperatursensor 2", "czujnik temperatury 2", "temperatursensor 2", "capteur température 2")
|
||||
MAKE_PSTR_LIST(dampedoutdoortemp, "dampedoutdoortemp", "damped outdoor temperature", "gedämpfte Außentemperatur", "Gedempte buitentemperatuur", "Utomhustemperatur dämpad", "tłumiona temperatura zewnętrzna", "dempet utetemperatur", "température extérieure amortie")
|
||||
MAKE_PSTR_LIST(floordrystatus, "floordry", "floor drying", "Estrichtrocknung", "Vloerdroogprogramma", "Golvtorkning", "suszenie jastrychu", "gulvtørkeprogram", "séchage sol")
|
||||
MAKE_PSTR_LIST(floordrytemp, "floordrytemp", "floor drying temperature", "Estrichtrocknungs Temperatur", "Temperatuur vloerdroogprogramma", "Golvtorkning Temperatur", "temperatura suszenia jastrychu", "gulvtørketemperatur", "température séchage sol")
|
||||
MAKE_PSTR_LIST(brightness, "brightness", "screen brightness", "Bildschirmhelligkeit", "Schermhelderheid", "Ljusstyrka", "jasność", "lysstyrke", "luminosité écran")
|
||||
MAKE_PSTR_LIST(autodst, "autodst", "automatic change daylight saving time", "automatische Sommerzeit Umstellung", "Automatische omschakeling zomer-wintertijd", "Automatisk växling sommar/vinter-tid", "automatycznie przełączaj na czas letni/zimowy", "automatisk skifte av sommer/vinter-tid", "changement automatique heure d'été")
|
||||
MAKE_PSTR_LIST(preheating, "preheating", "preheating in the clock program", "Vorheizen im Zeitprogramm", "Voorverwarming in het klokprogramma", "Förvärmning i tidsprogram", "podgrzewanie w programie czasowym", "forvarming i tidsprogram", "préchauffage dans programme horloge")
|
||||
MAKE_PSTR_LIST(offtemp, "offtemp", "temperature when mode is off", "Temperatur bei AUS", "Temperatuur bij UIT", "Temperatur Avslagen", "temperatura w trybie \"wył.\"", "temperatur avslått", "température lorsque mode désactivé")
|
||||
MAKE_PSTR_LIST(mixingvalves, "mixingvalves", "mixing valves", "Mischventile", "Mengkleppen", "Blandningsventiler", "zawory mieszające", "blandeventiler", "vannes mélange")
|
||||
MAKE_PSTR_LIST(pvEnableWw, "pvenableww", "enable raise dhw", "aktiviere Anhebung WW", "", "", "podwyższenie c.w.u. z PV", "", "") // TODO translate
|
||||
MAKE_PSTR_LIST(pvRaiseHeat, "pvraiseheat", "raise heating with PV", "Anhebung Heizen mit PV", "", "", "podwyższenie grzania z PV", "", "") // TODO translate
|
||||
MAKE_PSTR_LIST(pvLowerCool, "pvlowercool", "lower cooling with PV", "Kühlabsenkung mit PV", "", "", "obniżenie chłodzenia z PV", "", "") // TODO translate
|
||||
|
||||
// thermostat ww
|
||||
MAKE_PSTR_LIST(wwMode, "wwmode", "mode", "Modus", "Modus", "Läge", "tryb pracy", "modus", "mode")
|
||||
MAKE_PSTR_LIST(wwSetTempLow, "wwsettemplow", "set low temperature", "untere Solltemperatur", "Onderste streeftemperatuur", "Nedre Börvärde", "zadana temperatura obniżona", "nedre settverdi", "réglage température basse")
|
||||
MAKE_PSTR_LIST(wwWhenModeOff, "wwwhenmodeoff", "when thermostat mode off", "bei Thermostatmodus AUS", "Als Thermostaat op UIT", "när Termostatläge är AV", "gdy wyłączono na termostacie", "når modus er av", "lorsque mode thermostat off")
|
||||
MAKE_PSTR_LIST(wwExtra1, "wwextra1", "circuit 1 extra", "Kreis 1 Extra", "Circuit 1 extra", "Krets 1 Extra", "obieg dodatkowy 1", "ekstra krets 1", "circuit 1 extra")
|
||||
MAKE_PSTR_LIST(wwExtra2, "wwextra2", "circuit 2 extra", "Kreis 2 Extra", "Circuit 2 extra", "Kets 2 Extra", "obieg dodatkowy 2", "ekstra krets 2", "circuit 2 extra")
|
||||
MAKE_PSTR_LIST(wwCharge, "wwcharge", "charge", "Laden", "Laden", "Ladda", "grzanie", "lade", "charge")
|
||||
MAKE_PSTR_LIST(wwChargeDuration, "wwchargeduration", "charge duration", "Ladedauer", "Laadtijd", "Laddtid", "czas grzania dodatkowej ciepłej wody", "ladetid", "durée charge")
|
||||
MAKE_PSTR_LIST(wwDisinfect, "wwdisinfect", "disinfection", "Desinfektion", "Desinfectie", "Desinfektion", "dezynfekcja termiczna", "desinfeksjon", "désinfection")
|
||||
MAKE_PSTR_LIST(wwDisinfectDay, "wwdisinfectday", "disinfection day", "Desinfektionstag", "Desinfectiedag", "Desinfektionsdag", "dzień dezynfekcji termicznej", "desinfeksjonsdag", "jour désinfection")
|
||||
MAKE_PSTR_LIST(wwDisinfectHour, "wwdisinfecthour", "disinfection hour", "Desinfektionsstunde", "Desinfectieuur", "Desinfektionstimme", "godzina dezynfekcji termicznej", "desinfeksjonstime", "heure désinfection")
|
||||
MAKE_PSTR_LIST(wwDisinfectTime, "wwdisinfecttime", "disinfection time", "Desinfektionsdauer", "Desinfectietijd", "Desinfektionstid", "maksymalny czas trwania dezynfekcji termicznej", "desinfeksjonstid", "durée désinfection")
|
||||
MAKE_PSTR_LIST(wwDailyHeating, "wwdailyheating", "daily heating", "täglich Heizen", "Dagelijks opwarmen", "Daglig Uppvärmning", "codzienne nagrzewanie", "", "chauffage quotidien") // TODO translate
|
||||
MAKE_PSTR_LIST(wwDailyHeatTime, "wwdailyheattime", "daily heating time", "tägliche Heizzeit", "Tijd dagelijkse opwarming", "Daglig Uppvärmningstid", "czas trwania codziennego nagrzewania", "daglig oppvarmingstid", "heure chauffage quotidien")
|
||||
|
||||
// thermostat hc
|
||||
MAKE_PSTR_LIST(selRoomTemp, "seltemp", "selected room temperature", "Sollwert Raumtemperatur", "Streeftemperatuur kamer", "Vald Rumstemperatur", "zadana temperatura w pomieszczeniu", "valgt rumstemperatur", "température ambiante sélectionnée")
|
||||
MAKE_PSTR_LIST(roomTemp, "currtemp", "current room temperature", "aktuelle Raumtemperatur", "Huidige kamertemperatuur", "Aktuell Rumstemperatur", "temperatura w pomieszczeniu", "gjeldende romstemperatur", "température ambiante actuelle")
|
||||
MAKE_PSTR_LIST(mode, "mode", "mode", "Modus", "Modus", "Läge", "sposób sterowania", "modus", "mode")
|
||||
MAKE_PSTR_LIST(modetype, "modetype", "mode type", "Modus Typ", "Type modus", "Typ av läge", "aktualny tryb pracy", "modusrype", "type mode")
|
||||
MAKE_PSTR_LIST(fastheatup, "fastheatup", "fast heatup", "schnelles Aufheizen", "Snel opwarmen", "Snabb Uppvärmning", "szybkie nagrzewanie", "rask oppvarming", "chauffage rapide")
|
||||
MAKE_PSTR_LIST(daytemp, "daytemp", "day temperature", "Tagestemperatur", "temperatuur dag", "Dagstemperatur", "temperatura w dzień", "dagtemperatur", "température jour")
|
||||
MAKE_PSTR_LIST(daylowtemp, "daytemp2", "day temperature T2", "Tagestemperatur T2", "Temperatuur dag T2", "Dagstemperatur T2", "temperatura w dzień T2", "dagtemperatur T2", "température jour T2")
|
||||
MAKE_PSTR_LIST(daymidtemp, "daytemp3", "day temperature T3", "Tagestemperatur T3", "Temperatuur dag T3", "Dagstemperatur T3", "temperatura w dzień T3", "dagtemperatur T3", "température jour T3")
|
||||
MAKE_PSTR_LIST(dayhightemp, "daytemp4", "day temperature T4", "Tagestemperatur T4", "Temperatuur dag T4", "Dagstemperatur T4", "temperatura w dzień T4", "dagtemperatur T4", "température jour T4")
|
||||
MAKE_PSTR_LIST(heattemp, "heattemp", "heat temperature", "Heizen Temperatur", "Temperatuur verwarming", "Temperatur Uppvärmning", "temperatura ogrzewania", "oppvarmingstemperatur", "température chauffage")
|
||||
MAKE_PSTR_LIST(nighttemp, "nighttemp", "night temperature", "Nachttemperatur", "Nachttemperatuur", "Nattemperatur", "temperatura w nocy", "nattemperatur", "température de nuit")
|
||||
MAKE_PSTR_LIST(nighttemp2, "nighttemp", "night temperature T1", "Nachttemperatur T1", "Nachttemperatuur T1", "Nattemperatur T1", "temperatura w nocy T1", "nattemperatur T1", "température nuit T1")
|
||||
MAKE_PSTR_LIST(ecotemp, "ecotemp", "eco temperature", "eco Temperatur", "Temperatuur eco", "Eko-temperatur", "temperatura w trybie eko", "øko temperatur", "température éco")
|
||||
MAKE_PSTR_LIST(manualtemp, "manualtemp", "manual temperature", "manuelle Temperatur", "Temperatuur handmatig", "Temperatur Manuell", "temperatura ustawiona ręcznie", "manuell temperatur", "température manuelle")
|
||||
MAKE_PSTR_LIST(tempautotemp, "tempautotemp", "temporary set temperature automode", "temporäre Solltemperatur", "Streeftemperatuur automodus tijdelijk", "Temporär Aktivering av Auto-läge", "zadana temperatura w pomieszczenia w trybie \"auto\" (tymczasowa)", "temporær valgt temp i automodus", "température temporaire mode automatique")
|
||||
MAKE_PSTR_LIST(remoteseltemp, "remoteseltemp", "temporary set temperature from remote", "temporäre Solltemperatur Remote", "Temperatuur van afstandsbedieding", "Temperatur från fjärruppkoppling", "zadana zdalnie temperatura a pomieszczeniu (tymczasowa)", "temporær valgt temp fra fjernbetjening", "température temporaire depuis télécommande")
|
||||
MAKE_PSTR_LIST(comforttemp, "comforttemp", "comfort temperature", "Komforttemperatur", "Comforttemperatuur", "Komforttemperatur", "temperatura w trybie komfort", "komforttemperatur", "température confort")
|
||||
MAKE_PSTR_LIST(summertemp, "summertemp", "summer temperature", "Sommertemperatur", "Zomertemperatuur", "Sommartemperatur", "temperatura przełączania lato/zima", "Sommertemperatur", "température été")
|
||||
MAKE_PSTR_LIST(designtemp, "designtemp", "design temperature", "Auslegungstemperatur", "Ontwerptemperatuur", "Design-temperatur", "temperatura projektowa", "designtemperatur", "température conception")
|
||||
MAKE_PSTR_LIST(offsettemp, "offsettemp", "offset temperature", "Temperaturanhebung", "Temperatuur offset", "Temperaturkorrigering", "korekta temperatury", "temperaturkorrigering", "température offset")
|
||||
MAKE_PSTR_LIST(minflowtemp, "minflowtemp", "min flow temperature", "min Vorlauftemperatur", "", "Min Flödestemperatur", "minimalna temperatura zasilania", "min turtemperatur", "température min flux") // TODO translate
|
||||
MAKE_PSTR_LIST(maxflowtemp, "maxflowtemp", "max flow temperature", "max Vorlauftemperatur", "", "Max Flödestemperatur", "maksymalna temperatura zasilania", "maks turtemperatur", "température max flux") // TODO translate
|
||||
MAKE_PSTR_LIST(roominfluence, "roominfluence", "room influence", "Raumeinfluss", "Ruimteinvloed", "Rumspåverkan", "wpływ pomieszczenia", "rominnflytelse", "influence pièce")
|
||||
MAKE_PSTR_LIST(roominfl_factor, "roominflfactor", "room influence factor", "Raumeinflussfaktor", "Factor ruimteinvloed", "Rumspåverkansfaktor", "współczynnik wpływu pomieszczenia", "rominnflytelsesfaktor", "facteur d'influence pièce")
|
||||
MAKE_PSTR_LIST(curroominfl, "curroominfl", "current room influence", "aktueller Raumeinfluss", "Huidige ruimteinvloed", "Aktuell Rumspåverkan", "aktualny wpływ pomieszczenia", "gjeldende rominnflytelse", "influence actuelle pièce")
|
||||
MAKE_PSTR_LIST(nofrosttemp, "nofrosttemp", "nofrost temperature", "Frostschutztemperatur", "Temperatuur vorstbeveiliging", "Temperatur Frostskydd", "temperatura ochrony przed zamarzaniem", "frostbeskyttelsestemperatur", "température protection gel")
|
||||
MAKE_PSTR_LIST(targetflowtemp, "targetflowtemp", "target flow temperature", "berechnete Vorlauftemperatur", "Berekende aanvoertemperatuur", "Målvärde Flödestemperatur", "zadana temperatura zasilania", "målverdi turtemperatur", "température cible flux")
|
||||
MAKE_PSTR_LIST(heatingtype, "heatingtype", "heating type", "Heizungstyp", "Verwarmingstype", "Värmesystem", "system grzewczy", "varmesystem", "type chauffage")
|
||||
MAKE_PSTR_LIST(summersetmode, "summersetmode", "set summer mode", "Einstellung Sommerbetrieb", "Instelling zomerbedrijf", "Aktivera Sommarläge", "tryb lato/zima", "aktiver sommermodus", "activer mode été")
|
||||
MAKE_PSTR_LIST(hpoperatingmode, "hpoperatingmode", "heatpump operating mode", "Wärmepumpe Betriebsmodus", "Bedrijfsmodus warmtepomp", "Värmepump Driftläge", "tryb pracy pompy ciepła", "driftsmodus varmepumpe", "mode fonctionnement pompe à chaleur")
|
||||
MAKE_PSTR_LIST(hpoperatingstate, "hpoperatingstate", "heatpump operating state", "WP Arbeitsweise", "Huidige modus warmtepomp", "Värmepump driftläge", "aktualny tryb pracy pompy ciepła", "driftstatus varmepumpe", "état fonctionnement pompe à chaleur")
|
||||
MAKE_PSTR_LIST(controlmode, "controlmode", "control mode", "Kontrollmodus", "Comtrolemodus", "Kontrolläge", "tryb sterowania", "kontrollmodus", "mode régulation")
|
||||
MAKE_PSTR_LIST(control, "control", "control device", "Fernsteuerung", "Afstandsbedieding", "Kontrollenhet", "sterownik", "kontrollenhet", "dispositif régulation")
|
||||
MAKE_PSTR_LIST(roomsensor, "roomsensor", "room sensor", "Raumsensor", "Ruimtesensor", "Rumssensor", "czujnik temperatury pomieszczenia", "romsensor", "capteur pièce")
|
||||
MAKE_PSTR_LIST(program, "program", "program", "Programm", "Programma", "Program", "program", "program", "programme")
|
||||
MAKE_PSTR_LIST(pause, "pause", "pause time", "Pausenzeit", "Pausetijd", "Paustid", "czas przerwy", "pausetid", "temps de pause")
|
||||
MAKE_PSTR_LIST(party, "party", "party time", "Partyzeit", "Partytijd", "Partytid", "czas przyjęcia", "partytid", "temps de fête")
|
||||
MAKE_PSTR_LIST(holidaytemp, "holidaytemp", "holiday temperature", "Urlaubstemperatur", "Vakantietemperatuur", "Helgtemperatur", "temperatura w trybie urlopowym", "ferietemperatur", "température vacances")
|
||||
MAKE_PSTR_LIST(summermode, "summermode", "summer mode", "Sommerbetrieb", "Zomerbedrijf", "Sommarläge", "aktualny tryb lato/zima", "sommermodus", "mode été")
|
||||
MAKE_PSTR_LIST(holidaymode, "holidaymode", "holiday mode", "Urlaubsbetrieb", "Vakantiebedrijf", "Helgläge", "tryb urlopowy", "feriemodus", "mode vacances")
|
||||
MAKE_PSTR_LIST(flowtempoffset, "flowtempoffset", "flow temperature offset for mixer", "Vorlauftemperaturanhebung", "Mixer aanvoertemperatuur offset", "Temperaturkorrigering Flödestemp. Blandningsventil", "korekta temperatury przepływu dla miksera", "temperaturkorrigering av blandingsventil", "décalage température de bascule pour mélangeur")
|
||||
MAKE_PSTR_LIST(reducemode, "reducemode", "reduce mode", "Absenkmodus", "Gereduceerde modus", "Reducerat Läge", "tryb zredukowany/obniżony", "", "mode réduction") // TODO translate
|
||||
MAKE_PSTR_LIST(noreducetemp, "noreducetemp", "no reduce below temperature", "Durchheizen unter", "Reduceermodus onderbreken onder", "Inaktivera reducering under", "bez redukcji poniżej temperatury", "inaktiver redusert nedre temp", "pas de réduction en dessous température")
|
||||
MAKE_PSTR_LIST(reducetemp, "reducetemp", "off/reduce switch temperature", "Absenkmodus unter", "Onderste afschakeltemperatuur", "Avslag/Reducera under", "tryb zredukowany poniżej temperatury", "nedre avstengningstemperatur", "arrêt/réduction température bascule")
|
||||
MAKE_PSTR_LIST(vacreducetemp, "vacreducetemp", "vacations off/reduce switch temperature", "Urlaub Absenkmodus unter", "Vakantiemodus onderste afschakeltemperatuur", "Helg Avslag/Reducering under", "tryb urlopowy poniżej temperatury", "feriemodus nedre utkoblingstemperatur", "vacances – arrêt/réduction température bascule")
|
||||
MAKE_PSTR_LIST(vacreducemode, "vacreducemode", "vacations reduce mode", "Urlaub Absenkmodus", "Vakantie afschakelmodus", "Helg reduceringsläge", "redukcja w trakcie urlopu", "ferieavstengningsmodus", "mode réduction vacances")
|
||||
MAKE_PSTR_LIST(nofrostmode, "nofrostmode", "nofrost mode", "Frostschutz Modus", "Vorstbeveiligingsmodus", "Frostskyddsläge", "temperatura wiodąca dla ochrony przed zamarzaniem", "frostbeskyttelsesmodus", "mode protection gel")
|
||||
MAKE_PSTR_LIST(remotetemp, "remotetemp", "room temperature from remote", "Raumtemperatur Remote", "Ruimtetemperatuur van afstandsbediening", "Rumstemperatur från fjärr", "temperatura w pomieszczeniu (z termostatu)", "romstemperatur fra fjernbetjening", "température pièce depuis télécommande")
|
||||
MAKE_PSTR_LIST(wwHolidays, "wwholidays", "holiday dates", "Feiertage", "Feestdagen", "Helgdagar", "dni świąteczne", "feriedager varmtvann", "dates vacances")
|
||||
MAKE_PSTR_LIST(wwVacations, "wwvacations", "vacation dates", "Urlaubstage", "Vakantiedagen", "Semesterdatum Varmvatten", "dni urlopowe", "ferie dato varmtvann", "dates vacances")
|
||||
MAKE_PSTR_LIST(holidays, "holidays", "holiday dates", "Feiertage", "Feestdagen", "Helgdatum", "święta", "helligdager", "dates vacances")
|
||||
MAKE_PSTR_LIST(vacations, "vacations", "vacation dates", "Urlaubstage", "Vakantiedagen", "Semesterdatum", "urlop", "feriedager", "dates vacances")
|
||||
MAKE_PSTR_LIST(wwprio, "wwprio", "dhw priority", "WW-Vorrang", "Prioriteit warm water", "Prioritera Varmvatten", "priorytet dla c.w.u.", "prioroter varmtvann", "priorité ecs")
|
||||
MAKE_PSTR_LIST(nofrostmode1, "nofrostmode1", "nofrost mode", "Frostschutz", "Vorstbeveiligingsmodus", "Frostskyddsläge", "ochrona przed zamarzaniem", "frostbeskyttelse", "mode protection gel")
|
||||
MAKE_PSTR_LIST(reducehours, "reducehours", "duration for nighttemp", "Dauer Nachttemp.", "Duur nachtverlaging", "Timmar Nattsänkning", "czas trwania trybu nocnego", "timer nattsenkning", "durée température nuit")
|
||||
MAKE_PSTR_LIST(reduceminutes, "reduceminutes", "remaining time for nightmode", "Restzeit Nachttemp.", "Resterende tijd nachtverlaging", "Återstående Tid Nattläge", "czas do końca trybu nocnego", "gjenværende tid i nattstilling", "temps restant mode nuit")
|
||||
MAKE_PSTR_LIST(switchonoptimization, "switchonoptimization", "switch-on optimization", "Einschaltoptimierung", "Inschakeloptimalisering", "Växlingsoptimering", "optymalizacja załączania", "slå på optimalisering", "optimisation mise en marche")
|
||||
|
||||
// heatpump
|
||||
MAKE_PSTR_LIST(airHumidity, "airhumidity", "relative air humidity", "relative Luftfeuchte", "Relatieve luchtvochtigheid", "Relativ Luftfuktighet", "wilgotność względna w pomieszczeniu", "luftfuktighet", "humidité relative air")
|
||||
MAKE_PSTR_LIST(dewTemperature, "dewtemperature", "dew point temperature", "Taupunkttemperatur", "Dauwpunttemperatuur", "Daggpunkt", "punkt rosy w pomieszczeniu", "duggtemperatur", "température point rosée")
|
||||
|
||||
// mixer
|
||||
MAKE_PSTR_LIST(flowSetTemp, "flowsettemp", "setpoint flow temperature", "Sollwert Vorlauftemperatur", "Streefwaarde aanvoertemperatuur", "Vald flödestemperatur", "zadana temperatura zasilania", "valgt turtemperatur", "consigne température flux")
|
||||
MAKE_PSTR_LIST(flowTempHc, "flowtemphc", "flow temperature (TC1)", "Vorlauftemperatur HK (TC1)", "Aanvoertemperatuut circuit (TC1)", "Flödestemperatur (TC1)", "temperatura zasilania (TC1)", "turtemperatur (TC1)", "température flux (TC1)")
|
||||
MAKE_PSTR_LIST(pumpStatus, "pumpstatus", "pump status (PC1)", "Pumpenstatus HK (PC1)", "pompstatus circuit (PC1)", "Pumpstatus (PC1)", "status pompy (PC1)", "pumpestatus (PC1)", "état pompe (PC1)")
|
||||
MAKE_PSTR_LIST(mixerStatus, "valvestatus", "mixing valve actuator (VC1)", "Mischerventil Position (VC1)", "positie mixerklep (VC1)", "Shuntventil Status (VC1)", "siłownik zaworu mieszającego (VC1)", "shuntventil status (VC1)", "actionnement vanne mélangeur (VC1)")
|
||||
MAKE_PSTR_LIST(flowTempVf, "flowtempvf", "flow temperature in header (T0/Vf)", "Vorlauftemperatur am Verteiler (T0/Vf)", "aanvoertemperatuur verdeler (T0/Vf)", "Flödestemperatur Fördelare (T0/Vf)", "temperatura zasilania na rozdzielaczu (T0/Vf)", "turtemperatur ved fordeleren (T0/Vf)", "température départ collecteur (T0/Vf)")
|
||||
MAKE_PSTR_LIST(mixerSetTime, "valvesettime", "time to set valve", "Zeit zum Einstellen des Ventils", "Inschakeltijd mengklep", "Inställningstid Ventil", "czas na ustawienie zaworu", "instillningstid ventil", "délai activation vanne")
|
||||
// mixer prefixed with wwc
|
||||
MAKE_PSTR_LIST(wwPumpStatus, "pumpstatus", "pump status in assigned wwc (PC1)", "Pumpenstatus des wwk (PC1)", "Pompstatus in WW circuit (PC1)", "Pumpstatus i VV-krets (PC1)", "stan pompy w obwodzie c.w.u. (PC1)", "Pumpestatus i VV-krets (PC1)", "état pompe wwc (PC1)")
|
||||
MAKE_PSTR_LIST(wwTempStatus, "wwtempstatus", "temperature switch in assigned wwc (MC1)", "Temperaturschalter des wwk (MC1)", "Temperatuurschakeling in WW circuit (MC1)", "Temperaturventil i VV-krets (MC1)", "temperatura w obwodzie c.w.u. (MC1)", "temperaturventil i VV-krets (MC1)", "température bascule wwc (MC1).")
|
||||
MAKE_PSTR_LIST(wwTemp, "wwtemp", "current temperature", "aktuelle Temperatur", "huidige temperatuur", "Aktuell Temperatur", "temperatura c.w.u.", "aktuell temperatur", "température actuelle")
|
||||
// mixer pool
|
||||
MAKE_PSTR_LIST(poolSetTemp, "poolsettemp", "pool set temperature", "Pool Solltemperatur", "Streeftemperatuur zwembad", "Pool Temperatur Börvärde", "zadana temperatura basenu", "valgt temp basseng", "température consigne piscine")
|
||||
MAKE_PSTR_LIST(poolTemp, "pooltemp", "pool temperature", "Pool Temperatur", "Zwembadtemperatuur", "Pooltemperatur", "temperatura basenu", "bassengtemperatur", "température piscine")
|
||||
MAKE_PSTR_LIST(poolShuntStatus, "poolshuntstatus", "pool shunt status opening/closing", "Pool Ventil öffnen/schließen", "Zwembadklep status openen/sluiten", "Pool Shunt-status öppnen/stängd", "status bocznika basenu", "bassengshunt-status åpen/stengt", "état shunt piscine ouvert/fermé")
|
||||
MAKE_PSTR_LIST(poolShunt, "poolshunt", "pool shunt open/close (0% = pool / 100% = heat)", "Pool Ventil Öffnung", "Mengklep zwembad stand", "Pool Shunt Öppen/Stängd", "bocznik basenu (0% = basen / 100% = grzanie)", "bassengshunt åpen/stengt (0% = basseng / 100% = varme)", "ouverture/fermeture shunt piscine (0% = piscine / 100% = chaleur).")
|
||||
MAKE_PSTR_LIST(hydrTemp, "hydrTemp", "hydraulic header temperature", "Verteilertemperatur", "Temperatuur open verdeler", "Fördelartemperatur", "temperatura kolektora hydraulicznego", "Fordelertemperatur", "température collecteur hydraulique")
|
||||
|
||||
// solar
|
||||
MAKE_PSTR_LIST(cylMiddleTemp, "cylmiddletemp", "cylinder middle temperature (TS3)", "Speichertemperatur Mitte (TS3)", "Zonneboilertemperatuur midden (TS3)", "Cylindertemperatur Mitten (TS3)", "temperatura w środku zasobnika (TS3)", "beredertemperatur i midten (TS3)", "température moyenne cylindre (TS3)")
|
||||
MAKE_PSTR_LIST(retHeatAssist, "retheatassist", "return temperature heat assistance (TS4)", "Rücklaufanhebungs-Temp. (TS4)", "Retourtemperatuur verwarmingsassistentie (TS4)", "Returtemperatur värmestöd (TS4)", "temperatura powrotu wspomagania grzania (TS4)", "returtemperatur varmestøtte (TS4)", "température retour de assistance thermique (TS4)")
|
||||
MAKE_PSTR_LIST(m1Valve, "heatassistvalve", "heat assistance valve (M1)", "Ventil Heizungsunterstützung (M1)", "Klep verwarmingsassistentie (M1)", "Uppvärmningsstöd Ventil (M1)", "zawór wspomagania grzania (M1)", "varmehjelpsventil (M1)", "vanne assistance thermique (M1)")
|
||||
MAKE_PSTR_LIST(m1Power, "heatassistpower", "heat assistance valve power (M1)", "Ventilleistung Heizungsunterstützung (M1)", "Vermogen klep verwarmingsassistentie (M1)", "Uppvärmningsstöd Ventil Effekt (M1)", "moc zaworu wspomagania grzania (M1)", "varmehjelpsventileffekt (M1)", "puissance vanne assistance thermique (M1)")
|
||||
MAKE_PSTR_LIST(pumpMinMod, "pumpminmod", "minimum pump modulation", "minimale Pumpenmodulation", "Minimale pompmodulatie", "Min Pumpmodulering", "minimalna modulacja pompy", "minimum pumpmodulering", "modulation minimale pompe")
|
||||
MAKE_PSTR_LIST(maxFlow, "maxflow", "maximum solar flow", "maximaler Durchfluss", "Maximale doorstroom solar", "Max Flöde Solpanel", "maksymalny przepływ solarów", "maks strømming solpanel ", "débit solaire maximum")
|
||||
MAKE_PSTR_LIST(solarPower, "solarpower", "actual solar power", "aktuelle Solarleistung", "Huidig solar vermogen", "Aktuellt Sol-effekt", "aktualna moc solarów", "aktuell soleffekt", "puissance solaire réelle")
|
||||
MAKE_PSTR_LIST(solarPumpTurnonDiff, "turnondiff", "pump turn on difference", "Einschalthysterese Pumpe", "Inschakelhysterese pomp", "Aktiveringshysteres Pump", "histereza załączenia pompy", "slå på hysteresepumpe", "différence activation pompe")
|
||||
MAKE_PSTR_LIST(solarPumpTurnoffDiff, "turnoffdiff", "pump turn off difference", "Ausschalthysterese Pumpe", "Uitschakelhysterese pomp", "Avslagshysteres Pump", "histereza włączenia pompy", "slå av hysteresepumpe", "différence arrêt pompe")
|
||||
MAKE_PSTR_LIST(pump2MinMod, "pump2minmod", "minimum pump 2 modulation", "minimale Modulation Pumpe 2", "Minimale modulatie pomp 2", "Min Modulering Pump 2", "minimalna modulacja pompy 2", "minimum pumpmodulering 2", "modulation minimale pompe 2")
|
||||
MAKE_PSTR_LIST(solarPump2TurnonDiff, "turnondiff2", "pump 2 turn on difference", "Einschalthysterese Pumpe 2", "Inschakelhysterese pomp 2", "Aktiveringshysteres Pump 2", "histereza załączenia pompy 2", "slå på hysteresepumpe 2", "différence activation pompe 2")
|
||||
MAKE_PSTR_LIST(solarPump2TurnoffDiff, "turnoffdiff2", "pump 2 turn off difference", "Ausschalthysterese Pumpe 2", "Uitschakelhysterese pomp 2", "Avslagshysteres Pump 2", "histereza wyłączenia pompy 2", "slå av hysteresepumpe 2", "différence arrêt pompe 2")
|
||||
MAKE_PSTR_LIST(collectorTemp, "collectortemp", "collector temperature (TS1)", "Kollektortemperatur (TS1)", "Collectortemperatuur (TS1)", "Kollektor Temperatur (TS1)", "temperatura kolektora (TS1)", "kollektor temperatur (TS1)", "température collecteur (TS1)")
|
||||
MAKE_PSTR_LIST(collector2Temp, "collector2temp", "collector 2 temperature (TS7)", "Kollector 2 Temperatur (TS7)", "Collector 2 temperatuur (TS7)", "Kollektor 2 Temperatur (TS7)", "temperatura kolektora 2 (TS7)", "kollektor 2 temperatur (TS7)", "température collecteur 2 (TS7)")
|
||||
MAKE_PSTR_LIST(cylBottomTemp, "cylbottomtemp", "cylinder bottom temperature (TS2)", "Speicher Bodentemperatur (TS2)", "Bodemtemperatuur zonneboiler (TS2)", "Cylindertemperatur Botten (TS2)", "temperatura na spodzie zasobnika (TS2)", "beredertemp i bunn (TS2)", "température fond de cylindre (TS2)")
|
||||
MAKE_PSTR_LIST(cyl2BottomTemp, "cyl2bottomtemp", "second cylinder bottom temperature (TS5)", "2. Speicher Bodentemperatur (TS5)", "Bodemtemperatuur 2e boiler", "Sekundär Cylindertemperatur Botten (TS5)", "temperatura na spodzie drugiego zasobnika (TS5)", "skundær beredertemp i bunn (TS5)", "température fond de cylindre (TS5)")
|
||||
MAKE_PSTR_LIST(heatExchangerTemp, "heatexchangertemp", "heat exchanger temperature (TS6)", "wärmetauscher Temperatur (TS6)", "Temperatuur warmtewisselaar (TS6)", "Värmeväxlare Temperatur (TS6)", "temperatura wymiennika ciepła (TS6)", "", "température échangeur de chaleur (TS6)") // TODO translate
|
||||
MAKE_PSTR_LIST(collectorMaxTemp, "collectormaxtemp", "maximum collector temperature", "maximale Kollektortemperatur", "Maximale collectortemperatuur", "Max Kollektortemperatur", "maksymalna temperatura kolektora", "maks kollektortemperatur", "température max. collecteur")
|
||||
MAKE_PSTR_LIST(collectorMinTemp, "collectormintemp", "minimum collector temperature", "minimale Kollektortemperatur", "Minimale collectortemperatuur", "Min Kollektortemperatur", "minimalna temperatura kolektora", "min kollektortemperatur", "température min. collecteur")
|
||||
MAKE_PSTR_LIST(cylMaxTemp, "cylmaxtemp", "maximum cylinder temperature", "maximale Speichertemperatur", "maximale temperatuur zonneboiler", "Max Cylindertemperatur", "maksymalna temperatura zasobnika", "maks beredertemperatur", "température max. cylindre")
|
||||
MAKE_PSTR_LIST(solarPumpMod, "solarpumpmod", "pump modulation (PS1)", "Pumpenmodulation (PS1)", "Pompmodulatie (PS1)", "Pumpmodulering (PS1)", "modulacja pompy solarnej (PS1)", "solpumpmodulering (PS1)", "modulation pompe (PS1)")
|
||||
MAKE_PSTR_LIST(cylPumpMod, "cylpumpmod", "cylinder pump modulation (PS5)", "Speicherpumpenmodulation (PS5)", "Modulatie zonneboilerpomp (PS5)", "Cylinderpumpmodulering (PS5)", "modulacja pompy zasobnika (PS5)", "", "modulation pompe cylindre (PS5)") // TODO translate
|
||||
MAKE_PSTR_LIST(solarPump, "solarpump", "pump (PS1)", "Pumpe (PS1)", "Pomp (PS1)", "Pump (PS1)", "pompa solarna (PS1)", "solpumpe (PS1)", "pompe solaire (PS1)")
|
||||
MAKE_PSTR_LIST(solarPump2, "solarpump2", "pump 2 (PS4)", "Pumpe 2 (PS4)", "Pomp 2 (PS4)", "Pump 2 (PS4)", "pompa solarna 2 (PS4)", "solpumpe 2 (PS4)", "pompe 2 (PS4)")
|
||||
MAKE_PSTR_LIST(solarPump2Mod, "solarpump2mod", "pump 2 modulation (PS4)", "Pumpe 2 Modulation (PS4)", "Modulatie pomp 2 (PS4)", "Pump 2 Modulering (PS4)", "modulacja pompy solarnej 2 (PS4)", "solpumpe2modulering (PS4)", "modulation pompe solaire 2 (PS4)")
|
||||
MAKE_PSTR_LIST(valveStatus, "valvestatus", "valve status", "Ventilstatus", "Klepstatus", "Ventilstatus", "stan zaworu", "ventilstatus", "statut valve")
|
||||
MAKE_PSTR_LIST(cylHeated, "cylheated", "cyl heated", "Speichertemperatur erreicht", "Boilertemperatuur behaald", "Värmepanna Uppvärmd", "zasobnik został nagrzany", "bereder oppvarmt", "cylindre chauffé")
|
||||
MAKE_PSTR_LIST(collectorShutdown, "collectorshutdown", "collector shutdown", "Kollektorabschaltung", "Collector afschakeling", "Kollektor Avstängning", "wyłączenie kolektora", "kollektor stengt", "arrêt collecteur")
|
||||
MAKE_PSTR_LIST(pumpWorkTime, "pumpworktime", "pump working time", "Pumpenlaufzeit", "Pomplooptijd", "Pump Drifttid", "czas pracy pompy", "driftstid pumpe", "durée fonctionnement pompe")
|
||||
MAKE_PSTR_LIST(pump2WorkTime, "pump2worktime", "pump 2 working time", "Pumpe 2 Laufzeit", "Looptijd pomp 2", "Pump 2 Drifttid", "czas pracy pompy 2", "driftstid pumpe2", "durée fonctionnement pompe 2")
|
||||
MAKE_PSTR_LIST(m1WorkTime, "m1worktime", "differential control working time", "Differenzregelung Arbeitszeit", "Verschilregeling arbeidstijd", "Differentialreglering Drifttid", "czas pracy regulacji różnicowej", "differentialreguleringssrifttid", "durée fonctionnement contrôle différentiel")
|
||||
MAKE_PSTR_LIST(energyLastHour, "energylasthour", "energy last hour", "Energie letzte Std", "Energie laatste uur", "Energi Senaste Timmen", "energia w ciągu ostatniej godziny", "energi siste time", "énergie dernière heure")
|
||||
MAKE_PSTR_LIST(energyTotal, "energytotal", "total energy", "Gesamtenergie", "Totale energie", "Total Energi", "energia całkowita", "total energi", "énergie totale")
|
||||
MAKE_PSTR_LIST(energyToday, "energytoday", "total energy today", "Energie heute", "Energie vandaag", "Total Energi Idag", "energia całkowita dzisiaj", "total energi i dag", "énergie totale aujourd'hui")
|
||||
|
||||
// solar ww
|
||||
MAKE_PSTR_LIST(wwTemp1, "wwtemp1", "temperature 1", "Temperatur 1", "Temperatuur 1", "Temperatur 1", "temperatura 1", "temperatur 1", "température 1")
|
||||
MAKE_PSTR_LIST(wwTemp3, "wwtemp3", "temperature 3", "Temperatur 3", "Temperatuur 2", "Temperatur 2", "temperatura 2", "Temperatur 3", "température 3")
|
||||
MAKE_PSTR_LIST(wwTemp4, "wwtemp4", "temperature 4", "Temperatur 4", "Temperatuur 3", "Temperatur 3", "temperatura 3", "Temperatur 4", "température 4")
|
||||
MAKE_PSTR_LIST(wwTemp5, "wwtemp5", "temperature 5", "Temperatur 5", "Temperatuur 5", "Temperatur 4", "temperatura 4", "Temperatur 5", "température 5")
|
||||
MAKE_PSTR_LIST(wwTemp7, "wwtemp7", "temperature 7", "Temperatur 7", "Temperatuur 7", "Temperatur 5", "temperatura 5", "Temperatur 7", "température 7")
|
||||
MAKE_PSTR_LIST(wwPump, "wwpump", "pump", "Pumpe", "Pomp", "Pump", "pompa", "", "pompe") // TODO translate
|
||||
// solar ww and mixer wwc
|
||||
MAKE_PSTR_LIST(wwMinTemp, "wwmintemp", "minimum temperature", "minimale Temperatur", "Minimale temperatuur", "Min Temperatur", "temperatura minimalna", "min temperatur", "température min")
|
||||
MAKE_PSTR_LIST(wwRedTemp, "wwredtemp", "reduced temperature", "reduzierte Temperatur", "Gereduceerde temperatuur", "Reducerad Temperatur", "temperatura zredukowana", "reducert temperatur", "température réduite")
|
||||
MAKE_PSTR_LIST(wwDailyTemp, "wwdailytemp", "daily temperature", "tägl. Temperatur", "Dagelijkse temperatuur", "Daglig temperatur", "temperatura dzienna", "dagtemperatur", "température en journée")
|
||||
MAKE_PSTR_LIST(wwKeepWarm, "wwkeepwarm", "keep warm", "Warmhalten", "Warm houde", "Varmhållning", "utrzymywanie ciepła", "holde varmen", "maintenir chaleur")
|
||||
MAKE_PSTR_LIST(wwStatus2, "wwstatus2", "status 2", "Status 2", "Status 2", "Status 2", "status 2", "status 2", "statut 2")
|
||||
MAKE_PSTR_LIST(wwPumpMod, "wwpumpmod", "pump modulation", "Pumpen Modulation", "Pompmodulatie", "Pumpmodulering", "modulacja pompy", "pumpemodulering", "modulation de pompe")
|
||||
MAKE_PSTR_LIST(wwFlow, "wwflow", "flow rate", "Volumenstrom", "Doorstroomsnelheid", "Flöde", "przepływ", "strømningshastighet", "débit")
|
||||
// extra mixer ww
|
||||
MAKE_PSTR_LIST(wwRequiredTemp, "wwrequiredtemp", "required temperature", "benötigte Temperatur", "Benodigde temperatuur", "Nödvändig Temperatur", "temperatura wymagana", "nødvendig temperatur", "température requise")
|
||||
MAKE_PSTR_LIST(wwDiffTemp, "wwdifftemp", "start differential temperature", "Start Differential Temperatur", "Start differentiele temperatuur", "Start Differentialtemperatur", "start temperatury różnicowej", "start differensialtemperatur", "température différentielle de départ")
|
||||
|
||||
// SM100
|
||||
MAKE_PSTR_LIST(heatTransferSystem, "heattransfersystem", "heattransfer system", "Wärmeübertragungs-System", "Warmteoverdrachtssysteem", "Värmeöverföringssystem", "system wymiany ciepła", "varmeoverføringssystem", "système de transfert de chaleur")
|
||||
MAKE_PSTR_LIST(externalCyl, "externalcyl", "external cylinder", "Externer Speicher", "Externe boiler", "Extern Cylinder", "zbiornik zewnętrzny", "ekstern bereder", "cylindre externe")
|
||||
MAKE_PSTR_LIST(thermalDisinfect, "thermaldisinfect", "thermal disinfection", "Thermische Desinfektion", "Thermische desinfectie", "Termisk Desinfektion", "dezynfekcja termiczna", "termisk desinfeksjon", "désinfection thermique")
|
||||
MAKE_PSTR_LIST(heatMetering, "heatmetering", "heatmetering", "Wärmemessung", "warmtemeting", "Värmemätning", "pomiar ciepła", "varmemåling", "mesure de chaleur")
|
||||
MAKE_PSTR_LIST(solarIsEnabled, "solarenabled", "solarmodule enabled", "Solarmodul aktiviert", "Solarmodule geactiveerd", "Solmodul Aktiverad", "system solarny", "solmodul aktivert", "module solaire activé")
|
||||
|
||||
// telegram 0x035A
|
||||
MAKE_PSTR_LIST(solarPumpMode, "solarpumpmode", "pump mode", "Solar Pumpen Einst.", "Modus zonneboilerpomp", "Sol Pumpläge", "tryb pracy pompy", "solpumpemodus", "mode pompe solaire")
|
||||
MAKE_PSTR_LIST(solarPumpKick, "pumpkick", "pump kick", "Röhrenkollektorfunktion", "Modus buizencollector", "Sol Kollektorfunktion", "wspomaganie startu pompy", "solkllektorfunksjon", "démarrage boost pompe solaire")
|
||||
MAKE_PSTR_LIST(plainWaterMode, "plainwatermode", "plain water mode", "Südeuropafunktion", "Modus Zuid-Europa", "Sydeuropa-funktion", "tylko woda (dla Europy Południowej)", "vanlig vannmodus", "mode eau ordinaire")
|
||||
MAKE_PSTR_LIST(doubleMatchFlow, "doublematchflow", "doublematchflow", "Double Match Flow", "Double Match Flow", "Dubbelmatchning Flöde", "przepływ podwójnie dopasowany", "dobbelmatch flow", "double match flow")
|
||||
MAKE_PSTR_LIST(solarPump2Mode, "pump2mode", "pump 2 mode", "Pumpe 2 Modus", "Modus pomp 2", "Pump 2 Läge", "tryb pracy pompy 2", "pump 2 modus", "mode pompe 2")
|
||||
MAKE_PSTR_LIST(solarPump2Kick, "pump2kick", "pump kick 2", "Pumpe 2 Startboost", "Startboost pomp 2", "Pump 2 Kollektorfunktion", "wspomaganie startu pompy 2", "startboost pumpe 2", "démarrage boost pompe 2")
|
||||
|
||||
// telegram 0x035F
|
||||
MAKE_PSTR_LIST(cylPriority, "cylpriority", "cylinder priority", "Speicher Priorität", "Prioriteit boiler", "Cylinderprioritering", "priorytet cylindra", "berederprioritering", "priorité de cylindre")
|
||||
|
||||
// telegram 0x380
|
||||
MAKE_PSTR_LIST(climateZone, "climatezone", "climate zone", "Klimazone", "klimaatzone", "Klimatzon", "strefa klimatyczna", "klimasone", "zone de climat")
|
||||
MAKE_PSTR_LIST(collector1Area, "collector1area", "collector 1 area", "Kollektor 1 Fläche", "oppervlakte collector 1", "Kollektor 1 Area", "powierzchnia kolektora 1", "kollektor 1 område", "zone collecteur 1")
|
||||
MAKE_PSTR_LIST(collector1Type, "collector1type", "collector 1 type", "Kollektor 1 Typ", "Type collector 1", "Kollektor 1 Typ", "typ kolektora 1", "kollektor 1 type", "type collecteur 1")
|
||||
MAKE_PSTR_LIST(collector2Area, "collector2area", "collector 2 area", "Kollektor 2 Fläche", "Oppervlakte collector 2", "Kollektor 2 Area", "powierzchnia kolektora 2", "kollektor 2 område", "zone collecteur 2")
|
||||
MAKE_PSTR_LIST(collector2Type, "collector2type", "collector 2 type", "Kollektor 2 Typ", "Type collector 2", "Kollektor 2 Typ", "typ kolektora 2", "kollektor 2 type", "type collecteur 2")
|
||||
|
||||
// telegram 0x0363 heatCounter
|
||||
MAKE_PSTR_LIST(heatCntFlowTemp, "heatcntflowtemp", "heat counter flow temperature", "Wärmezähler Vorlauf-Temperatur", "Aanvoertemperatuur warmteenergiemeter", "Värmeräknare Flödestemperatur", "temperatura zasilania ciepłomierza", "varmeenergimåler turtemperatur", "température flux compteur chaleur")
|
||||
MAKE_PSTR_LIST(heatCntRetTemp, "heatcntrettemp", "heat counter return temperature", "Wärmezähler Rücklauf-Temperatur", "Retourtemperatuur warmteenergiemeter", "Värmeräknare Returtemperatur", "temperatura powrotu ciepłomierza", "varmeenergimåler returtemperatur", "température retour compteur chaleur")
|
||||
MAKE_PSTR_LIST(heatCnt, "heatcnt", "heat counter impulses", "Wärmezähler Impulse", "Warmteenergiemeter pulsen", "Värmeräknare Impuls", "liczba impulsów ciepłomierza", "varmemåler impuls", "impulsions compteur chaleur")
|
||||
MAKE_PSTR_LIST(swapFlowTemp, "swapflowtemp", "swap flow temperature (TS14)", "Austausch Vorlauf-Temperatur (TS14)", "Aanvoertemperatuur verwisselaar (TS14)", "Växlingstemperatur Flöde (TS14)", "temperatura zasilania wymiennika", "veksler turledningstemperatur (TS14)", "température flux échangeur (TS14)")
|
||||
MAKE_PSTR_LIST(swapRetTemp, "swaprettemp", "swap return temperature (TS15)", "Austausch Rücklauf-Temperatur (TS15)", "Retourtemperatuur verwisselaar (TS15)", "Växlingstemperatur Returflöde (TS15)", "temperatura powrotu wymiennika", "veksler returledningstemperatur (TS15)", "température retour échangeur (TS15)")
|
||||
|
||||
// switch
|
||||
MAKE_PSTR_LIST(activated, "activated", "activated", "Aktiviert", "Geactiveerd", "Aktiverad", "aktywowany", "aktivert", "activé")
|
||||
MAKE_PSTR_LIST(status, "status", "status", "Status", "Status", "Status", "status", "status", "statut")
|
||||
|
||||
// RF sensor, id 0x40, telegram 0x435
|
||||
MAKE_PSTR_LIST(RFTemp, "rftemp", "RF room temperature sensor", "RF Raumtemperatur Sensor", "RF ruimtetemperatuur sensor", "RF Rumsgivare Temp", "bezprzewodowy czujnik temperatury pomieszczenia", "RF romsgiver temp", "capteur de température de pièce RF")
|
||||
|
||||
/*
|
||||
// unknown fields to track (SM10), only for testing
|
||||
// **** NO TRANSLATION NEEDED ****
|
||||
MAKE_PSTR_LIST(data11, "data11", "unknown datafield 11")
|
||||
MAKE_PSTR_LIST(data12, "data12", "unknown datafield 12")
|
||||
MAKE_PSTR_LIST(data8, "data8", "unknown datafield 8")
|
||||
MAKE_PSTR_LIST(data0, "data0", "unknown datafield 0")
|
||||
MAKE_PSTR_LIST(data1, "data1", "unknown datafield 1")
|
||||
MAKE_PSTR_LIST(setting3, "setting3", "unknown setting 3")
|
||||
MAKE_PSTR_LIST(setting4, "setting4", "unknown setting 4")
|
||||
*/
|
||||
|
||||
// clang-format on
|
||||
615
src/mqtt.cpp
615
src/mqtt.cpp
File diff suppressed because it is too large
Load Diff
75
src/mqtt.h
75
src/mqtt.h
@@ -65,6 +65,7 @@ class Mqtt {
|
||||
void set_publish_time_mixer(uint16_t publish_time);
|
||||
void set_publish_time_other(uint16_t publish_time);
|
||||
void set_publish_time_sensor(uint16_t publish_time);
|
||||
void set_publish_time_heartbeat(uint16_t publish_time);
|
||||
bool get_publish_onchange(uint8_t device_type);
|
||||
|
||||
enum Operation : uint8_t { PUBLISH, SUBSCRIBE, UNSUBSCRIBE };
|
||||
@@ -79,35 +80,36 @@ class Mqtt {
|
||||
static void resubscribe();
|
||||
|
||||
static void publish(const std::string & topic, const std::string & payload);
|
||||
static void publish(const __FlashStringHelper * topic, const char * payload);
|
||||
static void publish(const char * topic, const char * payload);
|
||||
static void publish(const std::string & topic, const JsonObject & payload);
|
||||
static void publish(const __FlashStringHelper * topic, const JsonObject & payload);
|
||||
static void publish(const __FlashStringHelper * topic, const std::string & payload);
|
||||
static void publish(const char * topic, const JsonObject & payload);
|
||||
static void publish(const char * topic, const std::string & payload);
|
||||
static void publish_retain(const std::string & topic, const JsonObject & payload, bool retain);
|
||||
static void publish_retain(const __FlashStringHelper * topic, const std::string & payload, bool retain);
|
||||
static void publish_retain(const __FlashStringHelper * topic, const JsonObject & payload, bool retain);
|
||||
static void publish_ha(const std::string & topic, const JsonObject & payload);
|
||||
static void publish_ha(const __FlashStringHelper * topic, const JsonObject & payload);
|
||||
static void publish_ha(const std::string & topic);
|
||||
static void publish_retain(const char * topic, const std::string & payload, bool retain);
|
||||
static void publish_retain(const char * topic, const JsonObject & payload, bool retain);
|
||||
static void publish_ha(const char * topic, const JsonObject & payload);
|
||||
static void publish_ha(const char * topic);
|
||||
|
||||
static void
|
||||
publish_ha_sensor_config(DeviceValue & dv, const std::string & model, const std::string & brand, const bool remove, const bool create_device_config = false);
|
||||
static void publish_ha_sensor_config(uint8_t type,
|
||||
uint8_t tag,
|
||||
const __FlashStringHelper * name,
|
||||
const uint8_t device_type,
|
||||
const __FlashStringHelper * entity,
|
||||
const uint8_t uom,
|
||||
const bool remove,
|
||||
const bool has_cmd,
|
||||
const __FlashStringHelper * const * options,
|
||||
uint8_t options_size,
|
||||
const int16_t dv_set_min,
|
||||
const int16_t dv_set_max,
|
||||
const JsonObject & dev_json);
|
||||
static void publish_ha_sensor_config(uint8_t type,
|
||||
uint8_t tag,
|
||||
const char * const fullname,
|
||||
const char * const en_name,
|
||||
const uint8_t device_type,
|
||||
const char * const entity,
|
||||
const uint8_t uom,
|
||||
const bool remove,
|
||||
const bool has_cmd,
|
||||
const char * const ** options,
|
||||
uint8_t options_size,
|
||||
const int16_t dv_set_min,
|
||||
const int16_t dv_set_max,
|
||||
const int8_t num_op,
|
||||
const JsonObject & dev_json);
|
||||
|
||||
static void publish_system_ha_sensor_config(uint8_t type, const __FlashStringHelper * name, const __FlashStringHelper * entity, const uint8_t uom);
|
||||
static void publish_ha_climate_config(uint8_t tag, bool has_roomtemp, bool remove = false);
|
||||
static void publish_system_ha_sensor_config(uint8_t type, const char * name, const char * entity, const uint8_t uom);
|
||||
static void publish_ha_climate_config(const uint8_t tag, const bool has_roomtemp, const bool remove = false, const int16_t min = 5, const uint16_t max = 30);
|
||||
|
||||
static void show_topic_handlers(uuid::console::Shell & shell, const uint8_t device_type);
|
||||
static void show_mqtt(uuid::console::Shell & shell);
|
||||
@@ -142,6 +144,10 @@ class Mqtt {
|
||||
return mqtt_base_;
|
||||
}
|
||||
|
||||
static std::string basename() {
|
||||
return mqtt_basename_;
|
||||
}
|
||||
|
||||
// returns the discovery MQTT topic prefix and adds a /
|
||||
static std::string discovery_prefix() {
|
||||
if (discovery_prefix_.empty()) {
|
||||
@@ -162,18 +168,30 @@ class Mqtt {
|
||||
return mqtt_publish_fails_;
|
||||
}
|
||||
|
||||
static uint32_t publish_queued() {
|
||||
return mqtt_messages_.size();
|
||||
}
|
||||
|
||||
static uint8_t connect_count() {
|
||||
return connectcount_;
|
||||
}
|
||||
|
||||
static void reset_mqtt();
|
||||
|
||||
static bool is_nested() {
|
||||
return nested_format_ == NestedFormat::NESTED;
|
||||
}
|
||||
|
||||
static uint8_t entity_format() {
|
||||
return entity_format_;
|
||||
}
|
||||
|
||||
static void nested_format(uint8_t nested_format) {
|
||||
nested_format_ = nested_format;
|
||||
}
|
||||
|
||||
static bool publish_single() {
|
||||
return publish_single_;
|
||||
return mqtt_enabled_ && publish_single_;
|
||||
}
|
||||
|
||||
static bool publish_single2cmd() {
|
||||
@@ -185,7 +203,7 @@ class Mqtt {
|
||||
}
|
||||
|
||||
static bool ha_enabled() {
|
||||
return ha_enabled_;
|
||||
return mqtt_enabled_ && ha_enabled_;
|
||||
}
|
||||
|
||||
static void ha_enabled(bool ha_enabled) {
|
||||
@@ -277,6 +295,7 @@ class Mqtt {
|
||||
uint32_t last_publish_mixer_ = 0;
|
||||
uint32_t last_publish_other_ = 0;
|
||||
uint32_t last_publish_sensor_ = 0;
|
||||
uint32_t last_publish_heartbeat_ = 0;
|
||||
uint32_t last_publish_queue_ = 0;
|
||||
|
||||
static bool connecting_;
|
||||
@@ -285,8 +304,12 @@ class Mqtt {
|
||||
static uint8_t connectcount_;
|
||||
static bool ha_climate_reset_;
|
||||
|
||||
static std::string lasttopic_;
|
||||
static std::string lastpayload_;
|
||||
|
||||
// settings, copied over
|
||||
static std::string mqtt_base_;
|
||||
static std::string mqtt_basename_;
|
||||
static uint8_t mqtt_qos_;
|
||||
static bool mqtt_retain_;
|
||||
static uint32_t publish_time_;
|
||||
@@ -296,9 +319,11 @@ class Mqtt {
|
||||
static uint32_t publish_time_mixer_;
|
||||
static uint32_t publish_time_other_;
|
||||
static uint32_t publish_time_sensor_;
|
||||
static uint32_t publish_time_heartbeat_;
|
||||
static bool mqtt_enabled_;
|
||||
static bool ha_enabled_;
|
||||
static uint8_t nested_format_;
|
||||
static uint8_t entity_format_;
|
||||
static std::string discovery_prefix_;
|
||||
static bool publish_single_;
|
||||
static bool publish_single2cmd_;
|
||||
|
||||
@@ -57,7 +57,7 @@ void Shower::loop() {
|
||||
// first check to see if hot water has been on long enough to be recognized as a Shower/Bath
|
||||
if (!shower_state_ && (time_now - timer_start_) > SHOWER_MIN_DURATION) {
|
||||
set_shower_state(true);
|
||||
LOG_DEBUG(F("[Shower] hot water still running, starting shower timer"));
|
||||
LOG_DEBUG("[Shower] hot water still running, starting shower timer");
|
||||
}
|
||||
// check if the shower has been on too long
|
||||
else if ((time_now - timer_start_) > shower_alert_trigger_) {
|
||||
@@ -82,8 +82,8 @@ void Shower::loop() {
|
||||
char s[50];
|
||||
snprintf(s, 50, "%d minutes and %d seconds", (uint8_t)(duration_ / 60000), (uint8_t)((duration_ / 1000) % 60));
|
||||
doc["duration"] = s;
|
||||
Mqtt::publish(F("shower_data"), doc.as<JsonObject>());
|
||||
LOG_DEBUG(F("[Shower] finished with duration %d"), duration_);
|
||||
Mqtt::publish("shower_data", doc.as<JsonObject>());
|
||||
LOG_DEBUG("[Shower] finished with duration %d", duration_);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -109,7 +109,7 @@ void Shower::loop() {
|
||||
// turn back on the hot water for the shower
|
||||
void Shower::shower_alert_stop() {
|
||||
if (doing_cold_shot_) {
|
||||
LOG_DEBUG(F("Shower Alert stopped"));
|
||||
LOG_DEBUG("Shower Alert stopped");
|
||||
(void)Command::call(EMSdevice::DeviceType::BOILER, "wwtapactivated", "true");
|
||||
doing_cold_shot_ = false;
|
||||
}
|
||||
@@ -117,7 +117,7 @@ void Shower::shower_alert_stop() {
|
||||
// turn off hot water to send a shot of cold
|
||||
void Shower::shower_alert_start() {
|
||||
if (shower_alert_) {
|
||||
LOG_DEBUG(F("Shower Alert started"));
|
||||
LOG_DEBUG("Shower Alert started");
|
||||
(void)Command::call(EMSdevice::DeviceType::BOILER, "wwtapactivated", "false");
|
||||
doing_cold_shot_ = true;
|
||||
alert_timer_start_ = uuid::get_uptime(); // timer starts now
|
||||
@@ -143,30 +143,48 @@ void Shower::set_shower_state(bool state, bool force) {
|
||||
old_shower_state_ = shower_state_; // copy current state
|
||||
|
||||
// always publish as a string
|
||||
char s[7];
|
||||
Mqtt::publish(F("shower_active"), Helpers::render_boolean(s, shower_state_)); // https://github.com/emsesp/EMS-ESP/issues/369
|
||||
char s[12];
|
||||
Mqtt::publish("shower_active", Helpers::render_boolean(s, shower_state_)); // https://github.com/emsesp/EMS-ESP/issues/369
|
||||
|
||||
// send out HA MQTT Discovery config topic
|
||||
if ((Mqtt::ha_enabled()) && (!ha_configdone_ || force)) {
|
||||
ha_configdone_ = true;
|
||||
|
||||
StaticJsonDocument<EMSESP_JSON_SIZE_HA_CONFIG> doc;
|
||||
doc["name"] = FJSON("Shower Active");
|
||||
doc["uniq_id"] = FJSON("shower_active");
|
||||
doc["~"] = Mqtt::base();
|
||||
doc["stat_t"] = FJSON("~/shower_active");
|
||||
|
||||
// always render boolean as strings for HA
|
||||
char result[10];
|
||||
doc[F("payload_on")] = Helpers::render_boolean(result, true);
|
||||
doc[F("payload_off")] = Helpers::render_boolean(result, false);
|
||||
doc["name"] = "Shower Active";
|
||||
|
||||
char str[70];
|
||||
if (Mqtt::entity_format() == 2) {
|
||||
snprintf(str, sizeof(str), "%s_shower_active", Mqtt::basename().c_str());
|
||||
} else {
|
||||
snprintf(str, sizeof(str), "shower_active"); // v3.4 compatible
|
||||
}
|
||||
doc["uniq_id"] = str;
|
||||
doc["object_id"] = str;
|
||||
|
||||
char stat_t[50];
|
||||
snprintf(stat_t, sizeof(stat_t), "%s/shower_active", Mqtt::base().c_str()); // use base path
|
||||
doc["stat_t"] = stat_t;
|
||||
|
||||
if (EMSESP::system_.bool_format() == BOOL_FORMAT_TRUEFALSE) {
|
||||
doc["pl_on"] = true;
|
||||
doc["pl_off"] = false;
|
||||
} else if (EMSESP::system_.bool_format() == BOOL_FORMAT_10) {
|
||||
doc["pl_on"] = 1;
|
||||
doc["pl_off"] = 0;
|
||||
} else {
|
||||
char result[12];
|
||||
doc["pl_on"] = Helpers::render_boolean(result, true);
|
||||
doc["pl_off"] = Helpers::render_boolean(result, false);
|
||||
}
|
||||
|
||||
JsonObject dev = doc.createNestedObject("dev");
|
||||
JsonArray ids = dev.createNestedArray("ids");
|
||||
ids.add("ems-esp");
|
||||
|
||||
char topic[Mqtt::MQTT_TOPIC_MAX_SIZE];
|
||||
snprintf(topic, sizeof(topic), "binary_sensor/%s/shower_active/config", Mqtt::base().c_str());
|
||||
snprintf(topic, sizeof(topic), "binary_sensor/%s/shower_active/config", Mqtt::basename().c_str());
|
||||
Mqtt::publish_ha(topic, doc.as<JsonObject>()); // publish the config payload with retain flag
|
||||
}
|
||||
}
|
||||
|
||||
724
src/system.cpp
724
src/system.cpp
File diff suppressed because it is too large
Load Diff
52
src/system.h
52
src/system.h
@@ -29,7 +29,9 @@
|
||||
|
||||
#ifndef EMSESP_STANDALONE
|
||||
#include <esp_wifi.h>
|
||||
#include <esp_bt.h>
|
||||
#if CONFIG_IDF_TARGET_ESP32
|
||||
// #include <esp_bt.h>
|
||||
#endif
|
||||
#include <ETH.h>
|
||||
#include <uuid/syslog.h>
|
||||
#endif
|
||||
@@ -49,7 +51,6 @@ class System {
|
||||
void loop();
|
||||
|
||||
// commands
|
||||
static bool command_pin(const char * value, const int8_t id);
|
||||
static bool command_send(const char * value, const int8_t id);
|
||||
static bool command_publish(const char * value, const int8_t id);
|
||||
static bool command_fetch(const char * value, const int8_t id);
|
||||
@@ -73,9 +74,11 @@ class System {
|
||||
void reload_settings();
|
||||
void wifi_tweak();
|
||||
void syslog_init();
|
||||
bool check_upgrade();
|
||||
bool check_upgrade(bool factory_settings);
|
||||
bool check_restore();
|
||||
bool heartbeat_json(JsonObject & output);
|
||||
void send_heartbeat();
|
||||
void send_info_mqtt(const char * event_str, bool send_ntp = false);
|
||||
|
||||
bool syslog_enabled() {
|
||||
return syslog_enabled_;
|
||||
@@ -178,14 +181,7 @@ class System {
|
||||
}
|
||||
|
||||
void ntp_connected(bool b);
|
||||
|
||||
bool ntp_connected() {
|
||||
// timeout 2 hours, ntp sync is normally every hour.
|
||||
if ((uuid::get_uptime_sec() - ntp_last_check_ > 7201) && ntp_connected_) {
|
||||
ntp_connected(false);
|
||||
}
|
||||
return ntp_connected_;
|
||||
}
|
||||
bool ntp_connected();
|
||||
|
||||
bool network_connected() {
|
||||
#ifndef EMSESP_STANDALONE
|
||||
@@ -203,6 +199,16 @@ class System {
|
||||
return fahrenheit_;
|
||||
}
|
||||
|
||||
uint8_t language_index();
|
||||
|
||||
void locale(String locale) {
|
||||
locale_ = locale;
|
||||
}
|
||||
|
||||
std::string locale() {
|
||||
return std::string(locale_.c_str());
|
||||
}
|
||||
|
||||
void healthcheck(uint8_t healthcheck) {
|
||||
healthcheck_ = healthcheck;
|
||||
}
|
||||
@@ -211,6 +217,19 @@ class System {
|
||||
void wifi_reconnect();
|
||||
void show_users(uuid::console::Shell & shell);
|
||||
|
||||
uint32_t FStotal() {
|
||||
return fstotal_;
|
||||
}
|
||||
uint32_t PSram() {
|
||||
return psram_;
|
||||
}
|
||||
uint32_t appFree() {
|
||||
return appfree_;
|
||||
}
|
||||
uint32_t appUsed() {
|
||||
return appused_;
|
||||
}
|
||||
|
||||
private:
|
||||
static uuid::log::Logger logger_;
|
||||
static bool restart_requested_;
|
||||
@@ -232,7 +251,6 @@ class System {
|
||||
static constexpr uint32_t HEALTHCHECK_LED_FLASH_DUARATION = 150;
|
||||
static constexpr uint8_t HEALTHCHECK_NO_BUS = (1 << 0); // 1
|
||||
static constexpr uint8_t HEALTHCHECK_NO_NETWORK = (1 << 1); // 2
|
||||
static constexpr uint32_t SYSTEM_HEARTBEAT_INTERVAL = 60000; // in milliseconds, how often the MQTT heartbeat is sent (1 min)
|
||||
static constexpr uint8_t LED_ON = HIGH; // LED on
|
||||
|
||||
#ifndef EMSESP_STANDALONE
|
||||
@@ -245,7 +263,6 @@ class System {
|
||||
int8_t wifi_quality(int8_t dBm);
|
||||
|
||||
uint8_t healthcheck_ = HEALTHCHECK_NO_NETWORK | HEALTHCHECK_NO_BUS; // start with all flags set, no wifi and no ems bus connection
|
||||
uint32_t last_heartbeat_ = 0;
|
||||
uint32_t last_system_check_ = 0;
|
||||
|
||||
bool upload_status_ = false; // true if we're in the middle of a OTA firmware upload
|
||||
@@ -256,7 +273,8 @@ class System {
|
||||
|
||||
// EMS-ESP settings
|
||||
// copies from WebSettings class in WebSettingsService.h and loaded with reload_settings()
|
||||
std::string hostname_ = FACTORY_WIFI_HOSTNAME;
|
||||
std::string hostname_;
|
||||
String locale_;
|
||||
bool hide_led_;
|
||||
uint8_t led_gpio_;
|
||||
bool analog_enabled_;
|
||||
@@ -277,12 +295,18 @@ class System {
|
||||
uint8_t bool_format_;
|
||||
uint8_t enum_format_;
|
||||
bool readonly_mode_;
|
||||
String version_;
|
||||
|
||||
// ethernet
|
||||
uint8_t phy_type_;
|
||||
int8_t eth_power_;
|
||||
uint8_t eth_phy_addr_;
|
||||
uint8_t eth_clock_mode_;
|
||||
|
||||
uint32_t fstotal_;
|
||||
uint32_t psram_;
|
||||
uint32_t appused_;
|
||||
uint32_t appfree_;
|
||||
};
|
||||
|
||||
} // namespace emsesp
|
||||
|
||||
127
src/telegram.cpp
127
src/telegram.cpp
@@ -120,7 +120,7 @@ std::string Telegram::to_string() const {
|
||||
// returns telegram's message body only, in hex
|
||||
std::string Telegram::to_string_message() const {
|
||||
if (this->message_length == 0) {
|
||||
return read_flash_string(F("<empty>"));
|
||||
return "<empty>";
|
||||
}
|
||||
|
||||
return Helpers::data_to_hex(this->message_data, this->message_length);
|
||||
@@ -141,7 +141,7 @@ void RxService::loop() {
|
||||
// length includes the CRC
|
||||
// for EMS+ the type_id has the value + 256. We look for these type of telegrams with F7, F9 and FF in 3rd byte
|
||||
void RxService::add(uint8_t * data, uint8_t length) {
|
||||
if (length < 2) {
|
||||
if (length < 5) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -150,9 +150,9 @@ void RxService::add(uint8_t * data, uint8_t length) {
|
||||
if (data[length - 1] != crc) {
|
||||
if ((data[0] & 0x7F) != ems_bus_id()) { // do not count echos as errors
|
||||
telegram_error_count_++;
|
||||
LOG_WARNING(F("Incomplete Rx: %s"), Helpers::data_to_hex(data, length - 1).c_str()); // exclude CRC
|
||||
LOG_WARNING("Incomplete Rx: %s", Helpers::data_to_hex(data, length - 1).c_str()); // exclude CRC
|
||||
} else {
|
||||
LOG_TRACE(F("Incomplete Rx: %s"), Helpers::data_to_hex(data, length - 1).c_str()); // exclude CRC
|
||||
LOG_TRACE("Incomplete Rx: %s", Helpers::data_to_hex(data, length - 1).c_str()); // exclude CRC
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -203,16 +203,16 @@ void RxService::add(uint8_t * data, uint8_t length) {
|
||||
uint16_t trace_watch_id = EMSESP::watch_id();
|
||||
if ((trace_watch_id == WATCH_ID_NONE) || (type_id == trace_watch_id)
|
||||
|| ((trace_watch_id < 0x80) && ((src == trace_watch_id) || (dest == trace_watch_id)))) {
|
||||
LOG_NOTICE(F("Rx: %s"), Helpers::data_to_hex(data, length).c_str());
|
||||
LOG_NOTICE("Rx: %s", Helpers::data_to_hex(data, length).c_str());
|
||||
} else if (EMSESP::trace_raw()) {
|
||||
LOG_TRACE(F("Rx: %s"), Helpers::data_to_hex(data, length).c_str());
|
||||
LOG_TRACE("Rx: %s", Helpers::data_to_hex(data, length).c_str());
|
||||
}
|
||||
} else if (EMSESP::trace_raw()) {
|
||||
LOG_TRACE(F("Rx: %s"), Helpers::data_to_hex(data, length).c_str());
|
||||
LOG_TRACE("Rx: %s", Helpers::data_to_hex(data, length).c_str());
|
||||
}
|
||||
|
||||
#ifdef EMSESP_DEBUG
|
||||
LOG_DEBUG(F("[DEBUG] New Rx telegram, message length %d"), message_length);
|
||||
LOG_DEBUG("[DEBUG] New Rx telegram, message length %d", message_length);
|
||||
#endif
|
||||
|
||||
// if we don't have a type_id exit,
|
||||
@@ -262,14 +262,29 @@ void TxService::start() {
|
||||
|
||||
// sends a 1 byte poll which is our own deviceID
|
||||
void TxService::send_poll() const {
|
||||
//LOG_DEBUG(F("Ack %02X"),ems_bus_id() ^ ems_mask());
|
||||
//LOG_DEBUG("Ack %02X",ems_bus_id() ^ ems_mask());
|
||||
if (tx_mode()) {
|
||||
EMSuart::send_poll(ems_bus_id() ^ ems_mask());
|
||||
}
|
||||
}
|
||||
|
||||
// get src id from next telegram to check poll in emsesp::incoming_telegram
|
||||
uint8_t TxService::get_send_id() {
|
||||
static uint32_t count = 0;
|
||||
if (!tx_telegrams_.empty() && tx_telegrams_.front().telegram_->src != ems_bus_id()) {
|
||||
if (++count > 500) { // after 500 polls (~3-10 sec) there will be no master poll for this id
|
||||
tx_telegrams_.pop_front();
|
||||
count = 0;
|
||||
return tx_telegrams_.empty() ? ems_bus_id() : tx_telegrams_.front().telegram_->src;
|
||||
}
|
||||
return tx_telegrams_.front().telegram_->src;
|
||||
}
|
||||
count = 0;
|
||||
return ems_bus_id();
|
||||
}
|
||||
|
||||
// Process the next telegram on the Tx queue
|
||||
// This is sent when we receieve a poll request
|
||||
// This is sent when we receive a poll request
|
||||
void TxService::send() {
|
||||
// don't process if we don't have a connection to the EMS bus
|
||||
if (!bus_connected()) {
|
||||
@@ -363,13 +378,13 @@ void TxService::send_telegram(const QueuedTxTelegram & tx_telegram) {
|
||||
|
||||
// if we're in simulation mode, don't send anything, just quit
|
||||
if (EMSESP::system_.readonly_mode() && (telegram->operation == Telegram::Operation::TX_WRITE)) {
|
||||
LOG_INFO(F("[readonly] Sending write Tx telegram: %s"), Helpers::data_to_hex(telegram_raw, length - 1).c_str());
|
||||
LOG_INFO("[readonly] Sending write Tx telegram: %s", Helpers::data_to_hex(telegram_raw, length - 1).c_str());
|
||||
tx_state(Telegram::Operation::NONE);
|
||||
return;
|
||||
}
|
||||
|
||||
LOG_DEBUG(F("Sending %s Tx [#%d], telegram: %s"),
|
||||
(telegram->operation == Telegram::Operation::TX_WRITE) ? F("write") : F("read"),
|
||||
LOG_DEBUG("Sending %s Tx [#%d], telegram: %s",
|
||||
(telegram->operation == Telegram::Operation::TX_WRITE) ? ("write") : ("read"),
|
||||
tx_telegram.id_,
|
||||
Helpers::data_to_hex(telegram_raw, length - 1).c_str()); // exclude the last CRC byte
|
||||
|
||||
@@ -381,7 +396,7 @@ void TxService::send_telegram(const QueuedTxTelegram & tx_telegram) {
|
||||
uint16_t status = EMSuart::transmit(telegram_raw, length);
|
||||
|
||||
if (status == EMS_TX_STATUS_ERR) {
|
||||
LOG_ERROR(F("Failed to transmit Tx via UART."));
|
||||
LOG_ERROR("Failed to transmit Tx via UART.");
|
||||
if (telegram->operation == Telegram::Operation::TX_READ) {
|
||||
increment_telegram_read_fail_count(); // another Tx fail
|
||||
} else {
|
||||
@@ -412,7 +427,7 @@ void TxService::send_telegram(const uint8_t * data, const uint8_t length) {
|
||||
uint16_t status = EMSuart::transmit(telegram_raw, length);
|
||||
|
||||
if (status == EMS_TX_STATUS_ERR) {
|
||||
LOG_ERROR(F("Failed to transmit Tx via UART."));
|
||||
LOG_ERROR("Failed to transmit Tx via UART.");
|
||||
increment_telegram_fail_count(); // another Tx fail
|
||||
}
|
||||
}
|
||||
@@ -429,11 +444,16 @@ void TxService::add(const uint8_t operation,
|
||||
auto telegram = std::make_shared<Telegram>(operation, ems_bus_id(), dest, type_id, offset, message_data, message_length);
|
||||
|
||||
#ifdef EMSESP_DEBUG
|
||||
LOG_DEBUG(F("[DEBUG] New Tx [#%d] telegram, length %d"), tx_telegram_id_, message_length);
|
||||
LOG_DEBUG("[DEBUG] New Tx [#%d] telegram, length %d", tx_telegram_id_, message_length);
|
||||
#endif
|
||||
|
||||
// if the queue is full, make room but removing the last one
|
||||
// if the queue is full, make room by removing the last one
|
||||
if (tx_telegrams_.size() >= MAX_TX_TELEGRAMS) {
|
||||
if (tx_telegrams_.front().telegram_->operation == Telegram::Operation::TX_WRITE) {
|
||||
telegram_write_fail_count_++;
|
||||
} else {
|
||||
telegram_read_fail_count_++;
|
||||
}
|
||||
tx_telegrams_.pop_front();
|
||||
}
|
||||
|
||||
@@ -458,7 +478,7 @@ void TxService::add(uint8_t operation, const uint8_t * data, const uint8_t lengt
|
||||
}
|
||||
|
||||
// build header. src, dest and offset have fixed positions
|
||||
uint8_t src = ems_bus_id(); // data[0]; we can only send data with own bus_id.
|
||||
uint8_t src = operation == Telegram::Operation::TX_RAW ? data[0] : ems_bus_id();
|
||||
uint8_t dest = data[1];
|
||||
uint8_t offset = data[3];
|
||||
|
||||
@@ -488,13 +508,15 @@ void TxService::add(uint8_t operation, const uint8_t * data, const uint8_t lengt
|
||||
// if we don't have a type_id or empty data block, exit
|
||||
if ((type_id == 0) || (message_length == 0)) {
|
||||
#ifdef EMSESP_DEBUG
|
||||
LOG_DEBUG(F("[DEBUG] Tx telegram type %d failed, length %d"), type_id, message_length);
|
||||
LOG_DEBUG("[DEBUG] Tx telegram type %d failed, length %d", type_id, message_length);
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
|
||||
if (operation == Telegram::Operation::TX_RAW) {
|
||||
if (dest & 0x80) {
|
||||
if (src != ems_bus_id()) {
|
||||
operation = Telegram::Operation::NONE; // do not check reply/ack for other ids
|
||||
} else if (dest & 0x80) {
|
||||
operation = Telegram::Operation::TX_READ;
|
||||
} else {
|
||||
operation = Telegram::Operation::TX_WRITE;
|
||||
@@ -505,13 +527,18 @@ void TxService::add(uint8_t operation, const uint8_t * data, const uint8_t lengt
|
||||
|
||||
auto telegram = std::make_shared<Telegram>(operation, src, dest, type_id, offset, message_data, message_length); // operation is TX_WRITE or TX_READ
|
||||
|
||||
// if the queue is full, make room but removing the last one
|
||||
// if the queue is full, make room by removing the last one
|
||||
if (tx_telegrams_.size() >= MAX_TX_TELEGRAMS) {
|
||||
if (tx_telegrams_.front().telegram_->operation == Telegram::Operation::TX_WRITE) {
|
||||
telegram_write_fail_count_++;
|
||||
} else {
|
||||
telegram_read_fail_count_++;
|
||||
}
|
||||
tx_telegrams_.pop_front();
|
||||
}
|
||||
|
||||
#ifdef EMSESP_DEBUG
|
||||
LOG_DEBUG(F("[DEBUG] New Tx [#%d] telegram, length %d"), tx_telegram_id_, message_length);
|
||||
LOG_DEBUG("[DEBUG] New Tx [#%d] telegram, length %d", tx_telegram_id_, message_length);
|
||||
#endif
|
||||
|
||||
if (front) {
|
||||
@@ -528,7 +555,7 @@ void TxService::add(uint8_t operation, const uint8_t * data, const uint8_t lengt
|
||||
|
||||
// send a Tx telegram to request data from an EMS device
|
||||
void TxService::read_request(const uint16_t type_id, const uint8_t dest, const uint8_t offset, const uint8_t length) {
|
||||
LOG_DEBUG(F("Tx read request to device 0x%02X for type ID 0x%02X"), dest, type_id);
|
||||
LOG_DEBUG("Tx read request to device 0x%02X for type ID 0x%02X", dest, type_id);
|
||||
|
||||
uint8_t message_data = (type_id > 0xFF) ? (EMS_MAX_TELEGRAM_MESSAGE_LENGTH - 2) : EMS_MAX_TELEGRAM_MESSAGE_LENGTH;
|
||||
// if length set, publish result and set telegram to front
|
||||
@@ -540,9 +567,9 @@ void TxService::read_request(const uint16_t type_id, const uint8_t dest, const u
|
||||
}
|
||||
|
||||
// Send a raw telegram to the bus, telegram is a text string of hex values
|
||||
void TxService::send_raw(const char * telegram_data) {
|
||||
bool TxService::send_raw(const char * telegram_data) {
|
||||
if (telegram_data == nullptr) {
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
|
||||
// since the telegram data is a const, make a copy. add 1 to grab the \0 EOS
|
||||
@@ -562,6 +589,8 @@ void TxService::send_raw(const char * telegram_data) {
|
||||
if ((p = strtok(telegram, " ,"))) { // delimiter
|
||||
strlcpy(value, p, sizeof(value));
|
||||
data[0] = (uint8_t)strtol(value, 0, 16);
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
|
||||
// and iterate until end
|
||||
@@ -573,11 +602,13 @@ void TxService::send_raw(const char * telegram_data) {
|
||||
}
|
||||
}
|
||||
|
||||
if (count == 0) {
|
||||
return; // nothing to send
|
||||
// check valid length
|
||||
if (count < 4) {
|
||||
return false;
|
||||
}
|
||||
|
||||
add(Telegram::Operation::TX_RAW, data, count + 1, 0, true); // add to top/front of Tx queue
|
||||
return true;
|
||||
}
|
||||
|
||||
// add last Tx to tx queue and increment count
|
||||
@@ -589,17 +620,19 @@ void TxService::retry_tx(const uint8_t operation, const uint8_t * data, const ui
|
||||
EMSESP::wait_validate(0); // do not wait for validation
|
||||
if (operation == Telegram::Operation::TX_READ) {
|
||||
if (telegram_last_->offset > 0) { // ignore errors for higher offsets
|
||||
LOG_DEBUG(F("Last Tx Read operation failed after %d retries. Ignoring request: %s"), MAXIMUM_TX_RETRIES, telegram_last_->to_string().c_str());
|
||||
LOG_DEBUG("Last Tx Read operation failed after %d retries. Ignoring request: %s", MAXIMUM_TX_RETRIES, telegram_last_->to_string().c_str());
|
||||
return;
|
||||
}
|
||||
increment_telegram_read_fail_count(); // another Tx fail
|
||||
} else {
|
||||
increment_telegram_write_fail_count(); // another Tx fail
|
||||
}
|
||||
LOG_ERROR(F("Last Tx %s operation failed after %d retries. Ignoring request: %s"),
|
||||
(operation == Telegram::Operation::TX_WRITE) ? F("Write") : F("Read"),
|
||||
|
||||
LOG_ERROR("Last Tx %s operation failed after %d retries. Ignoring request: %s",
|
||||
(operation == Telegram::Operation::TX_WRITE) ? "Write" : "Read",
|
||||
MAXIMUM_TX_RETRIES,
|
||||
telegram_last_->to_string().c_str());
|
||||
|
||||
if (operation == Telegram::Operation::TX_READ) {
|
||||
EMSESP::rxservice_.add_empty(telegram_last_->dest, telegram_last_->src, telegram_last_->type_id, telegram_last_->offset);
|
||||
}
|
||||
@@ -607,8 +640,8 @@ void TxService::retry_tx(const uint8_t operation, const uint8_t * data, const ui
|
||||
}
|
||||
|
||||
#ifdef EMSESP_DEBUG
|
||||
LOG_DEBUG(F("[DEBUG] Last Tx %s operation failed. Retry #%d. sent message: %s, received: %s"),
|
||||
(operation == Telegram::Operation::TX_WRITE) ? F("Write") : F("Read"),
|
||||
LOG_DEBUG("[DEBUG] Last Tx %s operation failed. Retry #%d. sent message: %s, received: %s",
|
||||
(operation == Telegram::Operation::TX_WRITE) ? ("Write") : ("Read"),
|
||||
retry_count_,
|
||||
telegram_last_->to_string().c_str(),
|
||||
Helpers::data_to_hex(data, length - 1).c_str());
|
||||
@@ -623,24 +656,18 @@ void TxService::retry_tx(const uint8_t operation, const uint8_t * data, const ui
|
||||
}
|
||||
|
||||
// send a request to read the next block of data from longer telegrams
|
||||
uint16_t TxService::read_next_tx(uint8_t offset) {
|
||||
// add to the top/front of the queue
|
||||
uint8_t message_data[1] = {EMS_MAX_TELEGRAM_LENGTH}; // request all data, 32 bytes
|
||||
if (telegram_last_->offset != offset) {
|
||||
return 0;
|
||||
uint16_t TxService::read_next_tx(const uint8_t offset, const uint8_t length) {
|
||||
uint8_t old_length = telegram_last_->type_id > 0xFF ? length - 7 : length - 5;
|
||||
uint8_t next_length = telegram_last_->type_id > 0xFF ? EMS_MAX_TELEGRAM_MESSAGE_LENGTH - 2 : EMS_MAX_TELEGRAM_MESSAGE_LENGTH;
|
||||
uint8_t next_offset = telegram_last_->offset + old_length;
|
||||
uint8_t message_data = (UINT8_MAX - next_offset) >= next_length ? next_length : UINT8_MAX - next_offset;
|
||||
// check telegram, offset and overflow
|
||||
// some telegrams only reply with one byte less, but have higher offsets (0x10)
|
||||
if (old_length >= (next_length - 1) && telegram_last_->offset == offset) {
|
||||
add(Telegram::Operation::TX_READ, telegram_last_->dest, telegram_last_->type_id, next_offset, &message_data, 1, 0, true);
|
||||
return telegram_last_->type_id;
|
||||
}
|
||||
|
||||
uint8_t add_offset = 25; // for EMS+ telegram increase offset by 25
|
||||
if (telegram_last_->type_id < 0x100) { // but for EMS1.0 by 27
|
||||
add_offset = 27;
|
||||
}
|
||||
|
||||
if (UINT8_MAX - telegram_last_->offset < add_offset) { // stop if new offset would overflow
|
||||
return 0;
|
||||
}
|
||||
|
||||
add(Telegram::Operation::TX_READ, telegram_last_->dest, telegram_last_->type_id, telegram_last_->offset + add_offset, message_data, 1, 0, true);
|
||||
return telegram_last_->type_id;
|
||||
return 0;
|
||||
}
|
||||
|
||||
// checks if a telegram is sent to us matches the last Tx request
|
||||
@@ -665,7 +692,7 @@ uint16_t TxService::post_send_query() {
|
||||
(this->telegram_last_->type_id > 0xFF) ? (EMS_MAX_TELEGRAM_MESSAGE_LENGTH - 2) : EMS_MAX_TELEGRAM_MESSAGE_LENGTH; // request all data, 32 bytes
|
||||
this->add(Telegram::Operation::TX_READ, dest, post_typeid, offset, &message_data, 1, 0, true); // add to top/front of queue
|
||||
// read_request(telegram_last_post_send_query_, dest, 0); // no offset
|
||||
LOG_DEBUG(F("Sending post validate read, type ID 0x%02X to dest 0x%02X"), post_typeid, dest);
|
||||
LOG_DEBUG("Sending post validate read, type ID 0x%02X to dest 0x%02X", post_typeid, dest);
|
||||
set_post_send_query(0); // reset
|
||||
// delay the request if we have a different type_id for post_send_query
|
||||
delayed_send_ = (this->telegram_last_->type_id == post_typeid) ? 0 : (uuid::get_uptime() + POST_SEND_DELAY);
|
||||
|
||||
@@ -46,11 +46,30 @@ static constexpr uint8_t EMS_VALUE_UINT_NOTSET = 0xFF; // for 8-bit uns
|
||||
static constexpr int8_t EMS_VALUE_INT_NOTSET = 0x7F; // for signed 8-bit ints/bytes
|
||||
static constexpr uint16_t EMS_VALUE_USHORT_NOTSET = 0x7D00; // 32000: for 2-byte unsigned shorts
|
||||
static constexpr int16_t EMS_VALUE_SHORT_NOTSET = 0x7D00; // 32000: for 2-byte signed shorts
|
||||
static constexpr uint32_t EMS_VALUE_ULONG_NOTSET = 0x00FFFFFF; // for 3-byte and 4-byte longs
|
||||
static constexpr uint32_t EMS_VALUE_ULONG_NOTSET = 0x00FFFFFF; // for 3-byte longs
|
||||
static constexpr uint32_t EMS_VALUE_ULLONG_NOTSET = 0xFFFFFFFF; // for 4-byte longs
|
||||
|
||||
static constexpr uint8_t EMS_MAX_TELEGRAM_LENGTH = 32; // max length of a complete EMS telegram
|
||||
static constexpr uint8_t EMS_MAX_TELEGRAM_MESSAGE_LENGTH = 27; // max length of message block, assuming EMS1.0
|
||||
|
||||
#if defined(EMSESP_STANDALONE_DUMP)
|
||||
#define EMS_VALUE_DEFAULT_INT 11
|
||||
#define EMS_VALUE_DEFAULT_UINT -12
|
||||
#define EMS_VALUE_DEFAULT_SHORT -1234
|
||||
#define EMS_VALUE_DEFAULT_USHORT 1234
|
||||
#define EMS_VALUE_DEFAULT_ULONG 12356
|
||||
#define EMS_VALUE_DEFAULT_BOOL 1
|
||||
#define EMS_VALUE_DEFAULT_ENUM 1
|
||||
#else
|
||||
#define EMS_VALUE_DEFAULT_INT EMS_VALUE_INT_NOTSET
|
||||
#define EMS_VALUE_DEFAULT_UINT EMS_VALUE_UINT_NOTSET
|
||||
#define EMS_VALUE_DEFAULT_SHORT EMS_VALUE_SHORT_NOTSET
|
||||
#define EMS_VALUE_DEFAULT_USHORT EMS_VALUE_USHORT_NOTSET
|
||||
#define EMS_VALUE_DEFAULT_ULONG EMS_VALUE_ULONG_NOTSET
|
||||
#define EMS_VALUE_DEFAULT_BOOL EMS_VALUE_BOOL_NOTSET
|
||||
#define EMS_VALUE_DEFAULT_ENUM EMS_VALUE_UINT_NOTSET
|
||||
#endif
|
||||
|
||||
namespace emsesp {
|
||||
|
||||
class Telegram {
|
||||
@@ -250,11 +269,7 @@ class RxService : public EMSbus {
|
||||
if (telegram_error_count_ == 0) {
|
||||
return 100; // all good, 100%
|
||||
}
|
||||
if (telegram_error_count_ >= telegram_count_) {
|
||||
return 100;
|
||||
}
|
||||
uint8_t q = ((float)telegram_error_count_ / telegram_count_ * 100);
|
||||
|
||||
uint8_t q = (telegram_error_count_ * 100 / (telegram_count_ + telegram_error_count_));
|
||||
return (q <= EMS_BUS_QUALITY_RX_THRESHOLD ? 100 : 100 - q);
|
||||
}
|
||||
|
||||
@@ -294,6 +309,7 @@ class TxService : public EMSbus {
|
||||
|
||||
void start();
|
||||
void send();
|
||||
uint8_t get_send_id();
|
||||
void add(const uint8_t operation,
|
||||
const uint8_t dest,
|
||||
const uint16_t type_id,
|
||||
@@ -304,12 +320,12 @@ class TxService : public EMSbus {
|
||||
const bool front = false);
|
||||
void add(const uint8_t operation, const uint8_t * data, const uint8_t length, const uint16_t validateid, const bool front = false);
|
||||
void read_request(const uint16_t type_id, const uint8_t dest, const uint8_t offset = 0, const uint8_t length = 0);
|
||||
void send_raw(const char * telegram_data);
|
||||
bool send_raw(const char * telegram_data);
|
||||
void send_poll() const;
|
||||
void retry_tx(const uint8_t operation, const uint8_t * data, const uint8_t length);
|
||||
bool is_last_tx(const uint8_t src, const uint8_t dest) const;
|
||||
uint16_t post_send_query();
|
||||
uint16_t read_next_tx(uint8_t offset);
|
||||
uint16_t read_next_tx(const uint8_t offset, const uint8_t length);
|
||||
|
||||
uint8_t retry_count() const {
|
||||
return retry_count_;
|
||||
|
||||
@@ -30,7 +30,7 @@ bool Test::run_test(const char * command, int8_t id) {
|
||||
}
|
||||
|
||||
if (strcmp(command, "general") == 0) {
|
||||
EMSESP::logger().info(F("Testing general. Adding a Boiler and Thermostat"));
|
||||
EMSESP::logger().info("Testing general. Adding a Boiler and Thermostat");
|
||||
|
||||
add_device(0x08, 123); // Nefit Trendline
|
||||
add_device(0x18, 157); // Bosch CR100
|
||||
@@ -53,8 +53,10 @@ bool Test::run_test(const char * command, int8_t id) {
|
||||
return true;
|
||||
}
|
||||
|
||||
#ifndef EMSESP_DEBUG_LIMITED
|
||||
|
||||
if (strcmp(command, "2thermostats") == 0) {
|
||||
EMSESP::logger().info(F("Testing with multiple thermostats..."));
|
||||
EMSESP::logger().info("Testing with multiple thermostats...");
|
||||
|
||||
add_device(0x08, 123); // GB072
|
||||
add_device(0x10, 158); // RC310
|
||||
@@ -86,7 +88,7 @@ bool Test::run_test(const char * command, int8_t id) {
|
||||
}
|
||||
|
||||
if (strcmp(command, "310") == 0) {
|
||||
EMSESP::logger().info(F("Adding a GB072/RC310 combo..."));
|
||||
EMSESP::logger().info("Adding a GB072/RC310 combo...");
|
||||
|
||||
add_device(0x08, 123); // GB072
|
||||
add_device(0x10, 158); // RC310
|
||||
@@ -113,7 +115,7 @@ bool Test::run_test(const char * command, int8_t id) {
|
||||
}
|
||||
|
||||
if (strcmp(command, "gateway") == 0) {
|
||||
EMSESP::logger().info(F("Adding a Gateway..."));
|
||||
EMSESP::logger().info("Adding a Gateway...");
|
||||
|
||||
// add 0x48 KM200, via a version command
|
||||
rx_telegram({0x48, 0x0B, 0x02, 0x00, 0xBD, 0x04, 0x06, 00, 00, 00, 00, 00, 00, 00});
|
||||
@@ -133,7 +135,7 @@ bool Test::run_test(const char * command, int8_t id) {
|
||||
}
|
||||
|
||||
if (strcmp(command, "mixer") == 0) {
|
||||
EMSESP::logger().info(F("Adding a mixer..."));
|
||||
EMSESP::logger().info("Adding a mixer...");
|
||||
|
||||
// add controller
|
||||
add_device(0x09, 114);
|
||||
@@ -155,7 +157,7 @@ bool Test::run_test(const char * command, int8_t id) {
|
||||
}
|
||||
|
||||
if (strcmp(command, "boiler") == 0) {
|
||||
EMSESP::logger().info(F("Adding boiler..."));
|
||||
EMSESP::logger().info("Adding boiler...");
|
||||
add_device(0x08, 123); // Nefit Trendline
|
||||
|
||||
// UBAuptime
|
||||
@@ -172,7 +174,7 @@ bool Test::run_test(const char * command, int8_t id) {
|
||||
}
|
||||
|
||||
if (strcmp(command, "thermostat") == 0) {
|
||||
EMSESP::logger().info(F("Adding thermostat..."));
|
||||
EMSESP::logger().info("Adding thermostat...");
|
||||
|
||||
add_device(0x10, 192); // FW120
|
||||
|
||||
@@ -185,7 +187,7 @@ bool Test::run_test(const char * command, int8_t id) {
|
||||
}
|
||||
|
||||
if (strcmp(command, "solar") == 0) {
|
||||
EMSESP::logger().info(F("Adding solar..."));
|
||||
EMSESP::logger().info("Adding solar...");
|
||||
|
||||
add_device(0x30, 163); // SM100
|
||||
|
||||
@@ -204,7 +206,7 @@ bool Test::run_test(const char * command, int8_t id) {
|
||||
}
|
||||
|
||||
if (strcmp(command, "heatpump") == 0) {
|
||||
EMSESP::logger().info(F("Adding heatpump..."));
|
||||
EMSESP::logger().info("Adding heatpump...");
|
||||
|
||||
add_device(0x38, 200); // Enviline module
|
||||
add_device(0x10, 192); // FW120 thermostat
|
||||
@@ -216,6 +218,8 @@ bool Test::run_test(const char * command, int8_t id) {
|
||||
return true;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -231,14 +235,24 @@ void Test::run_test(uuid::console::Shell & shell, const std::string & cmd, const
|
||||
EMSESP::watch(EMSESP::Watch::WATCH_RAW); // raw
|
||||
|
||||
std::string command(20, '\0');
|
||||
|
||||
#ifndef EMSESP_DEBUG_LIMITED
|
||||
|
||||
if ((cmd.empty()) || (cmd == "default")) {
|
||||
command = EMSESP_DEBUG_DEFAULT;
|
||||
} else {
|
||||
command = cmd;
|
||||
}
|
||||
|
||||
#if defined(EMSESP_STANDALONE_DUMP)
|
||||
if (command == "dump") {
|
||||
shell.printfln("Adding all devices and entities...");
|
||||
EMSESP::dump_all_values(shell);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (command == "general") {
|
||||
shell.printfln(F("Testing adding a general boiler & thermostat..."));
|
||||
shell.printfln("Testing adding a general boiler & thermostat...");
|
||||
run_test("general");
|
||||
shell.invoke_command("show devices");
|
||||
shell.invoke_command("show");
|
||||
@@ -246,8 +260,16 @@ void Test::run_test(uuid::console::Shell & shell, const std::string & cmd, const
|
||||
shell.invoke_command("show mqtt");
|
||||
}
|
||||
|
||||
if (command == "modes") {
|
||||
shell.printfln("Testing thermostat modes...");
|
||||
run_test("general");
|
||||
shell.invoke_command("call thermostat mode auto");
|
||||
shell.invoke_command("call thermostat mode Manuell"); // DE
|
||||
shell.invoke_command("call thermostat mode 1");
|
||||
}
|
||||
|
||||
if (command == "render") {
|
||||
shell.printfln(F("Testing render..."));
|
||||
shell.printfln("Testing render...");
|
||||
|
||||
// check read_value to make sure it handles all the data type correctly
|
||||
uint8_t message_data[] = {1, 2, 3, 4, 5, 6, 7, 8, 9}; // message_length is 9
|
||||
@@ -304,18 +326,18 @@ void Test::run_test(uuid::console::Shell & shell, const std::string & cmd, const
|
||||
|
||||
uint16_t temp;
|
||||
float doub;
|
||||
temp = 0x0201; // decimal 513
|
||||
doub = Helpers::round2(temp, 10); // divide by 10
|
||||
temp = 0x0201; // decimal 513
|
||||
doub = Helpers::transformNumFloat(temp, 10); // divide by 10
|
||||
shell.printfln("Round test from x%02X to %d to %f", temp, temp, doub);
|
||||
doub = Helpers::round2(temp, 10); // divide by 10
|
||||
doub = Helpers::transformNumFloat(temp, 10); // divide by 10
|
||||
shell.printfln("Round test div10 from x%02X to %d to %f", temp, temp, doub);
|
||||
temp = 0x63;
|
||||
doub = Helpers::round2(temp, 2); // divide by 2
|
||||
doub = Helpers::transformNumFloat(temp, 2); // divide by 2
|
||||
shell.printfln("Round test div2 from x%02X to %d to %f", temp, temp, doub);
|
||||
}
|
||||
|
||||
if (command == "devices") {
|
||||
shell.printfln(F("Testing devices..."));
|
||||
shell.printfln("Testing devices...");
|
||||
|
||||
// A fake response - UBADevices(0x07)
|
||||
rx_telegram({0x08, 0x00, 0x07, 0x00, 0x0B, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00});
|
||||
@@ -323,7 +345,7 @@ void Test::run_test(uuid::console::Shell & shell, const std::string & cmd, const
|
||||
|
||||
// check for boiler and controller on same product_id
|
||||
if (command == "double") {
|
||||
shell.printfln(F("Testing double..."));
|
||||
shell.printfln("Testing double...");
|
||||
|
||||
add_device(0x08, 206); // Nefit Excellent HR30
|
||||
add_device(0x09, 206); // Nefit Excellent HR30 Controller
|
||||
@@ -333,7 +355,7 @@ void Test::run_test(uuid::console::Shell & shell, const std::string & cmd, const
|
||||
}
|
||||
|
||||
if (command == "620") {
|
||||
EMSESP::logger().info(F("Testing 620..."));
|
||||
EMSESP::logger().info("Testing 620...");
|
||||
|
||||
// Version Controller
|
||||
uart_telegram({0x09, 0x0B, 0x02, 0x00, 0x5F, 0x06, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00});
|
||||
@@ -344,7 +366,7 @@ void Test::run_test(uuid::console::Shell & shell, const std::string & cmd, const
|
||||
|
||||
// unknown device
|
||||
if (command == "unknown") {
|
||||
shell.printfln(F("Testing unknown..."));
|
||||
shell.printfln("Testing unknown...");
|
||||
|
||||
// add boiler
|
||||
add_device(0x08, 84);
|
||||
@@ -361,19 +383,19 @@ void Test::run_test(uuid::console::Shell & shell, const std::string & cmd, const
|
||||
}
|
||||
|
||||
if (command == "unknown2") {
|
||||
shell.printfln(F("Testing unknown2..."));
|
||||
shell.printfln("Testing unknown2...");
|
||||
|
||||
// simulate getting version information back from an unknown device
|
||||
rx_telegram({0x09, 0x0B, 0x02, 0x00, 0x5A, 0x01, 0x02}); // productID is 90 which doesn't exist
|
||||
}
|
||||
|
||||
if (command == "gateway") {
|
||||
shell.printfln(F("Testing Gateway..."));
|
||||
shell.printfln("Testing Gateway...");
|
||||
run_test("gateway");
|
||||
}
|
||||
|
||||
if (command == "310") {
|
||||
shell.printfln(F("Testing RC310..."));
|
||||
shell.printfln("Testing RC310...");
|
||||
run_test("310");
|
||||
shell.invoke_command("show devices");
|
||||
shell.invoke_command("show");
|
||||
@@ -382,14 +404,14 @@ void Test::run_test(uuid::console::Shell & shell, const std::string & cmd, const
|
||||
}
|
||||
|
||||
if (command == "2thermostats") {
|
||||
shell.printfln(F("Testing multiple thermostats..."));
|
||||
shell.printfln("Testing multiple thermostats...");
|
||||
run_test("2thermostats");
|
||||
shell.invoke_command("show");
|
||||
shell.invoke_command("show devices");
|
||||
}
|
||||
|
||||
if (command == "web") {
|
||||
shell.printfln(F("Testing Web..."));
|
||||
shell.printfln("Testing Web...");
|
||||
|
||||
Mqtt::enabled(false); // turn off mqtt
|
||||
Mqtt::ha_enabled(false); // turn off ha
|
||||
@@ -399,7 +421,7 @@ void Test::run_test(uuid::console::Shell & shell, const std::string & cmd, const
|
||||
|
||||
#if defined(EMSESP_STANDALONE)
|
||||
|
||||
DynamicJsonDocument doc(8000); // some absurb high number
|
||||
DynamicJsonDocument doc(8000); // some absurd high number
|
||||
for (const auto & emsdevice : EMSESP::emsdevices) {
|
||||
if (emsdevice) {
|
||||
doc.clear();
|
||||
@@ -438,7 +460,7 @@ void Test::run_test(uuid::console::Shell & shell, const std::string & cmd, const
|
||||
}
|
||||
|
||||
if (command == "board_profile") {
|
||||
shell.printfln(F("Testing board profile..."));
|
||||
shell.printfln("Testing board profile...");
|
||||
|
||||
shell.invoke_command("system");
|
||||
shell.invoke_command("set board_profile wemos");
|
||||
@@ -447,8 +469,9 @@ void Test::run_test(uuid::console::Shell & shell, const std::string & cmd, const
|
||||
}
|
||||
|
||||
if (command == "boiler") {
|
||||
shell.printfln(F("Testing boiler..."));
|
||||
Mqtt::ha_enabled(false);
|
||||
shell.printfln("Testing boiler...");
|
||||
// Mqtt::ha_enabled(false);
|
||||
Mqtt::ha_enabled(true);
|
||||
Mqtt::nested_format(1);
|
||||
|
||||
run_test("boiler");
|
||||
@@ -474,7 +497,7 @@ void Test::run_test(uuid::console::Shell & shell, const std::string & cmd, const
|
||||
}
|
||||
|
||||
if (command == "shower_alert") {
|
||||
shell.printfln(F("Testing Shower Alert..."));
|
||||
shell.printfln("Testing Shower Alert...");
|
||||
|
||||
run_test("boiler");
|
||||
|
||||
@@ -483,7 +506,7 @@ void Test::run_test(uuid::console::Shell & shell, const std::string & cmd, const
|
||||
}
|
||||
|
||||
if (command == "fr120") {
|
||||
shell.printfln(F("Testing adding a thermostat FR120..."));
|
||||
shell.printfln("Testing adding a thermostat FR120...");
|
||||
|
||||
add_device(0x10, 191); // FR120 thermostat
|
||||
|
||||
@@ -495,7 +518,7 @@ void Test::run_test(uuid::console::Shell & shell, const std::string & cmd, const
|
||||
}
|
||||
|
||||
if (command == "ha") {
|
||||
shell.printfln(F("Testing HA mqtt discovery"));
|
||||
shell.printfln("Testing HA mqtt discovery");
|
||||
Mqtt::ha_enabled(true);
|
||||
// Mqtt::ha_enabled(false);
|
||||
|
||||
@@ -517,7 +540,7 @@ void Test::run_test(uuid::console::Shell & shell, const std::string & cmd, const
|
||||
}
|
||||
|
||||
if (command == "lastcode") {
|
||||
shell.printfln(F("Testing lastcode"));
|
||||
shell.printfln("Testing lastcode");
|
||||
|
||||
Mqtt::ha_enabled(false);
|
||||
Mqtt::nested_format(1);
|
||||
@@ -535,7 +558,7 @@ void Test::run_test(uuid::console::Shell & shell, const std::string & cmd, const
|
||||
}
|
||||
|
||||
if (command == "dv") {
|
||||
shell.printfln(F("Testing device value rendering"));
|
||||
shell.printfln("Testing device value rendering");
|
||||
|
||||
Mqtt::ha_enabled(true);
|
||||
Mqtt::nested_format(1);
|
||||
@@ -549,12 +572,12 @@ void Test::run_test(uuid::console::Shell & shell, const std::string & cmd, const
|
||||
}
|
||||
|
||||
if (command == "dallas") {
|
||||
shell.printfln(F("Testing adding Dallas sensor"));
|
||||
shell.printfln("Testing adding Dallas sensor");
|
||||
emsesp::EMSESP::dallassensor_.test();
|
||||
}
|
||||
|
||||
if (command == "dallas_full") {
|
||||
shell.printfln(F("Testing adding and changing Dallas sensor"));
|
||||
shell.printfln("Testing adding and changing Dallas sensor");
|
||||
Mqtt::ha_enabled(true);
|
||||
Mqtt::nested_format(1);
|
||||
// Mqtt::nested_format(0);
|
||||
@@ -570,7 +593,7 @@ void Test::run_test(uuid::console::Shell & shell, const std::string & cmd, const
|
||||
}
|
||||
|
||||
if (command == "analog") {
|
||||
shell.printfln(F("Testing adding Analog sensor"));
|
||||
shell.printfln("Testing adding Analog sensor");
|
||||
Mqtt::ha_enabled(true);
|
||||
// Mqtt::ha_enabled(false);
|
||||
Mqtt::nested_format(1);
|
||||
@@ -596,12 +619,42 @@ void Test::run_test(uuid::console::Shell & shell, const std::string & cmd, const
|
||||
|
||||
// n=1 = EMSESP::system_.HEALTHCHECK_NO_BUS
|
||||
// n=2 = EMSESP::system_.HEALTHCHECK_NO_NETWORK
|
||||
shell.printfln(F("Testing healthcheck with %d"), n);
|
||||
shell.printfln("Testing healthcheck with %d", n);
|
||||
EMSESP::system_.healthcheck(n);
|
||||
}
|
||||
|
||||
if (command == "custom") {
|
||||
shell.printfln(F("Testing custom entities"));
|
||||
|
||||
Mqtt::ha_enabled(true);
|
||||
Mqtt::send_response(false);
|
||||
|
||||
run_test("thermostat");
|
||||
|
||||
// shell.invoke_command("call thermostat seltemp");
|
||||
// shell.invoke_command("call system publish");
|
||||
|
||||
// toggle mode
|
||||
for (const auto & emsdevice : EMSESP::emsdevices) {
|
||||
Serial.print("Custom: ");
|
||||
Serial.print(emsdevice->device_type_name());
|
||||
Serial.print(" uniqueid=");
|
||||
Serial.println(emsdevice->unique_id());
|
||||
|
||||
if (emsdevice->unique_id() == 1) { // thermostat
|
||||
std::string a = "00hc1/seltemp|new name>5<52";
|
||||
emsdevice->setCustomEntity(a);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
shell.invoke_command("call thermostat seltemp");
|
||||
shell.invoke_command("call system publish");
|
||||
}
|
||||
|
||||
|
||||
if (command == "masked") {
|
||||
shell.printfln(F("Testing masked entities"));
|
||||
shell.printfln("Testing masked entities");
|
||||
|
||||
Mqtt::ha_enabled(true);
|
||||
Mqtt::send_response(false);
|
||||
@@ -615,7 +668,7 @@ void Test::run_test(uuid::console::Shell & shell, const std::string & cmd, const
|
||||
for (const auto & emsdevice : EMSESP::emsdevices) {
|
||||
if (emsdevice->unique_id() == 1) { // boiler
|
||||
std::string a = "07wwseltemp";
|
||||
emsdevice->mask_entity(a);
|
||||
emsdevice->setCustomEntity(a);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -625,7 +678,7 @@ void Test::run_test(uuid::console::Shell & shell, const std::string & cmd, const
|
||||
}
|
||||
|
||||
if (command == "dv2") {
|
||||
shell.printfln(F("Testing device value lost"));
|
||||
shell.printfln("Testing device value lost");
|
||||
|
||||
Mqtt::ha_enabled(true);
|
||||
Mqtt::send_response(false);
|
||||
@@ -646,7 +699,7 @@ void Test::run_test(uuid::console::Shell & shell, const std::string & cmd, const
|
||||
|
||||
if (command == "api_values") {
|
||||
#if defined(EMSESP_STANDALONE)
|
||||
shell.printfln(F("Testing API getting values"));
|
||||
shell.printfln("Testing API getting values");
|
||||
Mqtt::ha_enabled(false);
|
||||
Mqtt::nested_format(1);
|
||||
Mqtt::send_response(false);
|
||||
@@ -679,7 +732,7 @@ void Test::run_test(uuid::console::Shell & shell, const std::string & cmd, const
|
||||
}
|
||||
|
||||
if (command == "mqtt_post") {
|
||||
shell.printfln(F("Testing MQTT incoming changes"));
|
||||
shell.printfln("Testing MQTT incoming changes");
|
||||
Mqtt::ha_enabled(false);
|
||||
Mqtt::nested_format(1);
|
||||
Mqtt::send_response(false);
|
||||
@@ -695,7 +748,7 @@ void Test::run_test(uuid::console::Shell & shell, const std::string & cmd, const
|
||||
#if defined(EMSESP_STANDALONE)
|
||||
// https://github.com/emsesp/EMS-ESP32/issues/541
|
||||
if (command == "api_wwmode") {
|
||||
shell.printfln(F("Testing API wwmode"));
|
||||
shell.printfln("Testing API wwmode");
|
||||
Mqtt::ha_enabled(false);
|
||||
Mqtt::nested_format(1);
|
||||
run_test("310");
|
||||
@@ -714,7 +767,7 @@ void Test::run_test(uuid::console::Shell & shell, const std::string & cmd, const
|
||||
#endif
|
||||
|
||||
if (command == "api") {
|
||||
shell.printfln(F("Testing API with MQTT and REST, standalone"));
|
||||
shell.printfln("Testing API with MQTT and REST, standalone");
|
||||
|
||||
Mqtt::ha_enabled(true);
|
||||
// Mqtt::ha_enabled(false);
|
||||
@@ -989,7 +1042,7 @@ void Test::run_test(uuid::console::Shell & shell, const std::string & cmd, const
|
||||
}
|
||||
|
||||
if (command == "mqtt_nested") {
|
||||
shell.printfln(F("Testing nested MQTT"));
|
||||
shell.printfln("Testing nested MQTT");
|
||||
Mqtt::ha_enabled(false); // turn off HA Discovery to stop the chatter
|
||||
|
||||
run_test("boiler");
|
||||
@@ -1009,7 +1062,7 @@ void Test::run_test(uuid::console::Shell & shell, const std::string & cmd, const
|
||||
}
|
||||
|
||||
if (command == "thermostat") {
|
||||
shell.printfln(F("Testing adding a thermostat FW120..."));
|
||||
shell.printfln("Testing adding a thermostat FW120...");
|
||||
|
||||
run_test("thermostat");
|
||||
shell.invoke_command("show");
|
||||
@@ -1025,7 +1078,7 @@ void Test::run_test(uuid::console::Shell & shell, const std::string & cmd, const
|
||||
}
|
||||
|
||||
if (command == "tc100") {
|
||||
shell.printfln(F("Testing adding a TC100 thermostat to the EMS bus..."));
|
||||
shell.printfln("Testing adding a TC100 thermostat to the EMS bus...");
|
||||
|
||||
// add a thermostat
|
||||
add_device(0x18, 202); // Bosch TC100 - https://github.com/emsesp/EMS-ESP/issues/474
|
||||
@@ -1036,7 +1089,7 @@ void Test::run_test(uuid::console::Shell & shell, const std::string & cmd, const
|
||||
}
|
||||
|
||||
if (command == "solar") {
|
||||
shell.printfln(F("Testing Solar"));
|
||||
shell.printfln("Testing Solar");
|
||||
run_test("solar");
|
||||
|
||||
uart_telegram("30 00 FF 0A 02 6A 04"); // SM100 pump on (1)sh
|
||||
@@ -1045,18 +1098,18 @@ void Test::run_test(uuid::console::Shell & shell, const std::string & cmd, const
|
||||
EMSESP::show_device_values(shell);
|
||||
shell.invoke_command("call system publish");
|
||||
|
||||
// EMSESP::send_raw_telegram("B0 00 FF 18 02 62 80 00 B8");
|
||||
// EMSESP::txservice_.send_raw("B0 00 FF 18 02 62 80 00 B8");
|
||||
}
|
||||
|
||||
if (command == "heatpump") {
|
||||
shell.printfln(F("Testing Heat Pump"));
|
||||
shell.printfln("Testing Heat Pump");
|
||||
run_test("heatpump");
|
||||
shell.invoke_command("call");
|
||||
shell.invoke_command("call heatpump info");
|
||||
}
|
||||
|
||||
if (command == "solar200") {
|
||||
shell.printfln(F("Testing Solar SM200"));
|
||||
shell.printfln("Testing Solar SM200");
|
||||
|
||||
add_device(0x30, 164); // SM200
|
||||
|
||||
@@ -1070,7 +1123,7 @@ void Test::run_test(uuid::console::Shell & shell, const std::string & cmd, const
|
||||
|
||||
rx_telegram({0xB0, 00, 0xFF, 0x18, 02, 0x62, 0x80, 00, 0xB8});
|
||||
|
||||
EMSESP::send_raw_telegram("B0 00 FF 18 02 62 80 00 B8");
|
||||
EMSESP::txservice_.send_raw("B0 00 FF 18 02 62 80 00 B8");
|
||||
|
||||
uart_telegram("30 00 FF 0A 02 6A 04"); // SM100 pump on 1
|
||||
uart_telegram("30 00 FF 00 02 64 00 00 00 04 00 00 FF 00 00 1E 0B 09 64 00 00 00 00"); // SM100 modulation
|
||||
@@ -1081,7 +1134,7 @@ void Test::run_test(uuid::console::Shell & shell, const std::string & cmd, const
|
||||
}
|
||||
|
||||
if (command == "km") {
|
||||
shell.printfln(F("Testing KM200 Gateway"));
|
||||
shell.printfln("Testing KM200 Gateway");
|
||||
|
||||
add_device(0x10, 158); // RC300
|
||||
add_device(0x48, 189); // KM200
|
||||
@@ -1139,7 +1192,7 @@ void Test::run_test(uuid::console::Shell & shell, const std::string & cmd, const
|
||||
}
|
||||
|
||||
if (command == "cr100") {
|
||||
shell.printfln(F("Testing CR100"));
|
||||
shell.printfln("Testing CR100");
|
||||
|
||||
add_device(0x18, 157); // Bosch CR100 - https://github.com/emsesp/EMS-ESP/issues/355
|
||||
|
||||
@@ -1164,14 +1217,14 @@ void Test::run_test(uuid::console::Shell & shell, const std::string & cmd, const
|
||||
}
|
||||
|
||||
if (command == "rx2") {
|
||||
shell.printfln(F("Testing Rx2..."));
|
||||
shell.printfln("Testing Rx2...");
|
||||
for (uint8_t i = 0; i < 30; i++) {
|
||||
uart_telegram({0x08, 0x0B, 0x33, 0x00, 0x08, 0xFF, 0x34, 0xFB, 0x00, 0x28, 0x00, 0x00, 0x46, 0x00, 0xFF, 0xFF, 0x00});
|
||||
}
|
||||
}
|
||||
|
||||
if (command == "rx") {
|
||||
shell.printfln(F("Testing Rx..."));
|
||||
shell.printfln("Testing Rx...");
|
||||
|
||||
// fake telegrams. length includes CRC
|
||||
// Boiler -> Me, UBAMonitorFast(0x18), telegram: 08 00 18 00 00 02 5A 73 3D 0A 10 65 40 02 1A 80 00 01 E1 01 76 0E 3D 48 00 C9 44 02 00 (#data=25)
|
||||
@@ -1228,7 +1281,7 @@ void Test::run_test(uuid::console::Shell & shell, const std::string & cmd, const
|
||||
}
|
||||
|
||||
if (command == "tx") {
|
||||
shell.printfln(F("Testing Tx..."));
|
||||
shell.printfln("Testing Tx...");
|
||||
|
||||
// TX queue example - Me -> Thermostat, (0x91), telegram: 0B 17 91 05 44 45 46 47 (#data=4)
|
||||
uint8_t t11[] = {0x44, 0x45, 0x46, 0x47};
|
||||
@@ -1265,7 +1318,7 @@ void Test::run_test(uuid::console::Shell & shell, const std::string & cmd, const
|
||||
}
|
||||
|
||||
if (command == "poll") {
|
||||
shell.printfln(F("Testing Poll..."));
|
||||
shell.printfln("Testing Poll...");
|
||||
|
||||
// simulate sending a read request
|
||||
// uint8_t t16[] = {0x44, 0x45, 0x46, 0x47}; // Me -> Thermostat, (0x91), telegram: 0B 17 91 05 44 45 46 47 (#data=4)
|
||||
@@ -1290,7 +1343,7 @@ void Test::run_test(uuid::console::Shell & shell, const std::string & cmd, const
|
||||
}
|
||||
|
||||
if (command == "cmd") {
|
||||
shell.printfln(F("Testing Commands..."));
|
||||
shell.printfln("Testing Commands...");
|
||||
|
||||
// add a thermostat with 3 HCs
|
||||
add_device(0x10, 192); // FW120
|
||||
@@ -1300,6 +1353,10 @@ void Test::run_test(uuid::console::Shell & shell, const std::string & cmd, const
|
||||
uart_telegram({0x90, 0x00, 0xFF, 0x00, 0x00, 0x70, 0x02, 0x01, 0x00, 0xCE, 0x00, 0xE5});
|
||||
uart_telegram({0x90, 0x00, 0xFF, 0x00, 0x00, 0x71, 0x01, 0x02, 0x00, 0xCF, 0x00, 0xE6});
|
||||
|
||||
// add room sensor - test for https://github.com/emsesp/EMS-ESP32/issues/699
|
||||
// use auto
|
||||
uart_telegram("90 00 FF 00 00 65 01 00 02 19 3D 42 02 01 00 03 FF 28 06 01 02 20 27 29 01 01 00");
|
||||
|
||||
shell.invoke_command("help");
|
||||
shell.invoke_command("call");
|
||||
shell.invoke_command("call system info");
|
||||
@@ -1317,13 +1374,13 @@ void Test::run_test(uuid::console::Shell & shell, const std::string & cmd, const
|
||||
}
|
||||
|
||||
if (command == "pin") {
|
||||
shell.printfln(F("Testing pin..."));
|
||||
shell.printfln("Testing pin...");
|
||||
shell.invoke_command("call system pin");
|
||||
shell.invoke_command("call system pin 1 true");
|
||||
}
|
||||
|
||||
if (command == "mqtt2") {
|
||||
shell.printfln(F("Testing MQTT large payloads..."));
|
||||
shell.printfln("Testing MQTT large payloads...");
|
||||
|
||||
DynamicJsonDocument doc(EMSESP_JSON_SIZE_XXLARGE_DYN);
|
||||
|
||||
@@ -1338,15 +1395,15 @@ void Test::run_test(uuid::console::Shell & shell, const std::string & cmd, const
|
||||
}
|
||||
doc.shrinkToFit();
|
||||
JsonObject jo = doc.as<JsonObject>();
|
||||
shell.printfln(F("Size of JSON payload = %d"), jo.memoryUsage());
|
||||
shell.printfln(F("Length of JSON payload = %d"), measureJson(jo));
|
||||
shell.printfln("Size of JSON payload = %d", jo.memoryUsage());
|
||||
shell.printfln("Length of JSON payload = %d", measureJson(jo));
|
||||
|
||||
Mqtt::publish("test", jo);
|
||||
Mqtt::show_mqtt(shell); // show queue
|
||||
}
|
||||
|
||||
if (command == "mqtt") {
|
||||
shell.printfln(F("Testing MQTT..."));
|
||||
shell.printfln("Testing MQTT...");
|
||||
|
||||
Mqtt::ha_enabled(false);
|
||||
Mqtt::enabled(true);
|
||||
@@ -1354,9 +1411,21 @@ void Test::run_test(uuid::console::Shell & shell, const std::string & cmd, const
|
||||
// add a boiler
|
||||
add_device(0x08, 123); // Nefit Trendline
|
||||
|
||||
// add a thermostat
|
||||
add_device(0x18, 157); // Bosch CR100 - https://github.com/emsesp/EMS-ESP/issues/355
|
||||
// add some boiler data
|
||||
// Boiler -> Me, UBAMonitorFast(0x18), telegram: 08 00 18 00 00 02 5A 73 3D 0A 10 65 40 02 1A 80 00 01 E1 01 76 0E 3D 48 00 C9 44 02 00 (#data=25)
|
||||
uart_telegram({0x08, 0x00, 0x18, 0x00, 0x00, 0x02, 0x5A, 0x73, 0x3D, 0x0A, 0x10, 0x65, 0x40, 0x02, 0x1A,
|
||||
0x80, 0x00, 0x01, 0xE1, 0x01, 0x76, 0x0E, 0x3D, 0x48, 0x00, 0xC9, 0x44, 0x02, 0x00});
|
||||
|
||||
// Boiler -> Thermostat, UBAParameterWW(0x33), telegram: 08 97 33 00 23 24 (#data=2)
|
||||
uart_telegram({0x08, 0x98, 0x33, 0x00, 0x23, 0x24});
|
||||
|
||||
// Boiler -> Me, UBAParameterWW(0x33), telegram: 08 0B 33 00 08 FF 34 FB 00 28 00 00 46 00 FF FF 00 (#data=13)
|
||||
uart_telegram({0x08, 0x0B, 0x33, 0x00, 0x08, 0xFF, 0x34, 0xFB, 0x00, 0x28, 0x00, 0x00, 0x46, 0x00, 0xFF, 0xFF, 0x00});
|
||||
|
||||
// add a thermostat
|
||||
add_device(0x18, 157); // Bosch CR100
|
||||
|
||||
// add some thermostat data
|
||||
// RCPLUSStatusMessage_HC1(0x01A5) - HC1
|
||||
uart_telegram({0x98, 0x00, 0xFF, 0x00, 0x01, 0xA5, 0x00, 0xCF, 0x21, 0x2E, 0x00, 0x00, 0x2E, 0x24,
|
||||
0x03, 0x25, 0x03, 0x03, 0x01, 0x03, 0x25, 0x00, 0xC8, 0x00, 0x00, 0x11, 0x01, 0x03});
|
||||
@@ -1369,11 +1438,13 @@ void Test::run_test(uuid::console::Shell & shell, const std::string & cmd, const
|
||||
|
||||
char boiler_topic[Mqtt::MQTT_TOPIC_MAX_SIZE];
|
||||
char thermostat_topic[Mqtt::MQTT_TOPIC_MAX_SIZE];
|
||||
char thermostat_topic_hc1[Mqtt::MQTT_TOPIC_MAX_SIZE];
|
||||
char system_topic[Mqtt::MQTT_TOPIC_MAX_SIZE];
|
||||
Mqtt::show_mqtt(shell); // show queue
|
||||
|
||||
strlcpy(boiler_topic, "ems-esp/boiler", sizeof(boiler_topic));
|
||||
strlcpy(thermostat_topic, "ems-esp/thermostat", sizeof(thermostat_topic));
|
||||
strlcpy(thermostat_topic_hc1, "ems-esp/thermostat/hc1", sizeof(thermostat_topic));
|
||||
strlcpy(system_topic, "ems-esp/system", sizeof(system_topic));
|
||||
|
||||
// test publishing
|
||||
@@ -1382,11 +1453,13 @@ void Test::run_test(uuid::console::Shell & shell, const std::string & cmd, const
|
||||
// test receiving
|
||||
EMSESP::mqtt_.incoming(boiler_topic, ""); // test if ignore empty payloads, should return values
|
||||
|
||||
EMSESP::mqtt_.incoming(boiler_topic, "12345"); // error: invalid format
|
||||
EMSESP::mqtt_.incoming("bad_topic", "123456"); // error: no matching topic
|
||||
EMSESP::mqtt_.incoming(boiler_topic, "{\"cmd\":\"garbage\",\"data\":22.52}"); // error: should report error
|
||||
// these all should fail
|
||||
EMSESP::mqtt_.incoming(boiler_topic, "12345"); // error: invalid format
|
||||
EMSESP::mqtt_.incoming("bad_topic", "123456"); // error: no matching topic
|
||||
EMSESP::mqtt_.incoming(boiler_topic, "{\"cmd\":\"garbage\",\"data\":22.52}"); // error: should report error
|
||||
EMSESP::mqtt_.incoming(thermostat_topic, "{\"cmd\":\"control\",\"data\":\"1\"}"); // RC35 only, should error
|
||||
|
||||
EMSESP::mqtt_.incoming(boiler_topic, "{\"cmd\":\"comfort\",\"data\":\"eco\"}");
|
||||
// these all should pass
|
||||
EMSESP::mqtt_.incoming(boiler_topic, "{\"cmd\":\"wwactivated\",\"data\":\"1\"}"); // with quotes
|
||||
EMSESP::mqtt_.incoming(boiler_topic, "{\"cmd\":\"wwactivated\",\"data\":1}"); // without quotes
|
||||
EMSESP::mqtt_.incoming(boiler_topic, "{\"cmd\":\"selflowtemp\",\"data\":55}");
|
||||
@@ -1395,19 +1468,22 @@ void Test::run_test(uuid::console::Shell & shell, const std::string & cmd, const
|
||||
EMSESP::mqtt_.incoming("ems-esp/boiler/selflowtemp", "56");
|
||||
|
||||
EMSESP::mqtt_.incoming(system_topic, "{\"cmd\":\"send\",\"data\":\"01 02 03 04 05\"}");
|
||||
EMSESP::mqtt_.incoming(system_topic, "{\"cmd\":\"pin\",\"id\":12,\"data\":\"1\"}");
|
||||
// EMSESP::mqtt_.incoming(system_topic, "{\"cmd\":\"pin\",\"id\":12,\"data\":\"1\"}");
|
||||
|
||||
EMSESP::mqtt_.incoming(thermostat_topic, "{\"cmd\":\"wwmode\",\"data\":\"auto\"}");
|
||||
EMSESP::mqtt_.incoming(thermostat_topic, "{\"cmd\":\"control\",\"data\":\"1\"}"); // RC35 only, should error
|
||||
EMSESP::mqtt_.incoming(thermostat_topic, "{\"cmd\":\"mode\",\"data\":\"typo\",\"id\":2}"); // invalid mode
|
||||
EMSESP::mqtt_.incoming(thermostat_topic, "{\"cmd\":\"mode\",\"data\":\"auto\",\"id\":2}");
|
||||
EMSESP::mqtt_.incoming(thermostat_topic, "{\"cmd\":\"mode\",\"data\":\"auto\",\"hc\":2}"); // hc as number
|
||||
EMSESP::mqtt_.incoming(thermostat_topic, "{\"cmd\":\"temp\",\"data\":19.5,\"hc\":1}"); // data as number
|
||||
EMSESP::mqtt_.incoming(thermostat_topic, "{\"cmd\":\"mode\",\"data\":\"auto\",\"hc\":\"2\"}"); // hc as string. should error as no hc2
|
||||
EMSESP::mqtt_.incoming(thermostat_topic, "{\"cmd\":\"temp\",\"data\":22.56}");
|
||||
EMSESP::mqtt_.incoming(thermostat_topic, "{\"cmd\":\"temp\",\"data\":22}");
|
||||
EMSESP::mqtt_.incoming(thermostat_topic, "{\"cmd\":\"temp\",\"data\":\"22.56\"}");
|
||||
EMSESP::mqtt_.incoming(thermostat_topic, "{\"cmd\":\"temp\",\"id\":2,\"data\":22}");
|
||||
EMSESP::mqtt_.incoming(thermostat_topic, "{\"cmd\":\"mode\",\"data\":\"auto\",\"hc\":2}"); // hc as number
|
||||
EMSESP::mqtt_.incoming(thermostat_topic, "{\"cmd\":\"seltemp\",\"data\":19.5,\"hc\":1}"); // data as number
|
||||
EMSESP::mqtt_.incoming(thermostat_topic, "{\"cmd\":\"seltemp\",\"data\":\"auto\",\"hc\":\"2\"}"); // hc as string. should error as no hc2
|
||||
EMSESP::mqtt_.incoming(thermostat_topic, "{\"cmd\":\"seltemp\",\"data\":22.56}");
|
||||
EMSESP::mqtt_.incoming(thermostat_topic, "{\"cmd\":\"seltemp\",\"data\":22}");
|
||||
EMSESP::mqtt_.incoming(thermostat_topic, "{\"cmd\":\"seltemp\",\"data\":\"22.56\"}");
|
||||
EMSESP::mqtt_.incoming(thermostat_topic, "{\"cmd\":\"seltemp\",\"id\":2,\"data\":22}");
|
||||
|
||||
// test with hc
|
||||
EMSESP::mqtt_.incoming("ems-esp/thermostat/hc1/seltemp", "30");
|
||||
EMSESP::mqtt_.incoming("ems-esp/thermostat/hc2/seltemp", "32");
|
||||
|
||||
// test single commands
|
||||
EMSESP::mqtt_.incoming(thermostat_topic, "auto");
|
||||
@@ -1421,7 +1497,7 @@ void Test::run_test(uuid::console::Shell & shell, const std::string & cmd, const
|
||||
}
|
||||
|
||||
if (command == "poll2") {
|
||||
shell.printfln(F("Testing Tx Sending last message on queue..."));
|
||||
shell.printfln("Testing Tx Sending last message on queue...");
|
||||
|
||||
EMSESP::show_ems(shell);
|
||||
|
||||
@@ -1432,7 +1508,7 @@ void Test::run_test(uuid::console::Shell & shell, const std::string & cmd, const
|
||||
}
|
||||
|
||||
if (command == "rx2") {
|
||||
shell.printfln(F("Testing rx2..."));
|
||||
shell.printfln("Testing rx2...");
|
||||
|
||||
uart_telegram({0x1B, 0x5B, 0xFD, 0x2D, 0x9E, 0x3A, 0xB6, 0xE5, 0x02, 0x20, 0x33, 0x30, 0x32, 0x3A, 0x20, 0x5B,
|
||||
0x73, 0xFF, 0xFF, 0xCB, 0xDF, 0xB7, 0xA7, 0xB5, 0x67, 0x77, 0x77, 0xE4, 0xFF, 0xFD, 0x77, 0xFF});
|
||||
@@ -1440,14 +1516,14 @@ void Test::run_test(uuid::console::Shell & shell, const std::string & cmd, const
|
||||
|
||||
// https://github.com/emsesp/EMS-ESP/issues/380#issuecomment-633663007
|
||||
if (command == "rx3") {
|
||||
shell.printfln(F("Testing rx3..."));
|
||||
shell.printfln("Testing rx3...");
|
||||
|
||||
uart_telegram({0x21, 0x0B, 0xFF, 0x00});
|
||||
}
|
||||
|
||||
// testing the UART tx command, without a queue
|
||||
if (command == "tx2") {
|
||||
shell.printfln(F("Testing tx2..."));
|
||||
shell.printfln("Testing tx2...");
|
||||
|
||||
uint8_t t[] = {0x0B, 0x88, 0x18, 0x00, 0x20, 0xD4}; // including CRC
|
||||
EMSuart::transmit(t, sizeof(t));
|
||||
@@ -1455,14 +1531,14 @@ void Test::run_test(uuid::console::Shell & shell, const std::string & cmd, const
|
||||
|
||||
// send read request with offset
|
||||
if (command == "offset") {
|
||||
shell.printfln(F("Testing offset..."));
|
||||
shell.printfln("Testing offset...");
|
||||
|
||||
// send_read_request(0x18, 0x08);
|
||||
EMSESP::txservice_.read_request(0x18, 0x08, 27); // no offset
|
||||
}
|
||||
|
||||
if (command == "mixer") {
|
||||
shell.printfln(F("Testing Mixer..."));
|
||||
shell.printfln("Testing Mixer...");
|
||||
|
||||
run_test("mixer");
|
||||
|
||||
@@ -1473,19 +1549,41 @@ void Test::run_test(uuid::console::Shell & shell, const std::string & cmd, const
|
||||
shell.invoke_command("call mixer info");
|
||||
shell.invoke_command("call system publish");
|
||||
shell.invoke_command("show mqtt");
|
||||
|
||||
// shell.invoke_command("call mixer wwc1 info");
|
||||
// shell.invoke_command("call mixer wwc2 info");
|
||||
|
||||
// test API
|
||||
#if defined(EMSESP_STANDALONE)
|
||||
AsyncWebServerRequest request;
|
||||
request.url("/api/mixer");
|
||||
EMSESP::webAPIService.webAPIService_get(&request);
|
||||
request.url("/api/mixer/hc1/pumpstatus");
|
||||
EMSESP::webAPIService.webAPIService_get(&request);
|
||||
request.url("/api/mixer/wwc2/pumpstatus");
|
||||
EMSESP::webAPIService.webAPIService_get(&request);
|
||||
#endif
|
||||
}
|
||||
|
||||
if (command == "crash") {
|
||||
shell.printfln(F("Forcing a crash..."));
|
||||
shell.printfln("Forcing a crash...");
|
||||
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wdiv-by-zero"
|
||||
#pragma GCC diagnostic ignored "-Wunused-variable"
|
||||
uint8_t a = 2 / 0;
|
||||
shell.printfln(F("Testing %s"), a);
|
||||
shell.printfln("Testing %s", a);
|
||||
|
||||
#pragma GCC diagnostic pop
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
if (command == "limited") {
|
||||
shell.printfln("Run a limited memory test...");
|
||||
|
||||
run_test("general");
|
||||
}
|
||||
}
|
||||
|
||||
// simulates a telegram in the Rx queue, but without the CRC which is added automatically
|
||||
|
||||
@@ -28,11 +28,11 @@ namespace emsesp {
|
||||
|
||||
// #define EMSESP_DEBUG_DEFAULT "thermostat"
|
||||
// #define EMSESP_DEBUG_DEFAULT "solar"
|
||||
// #define EMSESP_DEBUG_DEFAULT "mixer"
|
||||
#define EMSESP_DEBUG_DEFAULT "mixer"
|
||||
// #define EMSESP_DEBUG_DEFAULT "web"
|
||||
// #define EMSESP_DEBUG_DEFAULT "mqtt"
|
||||
// #define EMSESP_DEBUG_DEFAULT "general"
|
||||
#define EMSESP_DEBUG_DEFAULT "boiler"
|
||||
// #define EMSESP_DEBUG_DEFAULT "boiler"
|
||||
// #define EMSESP_DEBUG_DEFAULT "mqtt2"
|
||||
// #define EMSESP_DEBUG_DEFAULT "mqtt_nested"
|
||||
// #define EMSESP_DEBUG_DEFAULT "ha"
|
||||
@@ -51,6 +51,8 @@ namespace emsesp {
|
||||
// #define EMSESP_DEBUG_DEFAULT "api_values"
|
||||
// #define EMSESP_DEBUG_DEFAULT "mqtt_post"
|
||||
// #define EMSESP_DEBUG_DEFAULT "api_wwmode"
|
||||
// #define EMSESP_DEBUG_DEFAULT "custom"
|
||||
// #define EMSESP_DEBUG_DEFAULT "dump"
|
||||
|
||||
class Test {
|
||||
public:
|
||||
|
||||
@@ -82,11 +82,13 @@ void EMSuart::start(const uint8_t tx_mode, const uint8_t rx_gpio, const uint8_t
|
||||
.flow_ctrl = UART_HW_FLOWCTRL_DISABLE,
|
||||
.source_clk = UART_SCLK_APB,
|
||||
};
|
||||
uart_driver_install(EMSUART_NUM, 129, 0, (EMS_MAXBUFFERSIZE + 1) * 2, &uart_queue, 0); // buffer must be > fifo
|
||||
uart_param_config(EMSUART_NUM, &uart_config);
|
||||
uart_set_pin(EMSUART_NUM, tx_gpio, rx_gpio, UART_PIN_NO_CHANGE, UART_PIN_NO_CHANGE);
|
||||
uart_driver_install(EMSUART_NUM, 129, 0, (EMS_MAXBUFFERSIZE + 1) * 2, &uart_queue, 0); // buffer must be > fifo
|
||||
uart_set_rx_full_threshold(EMSUART_NUM, 1);
|
||||
uart_set_rx_timeout(EMSUART_NUM, 0); // disable
|
||||
|
||||
// note setting the static max buffer to 1024 causes OTA to fail
|
||||
xTaskCreate(uart_event_task, "uart_event_task", 2048, NULL, configMAX_PRIORITIES - 1, NULL);
|
||||
}
|
||||
tx_mode_ = tx_mode;
|
||||
@@ -99,6 +101,7 @@ void EMSuart::start(const uint8_t tx_mode, const uint8_t rx_gpio, const uint8_t
|
||||
void EMSuart::stop() {
|
||||
if (tx_mode_ != 0xFF) { // only call after driver initialisation
|
||||
uart_disable_intr_mask(EMSUART_NUM, UART_BRK_DET_INT_ENA | UART_RXFIFO_FULL_INT_ENA);
|
||||
// TODO should we xTaskSuspend() the event task here?
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -26,8 +26,7 @@
|
||||
|
||||
#define EMS_MAXBUFFERSIZE 33 // max size of the buffer. EMS packets are max 32 bytes, plus extra for BRK
|
||||
|
||||
#define EMSUART_NUM UART_NUM_2 // on the ESP32 we're using UART2
|
||||
#define EMSUART UART2 // for intr setting
|
||||
#define EMSUART_NUM UART_NUM_1 // on C3 and S2 there is no UART2, use UART1 for all
|
||||
#define EMSUART_BAUD 9600 // uart baud rate for the EMS circuit
|
||||
|
||||
#define EMS_TXMODE_DEFAULT 1
|
||||
|
||||
@@ -1 +1 @@
|
||||
#define EMSESP_APP_VERSION "3.4.4"
|
||||
#define EMSESP_APP_VERSION "3.5.0"
|
||||
|
||||
@@ -101,8 +101,14 @@ void WebAPIService::parse(AsyncWebServerRequest * request, JsonObject & input) {
|
||||
}
|
||||
|
||||
// output json buffer
|
||||
auto * response = new PrettyAsyncJsonResponse(false, EMSESP_JSON_SIZE_XXLARGE_DYN);
|
||||
JsonObject output = response->getRoot();
|
||||
size_t buffer = EMSESP_JSON_SIZE_XXLARGE_DYN;
|
||||
auto * response = new PrettyAsyncJsonResponse(false, buffer);
|
||||
while (!response->getSize()) {
|
||||
delete response;
|
||||
buffer -= 1024;
|
||||
response = new PrettyAsyncJsonResponse(false, buffer);
|
||||
}
|
||||
JsonObject output = response->getRoot();
|
||||
|
||||
// call command
|
||||
uint8_t return_code = Command::process(request->url().c_str(), is_admin, input, output);
|
||||
@@ -117,7 +123,7 @@ void WebAPIService::parse(AsyncWebServerRequest * request, JsonObject & input) {
|
||||
emsesp::EMSESP::logger().err(error);
|
||||
api_fails_++;
|
||||
} else {
|
||||
// emsesp::EMSESP::logger().debug(F("API command called successfully"));
|
||||
// emsesp::EMSESP::logger().debug("API command called successfully");
|
||||
// if there was no json output from the call, default to the output message 'OK'.
|
||||
if (!output.size()) {
|
||||
output["message"] = "OK";
|
||||
@@ -136,10 +142,10 @@ void WebAPIService::parse(AsyncWebServerRequest * request, JsonObject & input) {
|
||||
|
||||
// send the json that came back from the command call
|
||||
// FAIL, OK, NOT_FOUND, ERROR, NOT_ALLOWED = 400 (bad request), 200 (OK), 400 (not found), 400 (bad request), 401 (unauthorized)
|
||||
int ret_codes[5] = {400, 200, 400, 400, 401};
|
||||
int ret_codes[6] = {400, 200, 400, 400, 401, 400};
|
||||
response->setCode(ret_codes[return_code]);
|
||||
response->setLength();
|
||||
response->setContentType("application/json");
|
||||
response->setContentType("application/json; charset=utf-8");
|
||||
request->send(response);
|
||||
api_count_++;
|
||||
|
||||
|
||||
@@ -31,8 +31,8 @@ WebCustomizationService::WebCustomizationService(AsyncWebServer * server, FS * f
|
||||
securityManager,
|
||||
AuthenticationPredicates::IS_AUTHENTICATED)
|
||||
, _fsPersistence(WebCustomization::read, WebCustomization::update, this, fs, EMSESP_CUSTOMIZATION_FILE)
|
||||
, _masked_entities_handler(MASKED_ENTITIES_PATH,
|
||||
securityManager->wrapCallback(std::bind(&WebCustomizationService::masked_entities, this, _1, _2),
|
||||
, _masked_entities_handler(CUSTOM_ENTITIES_PATH,
|
||||
securityManager->wrapCallback(std::bind(&WebCustomizationService::custom_entities, this, _1, _2),
|
||||
AuthenticationPredicates::IS_AUTHENTICATED))
|
||||
, _device_entities_handler(DEVICE_ENTITIES_PATH,
|
||||
securityManager->wrapCallback(std::bind(&WebCustomizationService::device_entities, this, _1, _2),
|
||||
@@ -46,8 +46,8 @@ WebCustomizationService::WebCustomizationService(AsyncWebServer * server, FS * f
|
||||
securityManager->wrapRequest(std::bind(&WebCustomizationService::reset_customization, this, _1), AuthenticationPredicates::IS_ADMIN));
|
||||
|
||||
_masked_entities_handler.setMethod(HTTP_POST);
|
||||
_masked_entities_handler.setMaxContentLength(4096);
|
||||
_masked_entities_handler.setMaxJsonBufferSize(4096);
|
||||
_masked_entities_handler.setMaxContentLength(2048);
|
||||
_masked_entities_handler.setMaxJsonBufferSize(2048);
|
||||
server->addHandler(&_masked_entities_handler);
|
||||
|
||||
_device_entities_handler.setMethod(HTTP_POST);
|
||||
@@ -85,6 +85,7 @@ void WebCustomization::read(WebCustomization & settings, JsonObject & root) {
|
||||
entityJson["product_id"] = entityCustomization.product_id;
|
||||
entityJson["device_id"] = entityCustomization.device_id;
|
||||
|
||||
// entries are in the form <XX><shortname>[|optional customname] e.g "08heatingactive|heating is on"
|
||||
JsonArray masked_entityJson = entityJson.createNestedArray("entity_ids");
|
||||
for (std::string entity_id : entityCustomization.entity_ids) {
|
||||
masked_entityJson.add(entity_id);
|
||||
@@ -95,11 +96,26 @@ void WebCustomization::read(WebCustomization & settings, JsonObject & root) {
|
||||
// call on initialization and also when the page is saved via web UI
|
||||
// this loads the data into the internal class
|
||||
StateUpdateResult WebCustomization::update(JsonObject & root, WebCustomization & settings) {
|
||||
#ifdef EMSESP_STANDALONE
|
||||
// invoke some fake data for testing
|
||||
const char * json = "{\"sensors\":[],\"analogs\":[],\"masked_entities\":[{\"product_id\":123,\"device_id\":8,\"entity_ids\":[\"08heatingactive|my custom "
|
||||
"name for heating active\",\"08tapwateractive\"]}]}";
|
||||
|
||||
StaticJsonDocument<500> doc;
|
||||
deserializeJson(doc, json);
|
||||
root = doc.as<JsonObject>();
|
||||
|
||||
Serial.println(COLOR_BRIGHT_MAGENTA);
|
||||
Serial.print("Using custom file: ");
|
||||
serializeJson(root, Serial);
|
||||
Serial.println(COLOR_RESET);
|
||||
#endif
|
||||
|
||||
// Dallas Sensor customization
|
||||
settings.sensorCustomizations.clear();
|
||||
if (root["sensors"].is<JsonArray>()) {
|
||||
for (const JsonObject sensorJson : root["sensors"].as<JsonArray>()) {
|
||||
// create each of the sensor, overwritting any previous settings
|
||||
// create each of the sensor, overwriting any previous settings
|
||||
auto sensor = SensorCustomization();
|
||||
sensor.id = sensorJson["id"].as<std::string>();
|
||||
sensor.name = sensorJson["name"].as<std::string>();
|
||||
@@ -112,7 +128,7 @@ StateUpdateResult WebCustomization::update(JsonObject & root, WebCustomization &
|
||||
settings.analogCustomizations.clear();
|
||||
if (root["analogs"].is<JsonArray>()) {
|
||||
for (const JsonObject analogJson : root["analogs"].as<JsonArray>()) {
|
||||
// create each of the sensor, overwritting any previous settings
|
||||
// create each of the sensor, overwriting any previous settings
|
||||
auto sensor = AnalogCustomization();
|
||||
sensor.gpio = analogJson["gpio"];
|
||||
sensor.name = analogJson["name"].as<std::string>();
|
||||
@@ -160,7 +176,7 @@ void WebCustomizationService::reset_customization(AsyncWebServerRequest * reques
|
||||
#endif
|
||||
}
|
||||
|
||||
// send back a list of devices used to the customization web page
|
||||
// send back a list of devices used in the customization web page
|
||||
void WebCustomizationService::devices(AsyncWebServerRequest * request) {
|
||||
auto * response = new AsyncJsonResponse(false, EMSESP_JSON_SIZE_LARGE_DYN);
|
||||
JsonObject root = response->getRoot();
|
||||
@@ -171,21 +187,10 @@ void WebCustomizationService::devices(AsyncWebServerRequest * request) {
|
||||
for (const auto & emsdevice : EMSESP::emsdevices) {
|
||||
if (emsdevice->has_entities()) {
|
||||
JsonObject obj = devices.createNestedObject();
|
||||
obj["i"] = emsdevice->unique_id(); // its unique id
|
||||
obj["s"] = emsdevice->device_type_name() + " (" + emsdevice->name() + ")"; // shortname
|
||||
|
||||
// device type name. We may have one than one (e.g. multiple thermostats) so postfix name with index
|
||||
// code block not needed - see https://github.com/emsesp/EMS-ESP32/pull/586#issuecomment-1193779668
|
||||
/*
|
||||
uint8_t device_index = EMSESP::device_index(emsdevice->device_type(), emsdevice->unique_id());
|
||||
if (device_index) {
|
||||
char s[10];
|
||||
obj["t"] = Helpers::toLower(emsdevice->device_type_name()) + Helpers::smallitoa(s, device_index);
|
||||
} else {
|
||||
obj["t"] = Helpers::toLower(emsdevice->device_type_name());
|
||||
}
|
||||
*/
|
||||
obj["t"] = Helpers::toLower(emsdevice->device_type_name());
|
||||
obj["i"] = emsdevice->unique_id(); // its unique id
|
||||
obj["s"] = std::string(emsdevice->device_type_2_device_name_translated()) + " (" + emsdevice->name() + ")"; // shortname, is device type translated
|
||||
obj["tn"] = emsdevice->device_type_name(); // non-translated, lower-case
|
||||
obj["t"] = emsdevice->device_type(); // internal device type ID
|
||||
}
|
||||
}
|
||||
|
||||
@@ -196,14 +201,25 @@ void WebCustomizationService::devices(AsyncWebServerRequest * request) {
|
||||
// send back list of device entities
|
||||
void WebCustomizationService::device_entities(AsyncWebServerRequest * request, JsonVariant & json) {
|
||||
if (json.is<JsonObject>()) {
|
||||
auto * response = new MsgpackAsyncJsonResponse(true, EMSESP_JSON_SIZE_XXXLARGE_DYN);
|
||||
size_t buffer = EMSESP_JSON_SIZE_XXXLARGE_DYN;
|
||||
auto * response = new MsgpackAsyncJsonResponse(true, buffer);
|
||||
while (!response->getSize()) {
|
||||
delete response;
|
||||
buffer -= 1024;
|
||||
response = new MsgpackAsyncJsonResponse(true, buffer);
|
||||
}
|
||||
for (const auto & emsdevice : EMSESP::emsdevices) {
|
||||
if (emsdevice->unique_id() == json["id"]) {
|
||||
#ifndef EMSESP_STANDALONE
|
||||
JsonArray output = response->getRoot();
|
||||
emsdevice->generate_values_web_customization(output);
|
||||
#endif
|
||||
#if defined(EMSESP_DEBUG)
|
||||
size_t length = response->setLength();
|
||||
EMSESP::logger().debug("Customization buffer used: %d", length);
|
||||
#else
|
||||
response->setLength();
|
||||
#endif
|
||||
request->send(response);
|
||||
return;
|
||||
}
|
||||
@@ -218,7 +234,8 @@ void WebCustomizationService::device_entities(AsyncWebServerRequest * request, J
|
||||
// takes a list of updated entities with new masks from the web UI
|
||||
// saves it in the customization service
|
||||
// and updates the entity list real-time
|
||||
void WebCustomizationService::masked_entities(AsyncWebServerRequest * request, JsonVariant & json) {
|
||||
void WebCustomizationService::custom_entities(AsyncWebServerRequest * request, JsonVariant & json) {
|
||||
bool need_reboot = false;
|
||||
if (json.is<JsonObject>()) {
|
||||
// find the device using the unique_id
|
||||
for (const auto & emsdevice : EMSESP::emsdevices) {
|
||||
@@ -228,11 +245,47 @@ void WebCustomizationService::masked_entities(AsyncWebServerRequest * request, J
|
||||
uint8_t product_id = emsdevice->product_id();
|
||||
uint8_t device_id = emsdevice->device_id();
|
||||
|
||||
// and set the mask immediately for the changed entities
|
||||
JsonArray entity_ids_json = json["entity_ids"];
|
||||
// and set the mask and custom names immediately for any listed entities
|
||||
JsonArray entity_ids_json = json["entity_ids"];
|
||||
std::vector<std::string> entity_ids;
|
||||
for (const JsonVariant id : entity_ids_json) {
|
||||
emsdevice->mask_entity(id.as<std::string>());
|
||||
std::string id_s = id.as<std::string>();
|
||||
if (id_s[0] == '8') {
|
||||
entity_ids.push_back(id_s);
|
||||
need_reboot = true;
|
||||
} else {
|
||||
emsdevice->setCustomEntity(id_s);
|
||||
}
|
||||
// emsesp::EMSESP::logger().info(id.as<const char *>());
|
||||
}
|
||||
// add deleted entities from file
|
||||
EMSESP::webCustomizationService.read([&](WebCustomization & settings) {
|
||||
for (EntityCustomization entityCustomization : settings.entityCustomizations) {
|
||||
if (entityCustomization.device_id == device_id) {
|
||||
for (std::string entity_id : entityCustomization.entity_ids) {
|
||||
uint8_t mask = Helpers::hextoint(entity_id.substr(0, 2).c_str());
|
||||
std::string name = DeviceValue::get_name(entity_id);
|
||||
if (mask & 0x80) {
|
||||
bool is_set = false;
|
||||
for (const JsonVariant id : entity_ids_json) {
|
||||
std::string id_s = id.as<std::string>();
|
||||
if (name == DeviceValue::get_name(id_s)) {
|
||||
is_set = true;
|
||||
need_reboot = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!is_set) {
|
||||
entity_ids.push_back(entity_id);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
});
|
||||
// get list of entities that have masks set or a custom fullname
|
||||
emsdevice->getCustomEntities(entity_ids);
|
||||
|
||||
// Save the list to the customization file
|
||||
EMSESP::webCustomizationService.update(
|
||||
@@ -247,18 +300,11 @@ void WebCustomizationService::masked_entities(AsyncWebServerRequest * request, J
|
||||
}
|
||||
}
|
||||
|
||||
if (!entity_ids_json.size()) {
|
||||
return StateUpdateResult::UNCHANGED; // nothing to add
|
||||
}
|
||||
|
||||
// create a new entry for this device if there are values
|
||||
EntityCustomization new_entry;
|
||||
new_entry.product_id = product_id;
|
||||
new_entry.device_id = device_id;
|
||||
|
||||
// get list of entities that have masks
|
||||
std::vector<std::string> entity_ids;
|
||||
emsdevice->getMaskedEntities(entity_ids);
|
||||
new_entry.entity_ids = entity_ids;
|
||||
|
||||
// add the record and save
|
||||
@@ -273,7 +319,7 @@ void WebCustomizationService::masked_entities(AsyncWebServerRequest * request, J
|
||||
}
|
||||
}
|
||||
|
||||
AsyncWebServerResponse * response = request->beginResponse(200); // OK
|
||||
AsyncWebServerResponse * response = request->beginResponse(need_reboot ? 201 : 200); // OK
|
||||
request->send(response);
|
||||
}
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
|
||||
// POST
|
||||
#define DEVICE_ENTITIES_PATH "/rest/deviceEntities"
|
||||
#define MASKED_ENTITIES_PATH "/rest/maskedEntities"
|
||||
#define CUSTOM_ENTITIES_PATH "/rest/customEntities"
|
||||
#define RESET_CUSTOMIZATION_SERVICE_PATH "/rest/resetCustomizations"
|
||||
|
||||
namespace emsesp {
|
||||
@@ -44,8 +44,8 @@ class AnalogCustomization {
|
||||
public:
|
||||
uint8_t gpio;
|
||||
std::string name;
|
||||
float offset;
|
||||
float factor;
|
||||
double offset;
|
||||
double factor;
|
||||
uint8_t uom; // 0 is none
|
||||
int8_t type; // -1 is for deletion
|
||||
|
||||
@@ -63,7 +63,7 @@ class EntityCustomization {
|
||||
public:
|
||||
uint8_t product_id; // device's product id
|
||||
uint8_t device_id; // device's device id
|
||||
std::vector<std::string> entity_ids; // array of entity ids with masks
|
||||
std::vector<std::string> entity_ids; // array of entity ids with masks and optional custom fullname
|
||||
};
|
||||
|
||||
class WebCustomization {
|
||||
@@ -93,7 +93,7 @@ class WebCustomizationService : public StatefulService<WebCustomization> {
|
||||
void devices(AsyncWebServerRequest * request);
|
||||
|
||||
// POST
|
||||
void masked_entities(AsyncWebServerRequest * request, JsonVariant & json);
|
||||
void custom_entities(AsyncWebServerRequest * request, JsonVariant & json);
|
||||
void device_entities(AsyncWebServerRequest * request, JsonVariant & json);
|
||||
void reset_customization(AsyncWebServerRequest * request);
|
||||
|
||||
|
||||
@@ -62,7 +62,7 @@ WebDataService::WebDataService(AsyncWebServer * server, SecurityManager * securi
|
||||
|
||||
// scan devices service
|
||||
void WebDataService::scan_devices(AsyncWebServerRequest * request) {
|
||||
EMSESP::logger().info(F("Scanning devices..."));
|
||||
EMSESP::logger().info("Scanning devices...");
|
||||
EMSESP::scan_devices();
|
||||
request->send(200);
|
||||
}
|
||||
@@ -81,7 +81,8 @@ void WebDataService::core_data(AsyncWebServerRequest * request) {
|
||||
if (emsdevice && (emsdevice->device_type() != EMSdevice::DeviceType::CONTROLLER || emsdevice->count_entities() > 0)) {
|
||||
JsonObject obj = devices.createNestedObject();
|
||||
obj["id"] = Helpers::smallitoa(buffer, emsdevice->unique_id()); // a unique id as a string
|
||||
obj["t"] = emsdevice->device_type_name(); // type
|
||||
obj["tn"] = emsdevice->device_type_2_device_name_translated(); // translated device type name
|
||||
obj["t"] = emsdevice->device_type(); // device type number
|
||||
obj["b"] = emsdevice->brand_to_string(); // brand
|
||||
obj["n"] = emsdevice->name(); // name
|
||||
obj["d"] = emsdevice->device_id(); // deviceid
|
||||
@@ -92,6 +93,7 @@ void WebDataService::core_data(AsyncWebServerRequest * request) {
|
||||
}
|
||||
|
||||
// sensors stuff
|
||||
root["s_n"] = Helpers::translated_word(FL_(sensors_device));
|
||||
root["active_sensors"] = EMSESP::dallassensor_.no_sensors() + (EMSESP::analogsensor_.analog_enabled() ? EMSESP::analogsensor_.no_sensors() : 0);
|
||||
root["analog_enabled"] = EMSESP::analogsensor_.analog_enabled();
|
||||
root["connected"] = EMSESP::bus_status() != 2;
|
||||
@@ -149,7 +151,7 @@ void WebDataService::sensor_data(AsyncWebServerRequest * request) {
|
||||
obj["t"] = sensor.type();
|
||||
|
||||
if (sensor.type() != AnalogSensor::AnalogType::NOTUSED) {
|
||||
obj["v"] = Helpers::round2(sensor.value(), 0); // is optional and is a float
|
||||
obj["v"] = Helpers::transformNumFloat(sensor.value(), 0); // is optional and is a float
|
||||
} else {
|
||||
obj["v"] = 0; // must have a value for web sorting to work
|
||||
}
|
||||
@@ -165,7 +167,13 @@ void WebDataService::sensor_data(AsyncWebServerRequest * request) {
|
||||
// Compresses the JSON using MsgPack https://msgpack.org/index.html
|
||||
void WebDataService::device_data(AsyncWebServerRequest * request, JsonVariant & json) {
|
||||
if (json.is<JsonObject>()) {
|
||||
auto * response = new MsgpackAsyncJsonResponse(false, EMSESP_JSON_SIZE_XXXLARGE_DYN);
|
||||
size_t buffer = EMSESP_JSON_SIZE_XXXLARGE_DYN;
|
||||
auto * response = new MsgpackAsyncJsonResponse(false, buffer);
|
||||
while (!response->getSize()) {
|
||||
delete response;
|
||||
buffer -= 1024;
|
||||
response = new MsgpackAsyncJsonResponse(false, buffer);
|
||||
}
|
||||
for (const auto & emsdevice : EMSESP::emsdevices) {
|
||||
if (emsdevice->unique_id() == json["id"]) {
|
||||
// wait max 2.5 sec for updated data (post_send_delay is 2 sec)
|
||||
@@ -184,7 +192,12 @@ void WebDataService::device_data(AsyncWebServerRequest * request, JsonVariant &
|
||||
// #endif
|
||||
// #endif
|
||||
|
||||
#if defined(EMSESP_DEBUG)
|
||||
size_t length = response->setLength();
|
||||
EMSESP::logger().debug("Dashboard buffer used: %d", length);
|
||||
#else
|
||||
response->setLength();
|
||||
#endif
|
||||
request->send(response);
|
||||
return;
|
||||
}
|
||||
@@ -236,9 +249,9 @@ void WebDataService::write_value(AsyncWebServerRequest * request, JsonVariant &
|
||||
|
||||
// write debug
|
||||
if (return_code != CommandRet::OK) {
|
||||
EMSESP::logger().err(F("Write command failed %s (%s)"), (const char *)output["message"], Command::return_code_string(return_code).c_str());
|
||||
EMSESP::logger().err("Write command failed %s (%s)", (const char *)output["message"], Command::return_code_string(return_code).c_str());
|
||||
} else {
|
||||
EMSESP::logger().debug(F("Write command successful"));
|
||||
EMSESP::logger().debug("Write command successful");
|
||||
}
|
||||
|
||||
response->setCode((return_code == CommandRet::OK) ? 200 : 204);
|
||||
@@ -284,8 +297,8 @@ void WebDataService::write_analog(AsyncWebServerRequest * request, JsonVariant &
|
||||
|
||||
uint8_t gpio = analog["gpio"]; // this is the unique key, the GPIO
|
||||
std::string name = analog["name"];
|
||||
float factor = analog["factor"];
|
||||
float offset = analog["offset"];
|
||||
double factor = analog["factor"];
|
||||
double offset = analog["offset"];
|
||||
uint8_t uom = analog["uom"];
|
||||
int8_t type = analog["type"];
|
||||
ok = EMSESP::analogsensor_.update(gpio, name, offset, factor, uom, type);
|
||||
|
||||
@@ -54,8 +54,12 @@ void WebLogService::begin() {
|
||||
void WebLogService::start() {
|
||||
EMSESP::webSettingsService.read([&](WebSettings & settings) {
|
||||
maximum_log_messages_ = settings.weblog_buffer;
|
||||
limit_log_messages_ = maximum_log_messages_;
|
||||
compact_ = settings.weblog_compact;
|
||||
uuid::log::Logger::register_handler(this, (uuid::log::Level)settings.weblog_level);
|
||||
if ((uuid::log::Level)settings.weblog_level == uuid::log::Level::OFF) {
|
||||
log_messages_.clear();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -71,6 +75,13 @@ void WebLogService::log_level(uuid::log::Level level) {
|
||||
},
|
||||
"local");
|
||||
uuid::log::Logger::register_handler(this, level);
|
||||
if (level == uuid::log::Level::OFF) {
|
||||
log_messages_.clear();
|
||||
}
|
||||
}
|
||||
|
||||
size_t WebLogService::num_log_messages() const {
|
||||
return log_messages_.size();
|
||||
}
|
||||
|
||||
size_t WebLogService::maximum_log_messages() const {
|
||||
@@ -79,6 +90,9 @@ size_t WebLogService::maximum_log_messages() const {
|
||||
|
||||
void WebLogService::maximum_log_messages(size_t count) {
|
||||
maximum_log_messages_ = std::max((size_t)1, count);
|
||||
if (limit_log_messages_ > maximum_log_messages_) {
|
||||
limit_log_messages_ = maximum_log_messages_;
|
||||
}
|
||||
while (log_messages_.size() > maximum_log_messages_) {
|
||||
log_messages_.pop_front();
|
||||
}
|
||||
@@ -110,7 +124,15 @@ WebLogService::QueuedLogMessage::QueuedLogMessage(unsigned long id, std::shared_
|
||||
}
|
||||
|
||||
void WebLogService::operator<<(std::shared_ptr<uuid::log::Message> message) {
|
||||
if (log_messages_.size() >= maximum_log_messages_) {
|
||||
#ifndef EMSESP_STANDALONE
|
||||
size_t maxAlloc = ESP.getMaxAllocHeap();
|
||||
if (limit_log_messages_ > 5 && maxAlloc < 46080) {
|
||||
--limit_log_messages_;
|
||||
} else if (limit_log_messages_ < maximum_log_messages_ && maxAlloc > 51200) {
|
||||
++limit_log_messages_;
|
||||
}
|
||||
#endif
|
||||
while (log_messages_.size() >= limit_log_messages_) {
|
||||
log_messages_.pop_front();
|
||||
}
|
||||
|
||||
@@ -190,9 +212,16 @@ void WebLogService::transmit(const QueuedLogMessage & message) {
|
||||
|
||||
// send the complete log buffer to the API, not filtering on log level
|
||||
void WebLogService::fetchLog(AsyncWebServerRequest * request) {
|
||||
auto * response = new MsgpackAsyncJsonResponse(false, EMSESP_JSON_SIZE_LARGE_DYN + 192 * log_messages_.size());
|
||||
JsonObject root = response->getRoot();
|
||||
JsonArray log = root.createNestedArray("events");
|
||||
// auto * response = new MsgpackAsyncJsonResponse(false, EMSESP_JSON_SIZE_LARGE_DYN + 192 * log_messages_.size());
|
||||
size_t buffer = EMSESP_JSON_SIZE_XLARGE_DYN + 192 * log_messages_.size();
|
||||
auto * response = new MsgpackAsyncJsonResponse(false, buffer);
|
||||
while (!response->getSize()) {
|
||||
delete response;
|
||||
buffer -= 1024;
|
||||
response = new MsgpackAsyncJsonResponse(false, buffer);
|
||||
}
|
||||
JsonObject root = response->getRoot();
|
||||
JsonArray log = root.createNestedArray("events");
|
||||
|
||||
log_message_id_tail_ = log_messages_.back().id_;
|
||||
last_transmit_ = uuid::get_uptime_ms();
|
||||
|
||||
@@ -37,6 +37,7 @@ class WebLogService : public uuid::log::Handler {
|
||||
uuid::log::Level log_level() const;
|
||||
void log_level(uuid::log::Level level);
|
||||
size_t maximum_log_messages() const;
|
||||
size_t num_log_messages() const;
|
||||
void maximum_log_messages(size_t count);
|
||||
bool compact() const;
|
||||
void compact(bool compact);
|
||||
@@ -68,13 +69,14 @@ class WebLogService : public uuid::log::Handler {
|
||||
|
||||
AsyncCallbackJsonWebHandler setValues_; // for POSTs
|
||||
|
||||
uint64_t last_transmit_ = 0; // Last transmit time
|
||||
size_t maximum_log_messages_ = MAX_LOG_MESSAGES; // Maximum number of log messages to buffer before they are output
|
||||
unsigned long log_message_id_ = 0; // The next identifier to use for queued log messages
|
||||
unsigned long log_message_id_tail_ = 0; // last event shown on the screen after fetch
|
||||
std::list<QueuedLogMessage> log_messages_; // Queued log messages, in the order they were received
|
||||
time_t time_offset_ = 0;
|
||||
bool compact_ = true;
|
||||
uint64_t last_transmit_ = 0; // Last transmit time
|
||||
size_t maximum_log_messages_ = MAX_LOG_MESSAGES; // Maximum number of log messages to buffer before they are output
|
||||
size_t limit_log_messages_ = 1; // dynamic limit
|
||||
unsigned long log_message_id_ = 0; // The next identifier to use for queued log messages
|
||||
unsigned long log_message_id_tail_ = 0; // last event shown on the screen after fetch
|
||||
std::deque<QueuedLogMessage> log_messages_; // Queued log messages, in the order they were received
|
||||
time_t time_offset_ = 0;
|
||||
bool compact_ = true;
|
||||
};
|
||||
|
||||
} // namespace emsesp
|
||||
|
||||
@@ -37,6 +37,8 @@ WebSettingsService::WebSettingsService(AsyncWebServer * server, FS * fs, Securit
|
||||
}
|
||||
|
||||
void WebSettings::read(WebSettings & settings, JsonObject & root) {
|
||||
root["version"] = settings.version;
|
||||
root["locale"] = settings.locale;
|
||||
root["tx_mode"] = settings.tx_mode;
|
||||
root["ems_bus_id"] = settings.ems_bus_id;
|
||||
root["syslog_enabled"] = settings.syslog_enabled;
|
||||
@@ -74,15 +76,50 @@ void WebSettings::read(WebSettings & settings, JsonObject & root) {
|
||||
root["eth_power"] = settings.eth_power;
|
||||
root["eth_phy_addr"] = settings.eth_phy_addr;
|
||||
root["eth_clock_mode"] = settings.eth_clock_mode;
|
||||
root["platform"] = EMSESP_PLATFORM;
|
||||
}
|
||||
|
||||
// call on initialization and also when settings are updated via web or console
|
||||
StateUpdateResult WebSettings::update(JsonObject & root, WebSettings & settings) {
|
||||
// load the version of the settings
|
||||
// will be picked up in System::check_upgrade()
|
||||
settings.version = root["version"] | EMSESP_DEFAULT_VERSION;
|
||||
|
||||
// load default GPIO configuration based on board profile
|
||||
std::vector<int8_t> data; // // led, dallas, rx, tx, button, phy_type, eth_power, eth_phy_addr, eth_clock_mode
|
||||
#if CONFIG_IDF_TARGET_ESP32C3
|
||||
settings.board_profile = root["board_profile"] | "C3MINI";
|
||||
#elif CONFIG_IDF_TARGET_ESP32S2
|
||||
settings.board_profile = root["board_profile"] | "S2MINI";
|
||||
#elif CONFIG_IDF_TARGET_ESP32S3
|
||||
settings.board_profile = root["board_profile"] | "S3MINI";
|
||||
#elif CONFIG_IDF_TARGET_ESP32
|
||||
settings.board_profile = root["board_profile"] | EMSESP_DEFAULT_BOARD_PROFILE;
|
||||
#endif
|
||||
|
||||
if (!System::load_board_profile(data, settings.board_profile.c_str())) {
|
||||
settings.board_profile = "CUSTOM";
|
||||
// unknown, check for ethernet, use default E32/S32
|
||||
// data is led, dallas, rx, tx, pbutton, phy, eth_power, eth_addr, eth_clock
|
||||
#ifndef EMSESP_STANDALONE
|
||||
if (ETH.begin(1, 16, 23, 18, ETH_PHY_LAN8720)) {
|
||||
// BBQKees Gateway E32
|
||||
data = {EMSESP_DEFAULT_LED_GPIO, 4, 5, 17, 33, PHY_type::PHY_TYPE_LAN8720, 16, 1, 0};
|
||||
settings.board_profile = "E32";
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
// BBQKees Gateway S32
|
||||
data = {EMSESP_DEFAULT_LED_GPIO,
|
||||
EMSESP_DEFAULT_DALLAS_GPIO,
|
||||
EMSESP_DEFAULT_RX_GPIO,
|
||||
EMSESP_DEFAULT_TX_GPIO,
|
||||
EMSESP_DEFAULT_PBUTTON_GPIO,
|
||||
EMSESP_DEFAULT_PHY_TYPE,
|
||||
0,
|
||||
0,
|
||||
0};
|
||||
settings.board_profile = "S32";
|
||||
}
|
||||
EMSESP::logger().info("No board profile found. Re-setting to %s", settings.board_profile.c_str());
|
||||
} else {
|
||||
EMSESP::logger().info("Loading board profile %s", settings.board_profile.c_str());
|
||||
@@ -203,8 +240,32 @@ StateUpdateResult WebSettings::update(JsonObject & root, WebSettings & settings)
|
||||
settings.low_clock = root["low_clock"] | false;
|
||||
check_flag(prev, settings.low_clock, ChangeFlags::RESTART);
|
||||
|
||||
String old_local = settings.locale;
|
||||
settings.locale = root["locale"] | EMSESP_DEFAULT_LOCALE;
|
||||
EMSESP::system_.locale(settings.locale);
|
||||
#ifndef EMSESP_STANDALONE
|
||||
if (!old_local.equals(settings.locale)) {
|
||||
add_flags(ChangeFlags::RESTART); // force restart
|
||||
}
|
||||
#endif
|
||||
|
||||
//
|
||||
// without checks...
|
||||
// these may need mqtt restart to rebuild HA discovery topics
|
||||
//
|
||||
prev = settings.bool_format;
|
||||
settings.bool_format = root["bool_format"] | EMSESP_DEFAULT_BOOL_FORMAT;
|
||||
EMSESP::system_.bool_format(settings.bool_format);
|
||||
if (Mqtt::ha_enabled())
|
||||
check_flag(prev, settings.bool_format, ChangeFlags::MQTT);
|
||||
|
||||
prev = settings.enum_format;
|
||||
settings.enum_format = root["enum_format"] | EMSESP_DEFAULT_ENUM_FORMAT;
|
||||
EMSESP::system_.enum_format(settings.enum_format);
|
||||
if (Mqtt::ha_enabled())
|
||||
check_flag(prev, settings.enum_format, ChangeFlags::MQTT);
|
||||
|
||||
//
|
||||
// without checks or necessary restarts...
|
||||
//
|
||||
settings.trace_raw = root["trace_raw"] | EMSESP_DEFAULT_TRACELOG_RAW;
|
||||
EMSESP::trace_raw(settings.trace_raw);
|
||||
@@ -218,15 +279,9 @@ StateUpdateResult WebSettings::update(JsonObject & root, WebSettings & settings)
|
||||
settings.readonly_mode = root["readonly_mode"] | false;
|
||||
EMSESP::system_.readonly_mode(settings.readonly_mode);
|
||||
|
||||
settings.bool_format = root["bool_format"] | EMSESP_DEFAULT_BOOL_FORMAT;
|
||||
EMSESP::system_.bool_format(settings.bool_format);
|
||||
|
||||
settings.bool_dashboard = root["bool_dashboard"] | EMSESP_DEFAULT_BOOL_FORMAT;
|
||||
EMSESP::system_.bool_dashboard(settings.bool_dashboard);
|
||||
|
||||
settings.enum_format = root["enum_format"] | EMSESP_DEFAULT_ENUM_FORMAT;
|
||||
EMSESP::system_.enum_format(settings.enum_format);
|
||||
|
||||
settings.weblog_level = root["weblog_level"] | EMSESP_DEFAULT_WEBLOG_LEVEL;
|
||||
settings.weblog_buffer = root["weblog_buffer"] | EMSESP_DEFAULT_WEBLOG_BUFFER;
|
||||
settings.weblog_compact = root["weblog_compact"] | EMSESP_DEFAULT_WEBLOG_COMPACT;
|
||||
@@ -269,6 +324,10 @@ void WebSettingsService::onUpdate() {
|
||||
EMSESP::system_.led_init(true); // reload settings
|
||||
}
|
||||
|
||||
if (WebSettings::has_flags(WebSettings::ChangeFlags::MQTT)) {
|
||||
emsesp::Mqtt::reset_mqtt(); // reload MQTT, init HA etc
|
||||
}
|
||||
|
||||
WebSettings::reset_flags();
|
||||
}
|
||||
|
||||
@@ -311,4 +370,4 @@ void WebSettingsService::board_profile(AsyncWebServerRequest * request, JsonVari
|
||||
request->send(response);
|
||||
}
|
||||
|
||||
} // namespace emsesp
|
||||
} // namespace emsesp
|
||||
|
||||
@@ -29,6 +29,8 @@ namespace emsesp {
|
||||
|
||||
class WebSettings {
|
||||
public:
|
||||
String version;
|
||||
String locale;
|
||||
uint8_t tx_mode;
|
||||
uint8_t ems_bus_id;
|
||||
bool shower_timer;
|
||||
@@ -81,6 +83,7 @@ class WebSettings {
|
||||
SHOWER = (1 << 4), // 16
|
||||
LED = (1 << 5), // 32
|
||||
BUTTON = (1 << 6), // 64
|
||||
MQTT = (1 << 7), // 128
|
||||
RESTART = 0xFF
|
||||
|
||||
};
|
||||
|
||||
@@ -34,21 +34,21 @@ WebStatusService::WebStatusService(AsyncWebServer * server, SecurityManager * se
|
||||
void WebStatusService::WiFiEvent(WiFiEvent_t event, WiFiEventInfo_t info) {
|
||||
switch (event) {
|
||||
case ARDUINO_EVENT_WIFI_STA_DISCONNECTED:
|
||||
EMSESP::logger().warning(F("WiFi disconnected. Reason code=%d"), info.wifi_sta_disconnected.reason); // IDF 4.0
|
||||
EMSESP::logger().warning("WiFi disconnected. Reason code=%s", disconnectReason(info.wifi_sta_disconnected.reason)); // IDF 4.0
|
||||
WiFi.disconnect(true);
|
||||
break;
|
||||
|
||||
case ARDUINO_EVENT_WIFI_STA_GOT_IP:
|
||||
#ifndef EMSESP_STANDALONE
|
||||
EMSESP::logger().info(F("WiFi connected with IP=%s, hostname=%s"), WiFi.localIP().toString().c_str(), WiFi.getHostname());
|
||||
EMSESP::logger().info("WiFi connected with IP=%s, hostname=%s", WiFi.localIP().toString().c_str(), WiFi.getHostname());
|
||||
#endif
|
||||
// EMSESP::system_.send_heartbeat(); // send from mqtt start
|
||||
EMSESP::system_.syslog_init();
|
||||
mDNS_start();
|
||||
EMSESP::system_.send_info_mqtt("connected");
|
||||
break;
|
||||
|
||||
case ARDUINO_EVENT_ETH_START:
|
||||
// EMSESP::logger().info(F("Ethernet initialized"));
|
||||
// EMSESP::logger().info("Ethernet initialized");
|
||||
ETH.setHostname(EMSESP::system_.hostname().c_str());
|
||||
|
||||
// configure for static IP
|
||||
@@ -64,22 +64,23 @@ void WebStatusService::WiFiEvent(WiFiEvent_t event, WiFiEventInfo_t info) {
|
||||
// prevent double calls
|
||||
if (!EMSESP::system_.ethernet_connected()) {
|
||||
#ifndef EMSESP_STANDALONE
|
||||
EMSESP::logger().info(F("Ethernet connected with IP=%s, speed %d Mbps"), ETH.localIP().toString().c_str(), ETH.linkSpeed());
|
||||
EMSESP::logger().info("Ethernet connected with IP=%s, speed %d Mbps", ETH.localIP().toString().c_str(), ETH.linkSpeed());
|
||||
#endif
|
||||
// EMSESP::system_.send_heartbeat(); // send from mqtt start
|
||||
// EMSESP::system_.send_heartbeat();
|
||||
EMSESP::system_.syslog_init();
|
||||
EMSESP::system_.ethernet_connected(true);
|
||||
mDNS_start();
|
||||
EMSESP::system_.send_info_mqtt("connected");
|
||||
}
|
||||
break;
|
||||
|
||||
case ARDUINO_EVENT_ETH_DISCONNECTED:
|
||||
EMSESP::logger().warning(F("Ethernet disconnected"));
|
||||
EMSESP::logger().warning("Ethernet disconnected");
|
||||
EMSESP::system_.ethernet_connected(false);
|
||||
break;
|
||||
|
||||
case ARDUINO_EVENT_ETH_STOP:
|
||||
EMSESP::logger().info(F("Ethernet stopped"));
|
||||
EMSESP::logger().info("Ethernet stopped");
|
||||
EMSESP::system_.ethernet_connected(false);
|
||||
break;
|
||||
|
||||
@@ -103,13 +104,13 @@ void WebStatusService::WiFiEvent(WiFiEvent_t event, WiFiEventInfo_t info) {
|
||||
case ARDUINO_EVENT_WIFI_STA_GOT_IP6:
|
||||
case ARDUINO_EVENT_ETH_GOT_IP6:
|
||||
if (EMSESP::system_.ethernet_connected()) {
|
||||
EMSESP::logger().info(F("Ethernet connected with IPv6=%s, speed %d Mbps"), ETH.localIPv6().toString().c_str(), ETH.linkSpeed());
|
||||
EMSESP::logger().info("Ethernet connected with IPv6=%s, speed %d Mbps", ETH.localIPv6().toString().c_str(), ETH.linkSpeed());
|
||||
} else {
|
||||
EMSESP::logger().info(F("WiFi connected with IPv6=%s, hostname=%s"), WiFi.localIPv6().toString().c_str(), WiFi.getHostname());
|
||||
EMSESP::logger().info("WiFi connected with IPv6=%s, hostname=%s", WiFi.localIPv6().toString().c_str(), WiFi.getHostname());
|
||||
}
|
||||
// EMSESP::system_.send_heartbeat(); // send from mqtt start
|
||||
EMSESP::system_.syslog_init();
|
||||
mDNS_start();
|
||||
EMSESP::system_.send_info_mqtt("connected");
|
||||
break;
|
||||
#endif
|
||||
|
||||
@@ -133,47 +134,47 @@ void WebStatusService::webStatusService(AsyncWebServerRequest * request) {
|
||||
JsonObject statJson;
|
||||
|
||||
statJson = statsJson.createNestedObject();
|
||||
statJson["id"] = "EMS Telegrams Received (Rx)";
|
||||
statJson["id"] = "0";
|
||||
statJson["s"] = EMSESP::rxservice_.telegram_count();
|
||||
statJson["f"] = EMSESP::rxservice_.telegram_error_count();
|
||||
statJson["q"] = EMSESP::rxservice_.quality();
|
||||
|
||||
statJson = statsJson.createNestedObject();
|
||||
statJson["id"] = "EMS Reads (Tx)";
|
||||
statJson["id"] = "1";
|
||||
statJson["s"] = EMSESP::txservice_.telegram_read_count();
|
||||
statJson["f"] = EMSESP::txservice_.telegram_read_fail_count();
|
||||
statJson["q"] = EMSESP::txservice_.read_quality();
|
||||
|
||||
statJson = statsJson.createNestedObject();
|
||||
statJson["id"] = "EMS Writes (Tx)";
|
||||
statJson["id"] = "2";
|
||||
statJson["s"] = EMSESP::txservice_.telegram_write_count();
|
||||
statJson["f"] = EMSESP::txservice_.telegram_write_fail_count();
|
||||
statJson["q"] = EMSESP::txservice_.write_quality();
|
||||
|
||||
if (EMSESP::dallassensor_.dallas_enabled()) {
|
||||
statJson = statsJson.createNestedObject();
|
||||
statJson["id"] = "Temperature Sensor Reads";
|
||||
statJson["id"] = "3";
|
||||
statJson["s"] = EMSESP::dallassensor_.reads();
|
||||
statJson["f"] = EMSESP::dallassensor_.fails();
|
||||
statJson["q"] = EMSESP::dallassensor_.reads() == 0 ? 100 : 100 - (uint8_t)((100 * EMSESP::dallassensor_.fails()) / EMSESP::dallassensor_.reads());
|
||||
}
|
||||
if (EMSESP::analog_enabled()) {
|
||||
statJson = statsJson.createNestedObject();
|
||||
statJson["id"] = "Analog Sensor Reads";
|
||||
statJson["id"] = "4";
|
||||
statJson["s"] = EMSESP::analogsensor_.reads();
|
||||
statJson["f"] = EMSESP::analogsensor_.fails();
|
||||
statJson["q"] = EMSESP::analogsensor_.reads() == 0 ? 100 : 100 - (uint8_t)((100 * EMSESP::analogsensor_.fails()) / EMSESP::analogsensor_.reads());
|
||||
}
|
||||
if (Mqtt::enabled()) {
|
||||
statJson = statsJson.createNestedObject();
|
||||
statJson["id"] = "MQTT Publishes";
|
||||
statJson["id"] = "5";
|
||||
statJson["s"] = Mqtt::publish_count();
|
||||
statJson["f"] = Mqtt::publish_fails();
|
||||
statJson["q"] = Mqtt::publish_count() == 0 ? 100 : 100 - (uint8_t)((100 * Mqtt::publish_fails()) / (Mqtt::publish_count() + Mqtt::publish_fails()));
|
||||
}
|
||||
|
||||
statJson = statsJson.createNestedObject();
|
||||
statJson["id"] = "API Calls";
|
||||
statJson["id"] = "6";
|
||||
statJson["s"] = WebAPIService::api_count(); // + WebAPIService::api_fails();
|
||||
statJson["f"] = WebAPIService::api_fails();
|
||||
statJson["q"] =
|
||||
@@ -182,7 +183,7 @@ void WebStatusService::webStatusService(AsyncWebServerRequest * request) {
|
||||
#ifndef EMSESP_STANDALONE
|
||||
if (EMSESP::system_.syslog_enabled()) {
|
||||
statJson = statsJson.createNestedObject();
|
||||
statJson["id"] = "Syslog Messages";
|
||||
statJson["id"] = "7";
|
||||
statJson["s"] = EMSESP::system_.syslog_count();
|
||||
statJson["f"] = EMSESP::system_.syslog_fails();
|
||||
statJson["q"] = EMSESP::system_.syslog_count() == 0
|
||||
@@ -202,7 +203,7 @@ void WebStatusService::mDNS_start() const {
|
||||
EMSESP::esp8266React.getNetworkSettingsService()->read([&](NetworkSettings & networkSettings) {
|
||||
if (networkSettings.enableMDNS) {
|
||||
if (!MDNS.begin(EMSESP::system_.hostname().c_str())) {
|
||||
EMSESP::logger().warning(F("Failed to start mDNS responder service"));
|
||||
EMSESP::logger().warning("Failed to start mDNS responder service");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -214,16 +215,83 @@ void WebStatusService::mDNS_start() const {
|
||||
MDNS.addServiceTxt("http", "tcp", "version", EMSESP_APP_VERSION);
|
||||
MDNS.addServiceTxt("http", "tcp", "address", address_s.c_str());
|
||||
|
||||
EMSESP::logger().info(F("mDNS responder service started"));
|
||||
EMSESP::logger().info("mDNS responder service started");
|
||||
}
|
||||
});
|
||||
#else
|
||||
EMSESP::esp8266React.getNetworkSettingsService()->read([&](NetworkSettings & networkSettings) {
|
||||
if (networkSettings.enableMDNS) {
|
||||
EMSESP::logger().info(F("mDNS responder service started"));
|
||||
EMSESP::logger().info("mDNS responder service started");
|
||||
}
|
||||
});
|
||||
#endif
|
||||
}
|
||||
|
||||
const char * WebStatusService::disconnectReason(uint8_t code) {
|
||||
#ifndef EMSESP_STANDALONE
|
||||
switch (code) {
|
||||
case WIFI_REASON_UNSPECIFIED: // = 1,
|
||||
return "unspecifiied";
|
||||
case WIFI_REASON_AUTH_EXPIRE: // = 2,
|
||||
return "auth expire";
|
||||
case WIFI_REASON_AUTH_LEAVE: // = 3,
|
||||
return "auth leave";
|
||||
case WIFI_REASON_ASSOC_EXPIRE: // = 4,
|
||||
return "assoc expired";
|
||||
case WIFI_REASON_ASSOC_TOOMANY: // = 5,
|
||||
return "assoc too many";
|
||||
case WIFI_REASON_NOT_AUTHED: // = 6,
|
||||
return "not authed";
|
||||
case WIFI_REASON_NOT_ASSOCED: // = 7,
|
||||
return "not assoced";
|
||||
case WIFI_REASON_ASSOC_LEAVE: // = 8,
|
||||
return "assoc leave";
|
||||
case WIFI_REASON_ASSOC_NOT_AUTHED: // = 9,
|
||||
return "assoc not authed";
|
||||
case WIFI_REASON_DISASSOC_PWRCAP_BAD: // = 10,
|
||||
return "disassoc powerCAP bad";
|
||||
case WIFI_REASON_DISASSOC_SUPCHAN_BAD: // = 11,
|
||||
return "disassoc supchan bad";
|
||||
case WIFI_REASON_IE_INVALID: // = 13,
|
||||
return "IE invalid";
|
||||
case WIFI_REASON_MIC_FAILURE: // = 14,
|
||||
return "MIC failure";
|
||||
case WIFI_REASON_4WAY_HANDSHAKE_TIMEOUT: // = 15,
|
||||
return "4way handshake timeout";
|
||||
case WIFI_REASON_GROUP_KEY_UPDATE_TIMEOUT: // = 16,
|
||||
return "group key-update timeout";
|
||||
case WIFI_REASON_IE_IN_4WAY_DIFFERS: // = 17,
|
||||
return "IE in 4way differs";
|
||||
case WIFI_REASON_GROUP_CIPHER_INVALID: // = 18,
|
||||
return "group cipher invalid";
|
||||
case WIFI_REASON_PAIRWISE_CIPHER_INVALID: // = 19,
|
||||
return "pairwise cipher invalid";
|
||||
case WIFI_REASON_AKMP_INVALID: // = 20,
|
||||
return "AKMP invalid";
|
||||
case WIFI_REASON_UNSUPP_RSN_IE_VERSION: // = 21,
|
||||
return "unsupported RSN_IE version";
|
||||
case WIFI_REASON_INVALID_RSN_IE_CAP: // = 22,
|
||||
return "invalid RSN_IE_CAP";
|
||||
case WIFI_REASON_802_1X_AUTH_FAILED: // = 23,
|
||||
return "802 X1 auth failed";
|
||||
case WIFI_REASON_CIPHER_SUITE_REJECTED: // = 24,
|
||||
return "cipher suite rejected";
|
||||
case WIFI_REASON_BEACON_TIMEOUT: // = 200,
|
||||
return "beacon timeout";
|
||||
case WIFI_REASON_NO_AP_FOUND: // = 201,
|
||||
return "no AP found";
|
||||
case WIFI_REASON_AUTH_FAIL: // = 202,
|
||||
return "auth fail";
|
||||
case WIFI_REASON_ASSOC_FAIL: // = 203,
|
||||
return "assoc fail";
|
||||
case WIFI_REASON_HANDSHAKE_TIMEOUT: // = 204,
|
||||
return "handshake timeout";
|
||||
default:
|
||||
return "unknown";
|
||||
}
|
||||
#endif
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
} // namespace emsesp
|
||||
@@ -30,9 +30,10 @@ class WebStatusService {
|
||||
WebStatusService(AsyncWebServer * server, SecurityManager * securityManager);
|
||||
|
||||
private:
|
||||
void webStatusService(AsyncWebServerRequest * request);
|
||||
void WiFiEvent(WiFiEvent_t event, WiFiEventInfo_t info);
|
||||
void mDNS_start() const;
|
||||
void webStatusService(AsyncWebServerRequest * request);
|
||||
void WiFiEvent(WiFiEvent_t event, WiFiEventInfo_t info);
|
||||
void mDNS_start() const;
|
||||
const char * disconnectReason(uint8_t code);
|
||||
};
|
||||
|
||||
} // namespace emsesp
|
||||
|
||||
Reference in New Issue
Block a user