ofalvai / home-assistant-candy

Unofficial Candy/Haier appliance integration for Home Assistant
120 stars 27 forks source link

Candy Oven in Celsius #193

Open nitaybz opened 1 year ago

nitaybz commented 1 year ago

Hi, Thanks for creating this plugin 🙏🏼.

I tried the plugin with my Candy oven and noticed that the plugin is showing wrong temperature value, after investigating a little bit in the code I found out that you are using Fahrenheit to Celsius function which is completely unnecessary for me, I tried to create the request to the oven and saw that it gets the temperature already in Celsius but it needs to be devided by 10.

So I'm getting from the request 2200 for 220 degrees Celsius.

Hope you can make the proper adjustments to make it work. Thanks again :)

ofalvai commented 1 year ago

That is a tough problem because some devices report the value in Fahrenheit and we have no way to tell which device reports in which format.

My first idea was to look at the number itself and if it's above a threshold (say 600), then it must be in Celsius 10, else in Fahrenheit. But this wouldn't work with low temperatures reported as Celsius 10, such as 40 degrees, reported as 400. This value could also mean a valid oven temperature in Fahrenheit (400F = 204C).

I'll leave this issue open, maybe someone has a better idea of how to parse the reported value without breaking any of the appliances.