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

Indoor and outdoor temperature #182

Open
mruna1 opened this issue Dec 13, 2024 · 3 comments
Open

Indoor and outdoor temperature #182

mruna1 opened this issue Dec 13, 2024 · 3 comments

Comments

@mruna1
Copy link

mruna1 commented Dec 13, 2024

Following what is shown in NetHome Plus for Midea it shoud be sothething like:

They count (d - 50) / 2 as double but put only integer of this.
So this is exactly what should be in decode_temp:

def decode_temp(d: int) -> Optional[float]:
    return (int((d - 50) / 2) if d != 0xFF else None)

Next we have to add part after dot but must depend on temperature value negative or positive:

if self.indoor_temperature:
    if self.indoor_temperature < 0:
        self.indoor_temperature -= (payload[15] & 0xF) / 10
    else:
        self.indoor_temperature += (payload[15] & 0xF) / 10

if self.outdoor_temperature:
    if self.outdoor_temperature < 0:
        self.outdoor_temperature -= ((payload[15] & 0xF0) >> 4) / 10
    else:
        self.outdoor_temperature += ((payload[15] & 0xF0) >> 4) / 10

You can simplify if needed :)

After those changes we can see exactly what recomended NetHome Plus for Midea shows.
Perhaps they make a mistake taking only int part of temperature but to who we can believe?

@mruna1 mruna1 changed the title Indoor and aoutdoor temperature Indoor and outdoor temperature Dec 13, 2024
@mill1000
Copy link
Owner

Thanks for the information. What's your reference for this change?

@mruna1
Copy link
Author

mruna1 commented Dec 14, 2024

I updated earlier post.

@mruna1
Copy link
Author

mruna1 commented Dec 14, 2024

I had to chanche again.
There was problem around -0.5 degrees.

Following what is shown in NetHome Plus for Midea it shoud be sothething like:

So now the code looks like this:

if self.indoor_temperature:
    if self.indoor_temperature < 0:
        self.indoor_temperature = int(self.indoor_temperature) - (payload[15] & 0xF) / 10
    else:
        self.indoor_temperature = int(self.indoor_temperature) + (payload[15] & 0xF) / 10

if self.outdoor_temperature:
    if self.outdoor_temperature < 0:
        self.outdoor_temperature = int(self.outdoor_temperature) - ((payload[15] & 0xF0) >> 4) / 10
    else:
        self.outdoor_temperature = int(self.outdoor_temperature) + ((payload[15] & 0xF0) >> 4) / 10

It looks they take negative 0.5 degree and later int od this.

Before this change temperature was jumping fron 0 to -1 and never was -0.5 degree.

Hope it's ending but I will comment this after some time as I will see what will happend.

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