Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

strange return value #2

Closed
geo903 opened this issue Sep 29, 2018 · 2 comments
Closed

strange return value #2

geo903 opened this issue Sep 29, 2018 · 2 comments

Comments

@geo903
Copy link

geo903 commented Sep 29, 2018

Hello! Thank you so much for your development!
I use an example of your code to get the value of the boiler modulation and get a strange value, if it is divided by 256 then do not get a number from 0 to 100%

  unsigned int data = 0xFFFF;
  unsigned long request = ot.buildRequest(
  OpenThermRequestType::READ,
  OpenThermMessageID::RelModLevel,
  data);
  Serial.println("mod:"+String(ot.sendRequest(request)));
Central Heating: on
Hot Water: off
Flame: off
diagnost: 0
fault: 0
**mod:3222339584**
Boiler temperature is 36.80 degrees C
@ihormelnyk
Copy link
Owner

Hi @geo903 ,
To get modulation level you have to parse response like this:
float modulation_level = (response & 0xFFFF) / 256.0;

@geo903
Copy link
Author

geo903 commented Sep 30, 2018

Thank you! it works!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants