Jeroen88 / EasyOpenTherm

OpenTherm library to create thermostat for OpenTherm enabled boilers and HVACs using an OpenTherm controller and an ESP32 or other microcontroller
GNU General Public License v3.0
67 stars 2 forks source link

FLAGS 2,3,126,127 #11

Closed ananyevgv closed 1 year ago

ananyevgv commented 1 year ago

Hello friend, I didn't see 2, 3, 126, 127 in the exchange code. For some boilers, the exchange is mandatory, an example unfortunately for another library:

1. unsigned long request3 = ot.buildRequest(OpenThermRequestType::READ, OpenThermMessageID::SConfigSMemberIDcode, 0xFFFF) unsigned long respons3 = ot.sendRequest(request3); uint8_t SlaveMemberIDcode = respons3 >> 0 & 0xFF; unsigned long request2 = ot.buildRequest(OpenThermRequestType::WRITE, OpenThermMessageID::MConfigMMemberIDcode, SlaveMemberIDcode); unsigned long respons2 = ot.sendRequest(request2); nsigned long request127 = ot.buildRequest(OpenThermRequestType::READ, OpenThermMessageID::SlaveVersion, 0); unsigned long respons127 = ot.sendRequest(request127); uint16_t dataValue127_type = respons127 & 0xFFFF; uint8_t dataValue127_num = respons127 & 0xFF; unsigned result127_type = dataValue127_type / 256; unsigned result127_num = dataValue127_num; unsigned long request126 = ot.buildRequest(OpenThermRequestType::WRITE, OpenThermMessageID::MasterVersion, 0x013F); unsigned long respons126 = ot.sendRequest(request126); uint16_t dataValue126_type = respons126 & 0xFFFF; uint8_t dataValue126_num = respons126 & 0xFF; unsigned result126_type = dataValue126_type / 256; unsigned result126_num = dataValue126_num;

2. //======================================================================================= // This group of data elements defines configuration information on both slaves and // and on the main sides. Each of them has a group of configuration flags (8 bits) // and the MemberID code (1 byte). Before transmitting management and status information // it is recommended to exchange messages about a valid configuration of the slave device // read and write basic configuration. The zero code MemberID means client // non-specific device. The product version number/type should be used in combination // with a "participant ID code" that identifies the device manufacturer.

localRequest = ot.buildRequest(OpenThermRequestType::READ, OpenThermMessageID::SConfigSMemberIDcode, 0xFFFF);
  sendRequest(localRequest, localResponse);

  if(!vars.monitor_only.value && ot.getLastResponseStatus() == OpenThermResponseStatus::SUCCESS && ot.getDataID(localResponse) == OpenThermMessageID::SConfigSMemberIDcode) 
  {
  localRequest = ot.buildRequest(OpenThermRequestType::WRITE, OpenThermMessageID::MConfigMMemberIDcode, vars.SlaveMemberIDcode.value);
  sendRequest(localRequest, localResponse);
  }

  localRequest = ot.buildRequest(OpenThermRequestType::READ, OpenThermMessageID::SlaveVersion, 0);
  sendRequest(localRequest, localResponse);

  localRequest = ot.buildRequest(OpenThermRequestType::WRITE, OpenThermMessageID::MasterVersion, 0x013F);
  sendRequest(localRequest, localResponse);
Jeroen88 commented 1 year ago

Hi @ananyevgv,

Code 2 is here Code 3 is here Code 127 is here

What does code 126 do? What is the data type? Is it read, write or read/write (I think it is write deducting from the code snippets above)? If you can provide me this information I will add it to the appropriate enum class.

ananyevgv commented 1 year ago

126 - W Master product version number and type HB : product type LB : product version u8 u8 0..255 0..255 The master device product version number and type as defined by the manufacturer.

page 25 http://ihormelnyk.com/Content/Pages/opentherm_library/Opentherm%20Protocol%20v2-2.pdf

Jeroen88 commented 1 year ago

Code 126 is already here