Skip to content

Adding selected parameters from release version 2.2

fredlcore edited this page Jun 18, 2024 · 1 revision

Up until version 2.2 of BSB-LAN, we collected every known parameter used by different kinds of heating systems and put them into one big BSB_LAN_custom_defs.h file. The benefit of this was that some parameters of some controllers were also working on other controllers which did not officially support them. However, the more parameters we collected, the more it became clear that the one size fits all approach is not feasible because there were overlappings and incompatible settings. This was the reason to switch to the device-specific parameter lists that we are using now since 2022.

However, ther may be a few situations where it might make sense to still use some of these "old" parameters in your device-specific parameter list, provided you have thoroughly tested its validity, especially if it is a parameter that you also plan to change on the heater.

The first step is to download release version 2.2.x from https://github.com/fredlcore/BSB-LAN/releases. After you have unpacked the file, you will find the file BSB_LAN_custom_defs.h.default in the subdirectory BSB_LAN. Open this file with a text editor such as Notepad under Windows or TextEdit under MacOS. At the same time, open the BSB_LAN_custom_defs.h file from the current BSB-LAN version in the Arduino IDE.
When both files are open, search for the parameter number of the parameter you want to add in the BSB_LAN_custom_defs.h.default of version 2.2. We do this using the example of the former parameter 701 - "Presence button (temporary absence)":

The search for "701" first results in this entry:
const char STR701[] PROGMEM = STR701_TEXT;
Copy this line to the clipboard.
Now search for the text const char S in BSB_LAN_custom.defs.h of the current BSB-LAN version and you will find a number of such entries.
Insert the line selected above at any position.

If there is no entry for a parameter that begins with const char, but an entry that corresponds to the pattern #define STR<searched parameter number> STR<referenced parameter number>, two steps are necessary:
You first copy the #define STR... line into the current BSB_LAN_custom_defs.h file and then search for the referenced parameter number in BSB_LAN_custom_defs.h.default until you find the line for this number that begins with const char S.
Using the example of parameter number 702, you would therefore find this line first:
#define STR702 STR701 You then search again for the referenced parameter number (in this case 701), so that if you search for this parameter number again, you will then find the line
const char STR701[] PROGMEM = STR701_TEXT;
which would then also be copied. It is important that the #define line is below the const char S... line. The result would look like this for parameter 702:
const char STR701[] PROGMEM = STR701_TEXT;
#define STR702 STR701

All other entries where the parameter number may be in the position of the referenced parameter in #define lines (such as #define STR1301 STR701) can be ignored - unless you also want to add the parameter number 1301 in this case.

As parameter 701 is a parameter with selection options, there are also lines beginning with #define ENUM701_.... These lines must also be copied into the current BSB_LAN_custom_defs.h.
In this context, another entry appears that begins with const char ENUM701[]. This and the following lines must also be copied into the current BSB_LAN_custom_defs.h up to the closing curly bracket:

const char ENUM701[] PROGMEM_LATEST = {
"\x00 " ENUM701_00_TEXT "\0"
"\x01 " ENUM701_01_TEXT "\0"
"\x02 " ENUM701_02_TEXT
};

For purely numerical parameters that do not have a selection menu but only display a temperature value, for example, this step is omitted because there is then a "const char ENUM..." entry.

Finally, you will find the actual table entry for parameter 701, which looks like this:

{0x2D3D0572, VT_ENUM, 701, STR701, sizeof(ENUM701), ENUM701, DEFAULT_FLAG+FL_WONLY, DEV_ALL},

The corresponding table can be found in the current BSB_LAN_custom_defs.h file at the end of the file. The parameter number is always shown in the third column. Now go upwards in this file so that the parameter is inserted in the correct position. In our example, this would be after the line for parameter 700.
It is important to make sure that the parameter is inserted in the correct position (and not, for example, before the line for parameter 700 or somewhere after it), otherwise the parameters will no longer be listed completely in the category overview.

With some controllers, however, parameter 701 will already be occupied by another function. Newer LMS controllers, for example, have the function for "temporarily warmer/cooler" stored there. However, relocating the new parameter to be added is simple: select a free parameter number (we recommend parameter numbers 10100 and upwards) and add the line

{0x2D3D0572, VT_ENUM, 701, STR701, sizeof(ENUM701), ENUM701, DEFAULT_FLAG+FL_WONLY, DEV_ALL},

at the appropriate place in the file. Then you only need to change the parameter number in the third column, e.g. to 10100. However, the parameter numbers for STR... or ENUM... can remain as they were selected so that they do not collide with the new parameters.
The new line would then look like this:

{0x2D3D0572, VT_ENUM, 10100, STR701, sizeof(ENUM701), ENUM701, DEFAULT_FLAG+FL_WONLY, DEV_ALL},

To summarize once again the lines that would have to be copied for the "Presence button (temporary absence)" function in order to insert them into the current version:

const char STR701[] PROGMEM = STR701_TEXT;
const char ENUM701[] PROGMEM_LATEST = {
"\x00 " ENUM701_00_TEXT "\0"
"\x01 " ENUM701_01_TEXT "\0"
"\x02 " ENUM701_02_TEXT
};
{0x2D3D0572, VT_ENUM, 701, STR701, sizeof(ENUM701), ENUM701, DEFAULT_FLAG+FL_WONLY, DEV_ALL},

BSB-LAN can then be flashed to the microcontroller again and the new command is ready for use. If you want to change the somewhat misleading parameter name "Presence button (temporary absence)" to the more appropriate name "Temporary operating mode change", for example, you can do this at the same time. To do this, you would simply use the destinations

const char STR701[] PROGMEM = STR701_TEXT;

in

const char STR701[] PROGMEM = "Temporary operating mode change";

and then flash again. As all these changes are made in BSB_LAN_custom_defs.h, they are retained even if the BSB-LAN software is updated.

Other parameters that may be of interest and the lines to be copied for them:

1602 - Drinking water preparation status:
const char STR1602[] PROGMEM = STR1602_TEXT;
const char ENUM1602[] PROGMEM_LATEST = {
"\x00\x02 " ENUM1602_00_02_TEXT "\0"
"\x02\x02 " ENUM1602_02_02_TEXT "\0"
"\x00\x04 " ENUM1602_00_04_TEXT "\0"
"\x04\x04 " ENUM1602_04_04_TEXT "\0"
"\x00\x08 " ENUM1602_00_08_TEXT "\0"
"\x08\x08 " ENUM1602_08_08_TEXT
};
{0x31000212, VT_BIT, 1602, STR1602, sizeof(ENUM1602), ENUM1602, DEFAULT_FLAG, DEV_ALL}, // Drinking water preparation status
10100 - Burner status
#define ENUM10100_01_TEXT ENUM_CAT_34_TEXT
const char ENUM10100[] PROGMEM_LATEST = {
"\x00" // index for payload byte
"\x01\x01 " ENUM10100_01_TEXT "\0"
"\x02\x02 " ENUM10100_02_TEXT "\0"
"\x04\x04 " ENUM10100_04_TEXT "\0"
"\x08\x08 " ENUM10100_08_TEXT "\0"
"\x10\x10 " ENUM10100_10_TEXT "\0"
"\x20\x20 " ENUM10100_20_TEXT "\0"
"\x40\x40 " ENUM10100_40_TEXT "\0"
"\x80\x80 " ENUM10100_80_TEXT
};
{0x053D0213, VT_CUSTOM_BIT, 10100, STR10100, sizeof(ENUM10100), ENUM10100, FL_RONLY, DEV_ALL}, // INFO burner
10102 - Info HK1
{0x2D000211, VT_UNKNOWN, 10102, STR10102, 0, NULL, DEFAULT_FLAG, DEV_ALL}, // INFO HK1
10103 - Info HK2
{0x2E000211, VT_UNKNOWN, 10103, STR10103, 0, NULL, DEFAULT_FLAG, DEV_ALL}, // INFO HK2
10104 - Info HK3/P
{0x2F000211, VT_UNKNOWN, 10104, STR10104, 0, NULL, DEFAULT_FLAG, DEV_ALL}, // INFO HK3/P
Clone this wiki locally