eriknn / ha-pax_ble

Home Assistant component for Pax Calima bluetooth-enabled fans.
Apache License 2.0
42 stars 6 forks source link

How to add fan manually #49

Closed texnic closed 1 month ago

texnic commented 1 month ago

Hi there, I have a Vent-Axia Svensa fan. Not sure it will work with this integration, but would give it a try. Since my Home Assistant doesn't show my fan automatically, I would like to try "to add it manually through the integration configuration", as mentioned in the "Add device" section. I cannot sort out how to do it. Could you help please?

eriknn commented 1 month ago

If you click into the integration (after adding it), you should have a «configure» button (this is default for most integrations)

Only Pax Calima is autodiscovered, as the name is used as the key in manifest.json

texnic commented 1 month ago

Response is too slow, I challenge you to do it faster )))

Stupid me, I didn't realize that I have to add the integration again under integrations after installing it in HACS. For the record: Go to Settings > Devices & Services > Search for "PAX". If not found, click "Add Integration", search for "PAX". After installing, click PAX > Configure > Add.

Any idea how to find out the MAC address and the PIN code of the fan?

eriknn commented 1 month ago

I think it’s written on the back of the fan - you have to remove it!

texnic commented 1 month ago

No luck :-( Unlike what I read about Svara, Svensa has the removable propeller on a rotor, and the rotor is part of the motor. On the other hand: how can the Vent-Axia app connect to the fan without me entering the Mac address and the PIN?

Update: I found MAC with device scanner, and the integration was able to connect with pin 0000. But it doesn't show any values and doesn't control the fan. Question: If connected, does it mean the integration actually works with the fan? What is the criterion for successful connection message?

eriknn commented 1 month ago

You could enable debug, that'll tell you connection status. But I think that there are other people as well that has struggled with different versions of the fan. Most likely it's rather easy to figure out - you could scan the device for availiable characteristics. Take a look at this: https://github.com/hbldh/bleak/blob/develop/examples%2Fservice_explorer.py

Then you can compare with the addresses in calima.py If the addresses are different, but the values are the same('ish), maybe we could seperate the characeristics list in seperate device files. We could put all the code in a BaseFan-class, then classes PaxCalima and AxiaSvansa could just contain the characeristics. Then we could dynamically load the correct module based on some parameter....

Edit: PaxCalima and AxisSvansa could just be .py-files with characteristics, not classes.

Edit2: Pin is only necessary to send a command to the device, not for reading.

texnic commented 1 month ago

I will try what you suggest, thanks! I also opened a thread here: https://community.home-assistant.io/t/vent-axia-svensa-pureair-sense-extractor-fan/777450. Perhaps more people are interested.

eriknn commented 1 month ago

I'm closing this for now, please open a new issue if you have more information on how we can support your fan