etheralm / libpurecool

Python library for dyson devices.
Other
68 stars 30 forks source link

Granular temperature control #18

Open ptrwtts opened 4 years ago

ptrwtts commented 4 years ago

I noticed that the formula for converting temperature rounds the result, such that every second degree in Fahrenheit is the same. For example:

print(HeatTarget.fahrenheit(68))
print(HeatTarget.fahrenheit(69))
print(HeatTarget.fahrenheit(70))
print(HeatTarget.fahrenheit(71))
print(HeatTarget.fahrenheit(72))
print(HeatTarget.fahrenheit(73))

gives

2930
2930
2940
2940
2950
2950

Is this a limitation of the device? I tried manually setting heat_target=2945 but it didn't work. Is there any known workaround? Would really like to be able to set a more granular target. Thanks!

etheralm commented 4 years ago

Hi,

I don't have a model with heating myself, so I would need your help to figure out if its a limitation of the device or not,. If it isn't, I'll update the formula to convert to kelvins more precisely. I doubt that it is, but let's test it first.

Which fan model are you using? Asking because the code differs a bit between the new and the old model. If it is an HP04 are you setting the temperature with the set_heat_target method, or are you calling set_configuration directly?

Can you try to to set the the heat_target to 2931 please, that should correspond to 68 Fahrenheit. If this doesn't work I'll push a test branch that logs the messages coming from the fan when you set the temperature from the app, so that we can see whats going on.

iceman23e commented 4 years ago

@etheralm I've had the same problem with my HP04. I'd like to help test, but I'm not sure how to call what you asked. Calling climate.set_temperature from home assistant gets this same behavior. Anything I can do to help?

etheralm commented 4 years ago

@iceman23e the home assistant integration already uses the helper function that converts Fahrenheit Kelvin. You'll have to run this library directly. Can you start the python console from where hass is running? If you can I tell you which commands to run there to connect to your fan and test the set_temperature method directly.

iceman23e commented 4 years ago

@etheralm I'm running HA on a pi4 and am not sure how to do that. I'd like to help, but I'm not sure how.

homekitter commented 4 years ago

@etheralm I have a Dyson Pure Hot+Cool Link™ HP02 got some python for me to run?