-
-
Notifications
You must be signed in to change notification settings - Fork 44
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
Cannot use numerical fan speed modes. ['auto', '1', '2', '3'] #62
Comments
Hello, I checked the code at place and it seems to be issue with integer input vs string expected in comparison. I can try to make fix for this in my forked repo if you are willing to test the patch. |
BTW I am not sure, if numeric values are supported. I did checked all core Homeassistant constants:
from those climate_template imports only subset:
therefore using fan modes for Climate entity in climate_template shall use only this set of strings:
Given error message is misleading as it seems to be returning enum values. Please test functionality with string as above - it should work. If so, then this is not a bug ;-) |
Hi @litinoveweedle I understood that the fan modes are allowed to be custom per Fan modes here: https://developers.home-assistant.io/docs/core/entity/climate/ Granted, the Fan Modes are a list of strings, but as you say looks to treat them as integer and not str when using a numeric value. Of course happy to test. |
If I would prepare for you git branch in my repo with proposed fix, are you able to manually place it into your HA (modify climate.py)? BTW: could you please paste here your config? Maybe explicitly casting you numeric fan mode as string in jinja template could help:
also it should help to declare fan_modes in the configuration as a string .i.e |
Can add the climate.py and test. Here is a cut down template that exhibits the issue.
|
@litinoveweedle any updates on this? Would also like to test this. |
@CV8R , @Arn0uDz I actually have some completely rewritten version of climate_template.py ready - it is running from today's 4AM in my HA. :-) I will check it once again later today, and I will commit it to my github repo, under given branch and send you a link to it, you can check it and report if it would be working. One warning, there is also small breaking change regarding set_temperature_action for HEAT_COOL hvac mode, but it not affect @CV8R (based on shared config, you are not using this hvac mode) and hopefully neither you @Arn0uDz. I will post here link to the updated climate_template.py later on. |
@litinoveweedle thanks! I'm not using the heat_cool HVAC mode so that is no problem for me. |
Ok, here is climate.py. Disclaimer: I tested only some functions, and almost whole code was rewritten, so expect bugs ;-) Also some of the configuration parameters and script variables were renamed to align with default HA climate attributes names. For reference check updated Readme. So backup your configuration before changes in case you will need to rollback. For testing enable debug output for this integration:
Please report any further issues to my repo issues directly if possible, thank you. |
You are right, syntax validation broke it, as it seems HA is expected some of the async functions to have given input variable with hardcoded names. It shall be fixed (I check it in my setup). Also translation shall be working now. You can check latest climate.py. |
@litinoveweedle |
Hey no problem. Thank you very much for testing! You see I did as well post into different repo issue. :-) |
Hi @litinoveweedle , Nice work! Thank you and apologies for the delay, I was traveling. I have just tested your changes and all appears to be working now. For completeness I added my full config below. As per your doco I needed to change
|
The problem
Cannot use numerical fan speed modes.
Log reports Received invalid fan mode: 1. Expected: ['auto', '1', '2', '3'] and state does not update.
What version of Template Climate has the issue?
v0.6.1
What version of Home Assistant are you running?
Core 2024.2.5 Supervisor 2024.02.1 Operating System 12.0 Frontend 20240207.1
What type of installation are you running?
Home Assistant OS
Example YAML snippet
No response
Anything in the logs that might be useful for us?
Additional information
No response
The text was updated successfully, but these errors were encountered: