-
Notifications
You must be signed in to change notification settings - Fork 54
Conversation
I dont follow. If you sant the speeds, you should make sure the set percentage works. |
Nibe in general does not allow to set speed percentage. It basically only allows to set normal or 4 pre defined presets (which go back to normal after the configured return time) Currently it's configured the fan entity from home assistant with feature Only allowing to read the speed makes the fan card a bit useless. My change removes the whole unusable set speed, but exposes all the presets returned from Nibe, giving you full control over your ventilation, rather than just having a speed boost mode setting speed 1. The alternative approach I mentioned is something I didn't include in the code of this pull requests as this requires changes in the other project. Just mentioned a food for thought. |
There are helpers in home assistant for converting from a percentage to a fixed set of speeds. Fans are expected to use that of they cant set specific speeds. Look at: https://developers.home-assistant.io/docs/core/entity/fan/ in the converting speeds section. |
I have tried that, you can have a go as well with it, but the slider doesn't make a lot of sense. Main problem with Nibe is that you can have following speed steps
The converting speed method home assistant provides is basically just dividing 100% into length of the list During I think, as Nibe systems return to default speed after a certain time, they basically just have 1 fixed speed, and 4 "boost" modes. Hence it's more logical to return it the same way to the end user as well. In my opinion the fan support from Home Assistant focussed too much on percentages, which doesn't suit the way Nibe implemented their ventilation speed control. |
fan.py
Outdated
if (value := self.get_value(self._ventilation.fan_speed)) is not None: | ||
return int(value) | ||
return None | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to remove the current speed? Can't that still remain?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't need to remove that part but we would then need to re-enable the SET_SPEED
feature in supported_features
, otherwise Home Assistant never calls the property percentage
This is why I added data["fan_speed"] = self.get_raw(self._ventilation.fan_speed)
in extra_state_attributes
to give the user an entity to read the fan speed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok. Please leave the percentage anyway. I might see of i can get that changed in core so that percentage is available even if we cant set the speed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done with f5a2c8a
edit:
Or let me know if you also want back the SET_SPEED
option and async_set_percentage
back :) .
I wonder of the fan entity have gotten support for state attribute translation in frontend yet. If so we should probably make use of that. If so the presets need to be named differently. But we can do that later. |
Climate does have state translations it seems, maybe it's another way to implement the ventilation with the fan modes of the climate control: I'll fiddle around with it in the next few days/weeks and let you know if I come up with something. |
Goal
Changes
Result
Extra info
I was having trouble with setting the different ventilation speed modes with this integration for my F470, and came up with this solution.
Reading #17 (comment) got me thinking it should be possible to set those with the
47260
parameterIt seems that this commit elupus/nibeuplink@1ed805c changed the use of
ventilation_boost
to47260
, which probably "broke" the code for thefan
entity (SPEED_BOOST
would now just select speed 1).The changes in this pull request use the ventilation boost to select all 5 different speed modes, remove all percentage speed references, but adds the current speed percentage as an extra attribute..
An alternative approach would be to allow both
![image](https://user-images.githubusercontent.com/31593025/235319182-4f37ecfb-8693-4bad-b2a6-9bf9919b408e.png)
ventilation_boost
and47260
params to be set separately in https://github.com/elupus/nibeuplink . Ventilation boost on my F470 sets speed 4 as shown below:(don't mind the percentage, in my system this is configured as overpressure so exhaust speed is pretty low 😅 )
One could then configure speed 1, 2 and 3 as low, med, high, and Off would be "Normal". It could look then something more like below (but with a boost mode)
![image](https://user-images.githubusercontent.com/31593025/235319279-f604846a-5da0-4f29-9daf-0168bc84a141.png)
Note
This works on my F470. I have no idea on how universal this is for other Nibe systems