-
Notifications
You must be signed in to change notification settings - Fork 3
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
Climate : fixing internal server error when setting hvac mode #58
Conversation
This is a pretty dirty quickfix that will probably require to be improved. I don't really know how to approach this in that case. |
Hello @MrXANA91 As I mentioned in the issue OpenWonderLabs/SwitchBotAPI#366 I have the same error sending a setAll command with a integer parameter. What are the evidence that the problem is the float value? |
Using this branch, several commands I tried to send :
And trying the exact same command you described here : OpenWonderLabs/SwitchBotAPI#366
During my first debugging attempts here, I tried to reset my developer tokens. Maybe doing this had an impact that went unnoticed until now? |
For sure there is something strange with these APIs. I can't test now because I'm OOH, but I'll investigate during the week. Anyway, thanks for contributing. |
Hello, As per this comment, it seems, as you say, float number cause the error. But looking at the climate class, target temperature step is set to 1. How is it possible that we have float? |
Best guess is that by default, Home Assistant consider all temperature values as floats, including the The thing is : target temperature step for this Climate component can be configured to be between 0.1 and 2 (with 0.1 minimum precision steps) (see config_flow.py ligne 85). Unfortunately from now on, any value except integers as step values are no longer valid. I don't really know how to handle this. Anyway, let me know what I can do to help having this fix merged as quickly as possible. |
Ok, great! So could you also update the file to force in the config flow to set step as integer? |
@KiraPC if it helps you, also the official Switchbot Cloud Integration has problems setting temperature. It works through the Switchbot App though |
This pull request closes #57
Thanks to this comment from @davidsak in OpenWonderLabs/SwitchBotAPI#363 :
When I force a
int
cast ontarget_temperature
before sending the request, allhvac_set_mode
commands seem to work.