KNX fan component

Hi,

I needed a fan component for my KNX installation (see there: KNX & ventilation )
I now have a working component on my setup. Can start/stop the fan and change the speed (percentage based).
I am facing this issue in XKNX: https://github.com/XKNX/xknx/issues/114 , waiting for some reply there. The meens that 0% turns the fan to 100% (25 -> 75).
As i am not at all a python dev, could someone check and cleanup my code ? And maybe push it to the repository ?

Thanks,

Eric

You did not post your code - or did I miss this.
Inverting this is quite easy, just use 100-value instead of value

The xknx/devices/fan.py file: https://gist.github.com/itineric/dac25caf4fda62130e10df2893218154
The homeassistant/components/fan/knx.py file: https://gist.github.com/itineric/5a444cd7bde55a4a6770dbe3aebd10f5

Needs an import in xknx/devices/_init_.py: “from .fan import Fan”

I know how to hack the percentage problem but would be better if the source error in xknx was fixed.

And the xknx/core/config.py: https://gist.github.com/itineric/86067601016b79fd03a60504a81481d3

For sure this is an older thread, but I’m also having some issues with this.

I coupled my knx with an ubbink ventilation system, that’s working fine and I do have (at this moment) 4 settings I can choose from (like 25-50-75-100%), all working fine with a press on the button.

I even managed to make it possible with HA to manage my fan by making it seen as a dimmable light. Pressing around 50% will turn it to 50% as an example.

But… While i do get feedback when I press in HA on a value (I can see it change on my MDT Glastaster), I don’t get any other feedback on my other devices.

For example:

  • pressing on my HA-app on my smartphone does change the value + I see this on my wall-device
  • pressing on my wall-device will change the value, but I don’t get any feedback on my smartphone
  • pressing on my smartphone will not change the value in the HA-app on another device like my tablet or laptop.

Still will experiment some around, I do hope to find an (easy) way around this.

Not the best looking, but at this moment I work around with 1 “light” and 1 “sensor” entity.

With the slider of my “light” I can choose anywhere between 0 and 100 percent. This will update my bar below it and also the value on my knx is displayed like it should. (It changes on all devices now, both Android as knx)

One small problem is my slider always moves back to 0 (cause it sends the state to my knx, but can’t read it with the same entity) after a little while, but that’s ok and of course it does not change the actual value when it does… Might find a solution for this later on if I got some more free time to spare. Maybe it’s even as simple as customizing a bit in yaml. But haven’t had time to try it.