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

Temperatures below zero #2

Open
oauestad opened this issue Feb 9, 2021 · 2 comments
Open

Temperatures below zero #2

oauestad opened this issue Feb 9, 2021 · 2 comments

Comments

@oauestad
Copy link

oauestad commented Feb 9, 2021

Hi Adam, many thanks for your code which I use with a Tracer 2210AN.

In my cabin, the temperature can fall below zero C in winter. I found the Tracer encodes negative values in 2's complement. To display temperatures correctly, I replaced the /100 Range nodes after Tbatt and Tcase with Function nodes, with the following code:

var t = msg.payload;

if (t >> 15) {
    t -= 1 << 16;
}

msg.payload = t/100;

return msg;
@AdamWelchUK
Copy link
Owner

Thanks for the suggestion. I'll add this to my flow now and try it out.

@razvanfatu
Copy link

Thanks for this, I just applied it to my 2210AN installation and it works perfectly.

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

3 participants