-
Notifications
You must be signed in to change notification settings - Fork 28
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
Temperature increments are calculating incorrectly for Celsius #39
Comments
Hey @codyc1515 thanks for the report. I'm not quite sure what you mean. You mention results, but could you fill more detail the process you followed to reach those results? (Where are you selecting increments of .5? etc) If it helps, the device actually sends temperature data over MQTT in Kelvin, which this integration converts to °C by subtracting 273.15. |
Aha, now I understand. I thought you were talking about the thermometer sensor, but you're actually talking about the thermostat? I'm actually not too familiar with that area yet - it was created long before I adopted the project. I'll try to figure out what's going on here. |
Affirmative. I can take a look too. |
Dug around for a few minutes in the target-temperature logic. Interestingly, it's using 273 instead of 273.15 for the C-to-K calculation. If HA is rounding .15 to .2 for the displayed value, that would explain why you're seeing 19.7 instead of 19.5, for example. I'll do some testing and see if "fixing" that C-to-K value causes any other issues. |
While the 273 values are incorrect, I'm finding that it appears to still be rounding the digits (despite me correcting them). I think we should make use of the official HA function for Kelvin to Celsius. |
I 100% agree on using HA Core utils as much as possible. That said...
So let's use the new one instead. |
Okay, I found the actual reason - it's a limitation from the Dyson device itself: After receiving the command with a new target temperature, the device sends an MQTT After a short series of repeated rounding quirks, the target temp rounding stabilizes at +0.2C. So this means, weirdly enough, it's not calculating incorrectly at all! It's a weird user experience though, to be sure. |
Example of how the 0.1K rounding causes this:
But this only happens when using the "correct" 273.15 conversion. I'm guessing that the original creators of this integration chose to use the "incorrect" conversion intentionally because of this rounding quirk? Anyway, I'm not able to reproduce your error using the integration at its current release, weirdly enough. Could I ask you to help me track down where it's breaking down in your setup? Since I'm not able to reproduce the rounding bug using my device, I wonder if you could help me with your device. I have a tool called dyson-mqtt-listen which you can use to export all the MQTT data that the device sends. Would you be willing to listen to the MQTT data whilst doing the following:
|
@codyc1515 Sorry to be a bother here. Just wanted to make sure you'd seen the above message. I'm not quite able to reproduce the behavior you're seeing. |
Thank you for the reminder. I appreciate it (lots going on). Curiously, setting the temperature via the service in HA worked okay, same with changing in 0.5c increments with the clicker in HA. Going back to the Dyson app, however, brings us back to 0.2c and 0.7c increments, so it appears the issue is when setting a temperature in the Dyson app and the Dyson reporting that temperature back to HA. I will need to do some research on how to use your tool as I recently moved from the Container install to HAOS method. |
Dude I totally understand, thanks for following up!
Iiiiinteresting. I'll try to reproduce it that way.
Sure thing. It should be pretty easy in theory: You can even just download the .exe (or the executable for whatever OS you use) from the github release and just run it in cmd., But getting the credentials might be a bit trickier if your device is a more recent variant. The readme has more info though. Anywho I'm happy to help (and feedback on the tool is welcome too! It's very slapped-together right now) |
Thanks for the patience. The tool worked well. I didn't have Python installed, so obtained my credentials from the HA .storage folder. I managed to work out the tool parameters reasonably quickly. Here is the results:
I changed temp a few times in the native Dyson app, then a few times in HA. Are we looking at the hmax value? It looks like, for example, 2937 would become 293.7 which itself becomes 20.05 then as you said becomes rounded to 20.1 in *C. So, I think that we may need to change, for example, 2937 or rather 293.7 to become 293.65, so a change of just -2. The most baffling thing to me is that the Dyson app itself does not support half-degrees, so not sure where this comes in. |
Lastly, it looks like the app always sets X.2 whereas HA allows half-increments (X.2 then X.7). Is there a way to forbid this in HA (so they have to be whole increments, X.2 or X.0 ideally)? |
Oh nice! Those json files can be a bit monstrous, so I wondered whether or not I should suggest looking at them. Glad you got it!
Yep!
Yep!
Whaaaa... So the Dyson app only supports full-degree increments? Funny enough, I'm not even able to test this on my device. Apparently regulations on movable heaters force compliance to UL 1278, preventing that feature from functioning in the US. So big thanks for sharing your MQTT data. I'm trying to think of the best way to handle this... |
It's not possible to enable heat mode remotely, however, if you use your physical remote to turn heat mode on, I think you can then use the app to change the temperature if that helps. |
Still an issue. Did not have any luck fixing myself. I am able to enable heat mode remotely. If someone would like to access my account, I can share details over email. |
Frustratingly, I am still facing this issue. |
This is in line with what the app allows you to set (whole numbers only) for heating and resolves libdyson-wg#39.
I am seeing that I can select in increments of .5 - which is right - but the issue is that they are offset.
Expected result
Actual result
The text was updated successfully, but these errors were encountered: