On some ventilations systems, like the one I am creating an ESPHome component for there is no concept of percentage speed, there are just hard steps to choose from.
For example, in the one linked above, there is a range from 0 to 6. Translating that to percentages makes no sense. It will show values like 66.67% which means nothing for the end user.
It is even worse when I include the special speeds and go into 11 values
Also, if the user wants to set the speed 2 on an automation, they again have to go thru the process of convert them to percent just for it to work. Which is cumbersome, unintuitive and a bad UX.
We need to be able to set fans as non-percent fans (step fans?) and allow to set integers as the velocity.
Funny story…that’s how HA was years ago before they went against many of us and changed to using percentage. Unfortunately I seriously doubt there is ANY chance of it going back again given we failed to have a win back in those days.
That is coo. My main issue is on HA UI though. After I add the component I am working on, there is no way to specifically see the current velocity without doing mental math
Isn’t that what the switches are for? You can write an automation to have the switches set the right speed. Another option is to tie the speeds to fan presets. I do not think they are present in esphome but you can create a template fan in HA for it and redirect the calls.
What bugs me for mechanical ventilation is that there is no off on those. While it is possible to map speed 1 to off, the numbering no longer corresponds to what the users expect and the physical buttons.
As it states in the pinned post in Feature Requests category, an ESPHome Feature Request is not in scope for the feature request category. You need to contact ESPHome for help with those.
OK. Maybe you need to adjust the request a bit, I don’t get that from what you wrote, it starts off talking about espHome. But OK, it’s your request.
If you are talking about inside HA, I do a custom template macro like this…
{% macro fanspeed(entity,speed) %}
{# The entity is the HA entity name of the sensor calling this template.
This is needed if the fan gets a RESULT that is not FanSpeed, like Buzzer.
The speed is the value_json.FanSpeed from the RESULT topic.
The return will be whatever the sensor value currently is.
This responds immediately on command so don't have to wait for the tele.
#}
{% if speed | is_number %}
{% if speed == 1 %}
33
{% elif speed == 2 %}
66
{% elif speed == 3 %}
100
{% else %}
0
{% endif %}
{% else %}
{{ states(entity) }}
{% endif %}
{% endmacro %}
I believe all Apple HomeKit fans are percentage based (At least the control interface is - I think the HomeKit Accessory Protocol control interface only supports % for fans, though I’m assuming they could do a conversion to 33%, 67%, 100% for a 3-speed fan). However, I think you can only get “true” percentage-type control if the fan motor is a DC motor which allows you to adjust speed by a simple voltage adjustment. The more typical ceiling fan uses an AC motor which uses capacitor banks to adjust speeds (this type of thing: Ceiling Fan Capacitor) - those motors typically have only a few different capacitor settings, and thus only a few speeds.