Skip to content

Simply remote temperature calculation - #234

Open
chwdt wants to merge 1 commit into
SwiCago:masterfrom
chwdt:master
Open

Simply remote temperature calculation#234
chwdt wants to merge 1 commit into
SwiCago:masterfrom
chwdt:master

Conversation

@chwdt

@chwdt chwdt commented Feb 26, 2025

Copy link
Copy Markdown

This PR simplifies and corrects calculation of temperature values in setRemoteTemperature(float setting):

The original values calculated are:

packet[7] = 3 + ((round(setting * 2) / 2) - 10) * 2
packet[8] = round(setting * 2) / 2 * 2 + 128

which can be simplified to:

packet[7] = round(setting * 2) - 17
packet[8] = round(setting * 2) + 128

The heat pump ignores the value in packet[7] when packet[8] is set. Leaving packet[8] unset shows an error of 0.5°C between reported room temperature and sent remote temperature. Therefore the correct value should be:

packet[7] = round(setting * 2) - 16

@apppie123

apppie123 commented Jan 7, 2026

Copy link
Copy Markdown

I just noticed that with this formula, when the temperature is 6.8 degree celsius, the heatpump reports the temperature to be 38 degree celsius. So it appears that packet[7] is not ignored when packet[8] is set for my heatpump.

With a temperature of 6.8 degree packet[7] underruns (7*2 - 16 = -2 wrapping around since a byte is an 8-bit unsigned int). It appears that the minimum temperature that can be set is 8 degrees celsius.

Since it wraps around with -2 to 38C. I believe the temperature range is between 8C and 40C.

@chwdt

chwdt commented Jan 8, 2026

Copy link
Copy Markdown
Author

You are correct about the overflow, but the same overflow also happens with the old calculation.

The value should probably be clamped to the correct range before calculating the byte values.

About byte[7] being ignored: This is true for my heatpump, apparently there are different models with different behaviour.

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

Successfully merging this pull request may close these issues.

2 participants