add missing modbus tags

This commit is contained in:
MichaelDvP
2025-10-20 11:13:36 +02:00
parent f5f78182b6
commit d7e916269d
3 changed files with 23 additions and 7 deletions

View File

@@ -42,7 +42,9 @@ string_sizes = {
"thermostat/switchtime2": 16, "thermostat/switchtime2": 16,
"thermostat/switchtime": 16, "thermostat/switchtime": 16,
"thermostat/switchtimeww": 21, "thermostat/switchtimeww": 21,
"controller/datetime": 25 "controller/datetime": 25,
"connect/datetime": 25,
"connect/name": 51
} }
tag_to_tagtype = { tag_to_tagtype = {
@@ -82,7 +84,23 @@ tag_to_tagtype = {
32: "TAG_TYPE_HS", 32: "TAG_TYPE_HS",
33: "TAG_TYPE_HS", 33: "TAG_TYPE_HS",
34: "TAG_TYPE_HS", 34: "TAG_TYPE_HS",
35: "TAG_TYPE_HS" 35: "TAG_TYPE_HS",
36: "TAG_TYPE_SRC",
37: "TAG_TYPE_SRC",
38: "TAG_TYPE_SRC",
39: "TAG_TYPE_SRC",
40: "TAG_TYPE_SRC",
41: "TAG_TYPE_SRC",
42: "TAG_TYPE_SRC",
43: "TAG_TYPE_SRC",
44: "TAG_TYPE_SRC",
45: "TAG_TYPE_SRC",
46: "TAG_TYPE_SRC",
47: "TAG_TYPE_SRC",
48: "TAG_TYPE_SRC",
49: "TAG_TYPE_SRC",
50: "TAG_TYPE_SRC",
50: "TAG_TYPE_SRC"
} }
device_type_names = [ device_type_names = [

View File

@@ -455,12 +455,10 @@ int Modbus::getRegisterCount(const DeviceValue & dv) {
uint32_t num_values = std::max(dv.max, (uint32_t)abs(dv.min)); uint32_t num_values = std::max(dv.max, (uint32_t)abs(dv.min));
int num_registers = 0; int num_registers = 0;
if (num_values <= (1L << 8)) if (num_values < (1L << 16))
num_registers = 1; num_registers = 1;
else if (num_values <= (1L << 16)) else if (num_values <= (0xFFFFFFFF))
num_registers = 2; num_registers = 2;
else if (num_values <= (1L << 32))
num_registers = 4;
else else
LOG_ERROR("num_registers is too big to be encoded with modbus registers"); LOG_ERROR("num_registers is too big to be encoded with modbus registers");

View File

@@ -73,7 +73,7 @@ class Connect : public EMSdevice {
void process_OutdoorTemp(std::shared_ptr<const Telegram> telegram); void process_OutdoorTemp(std::shared_ptr<const Telegram> telegram);
void process_RCTime(std::shared_ptr<const Telegram> telegram); void process_RCTime(std::shared_ptr<const Telegram> telegram);
int16_t outdoorTemp_; int16_t outdoorTemp_;
char dateTime_[30]; // date and time stamp char dateTime_[25]; // date and time stamp
uint8_t schedule_[126]; // telegram copy uint8_t schedule_[126]; // telegram copy
}; };