Pax Calima

How to get your module to work?
I’ve got after following the instructions:
Platform error sensor.paxcalima - No module named ‘pycalima’

Sorry. for late reply.
Did you manage to figure this out?
I’m running node-red in a container on the Pi ZeroW. - Works great, not fast.
Let me know if I should share the docker file so you can build your own container.

Sorry, I can’t give any support if you have different version. It seems HA cannot find pycalima package.

I’m little bit confused, am I supposed to install this in Docker container or on host machine?
I am running HA supervised (Home Assistant 2021.4.6). Everything is installed on host (OrangePi Pc).
I am not able to for some reason to get anything from Pax fan in HA, but it works in terminal.

Ummh? Are you able to interact with the fan from your supervisor or from another raspberry pi zero? Anyway it don’t really matter. These can be on independent mashines or the same.

here’s a working docker file.
(you might be able to update the node-red version…?)

Then make a flow to post messages to homeassistant via mqtt. Make an mqtt sensor and you are ready.

I was able to get the fan stats from MQTT, instead of using directly python scripts.

Yes, I finally got it to work! Also I have learned a lot on the way, this is really fun!!! :slight_smile:
I don’t know if there’s a better way, now I have it set up like this:

  • Push of a button sends a MQTT to a broker in HA
  • the broker in HA sends the command to the Raspberry Pi zero that is closer to my two PAX-fans
  • the Raspberry Pi zero sends a command “sudo calima -b 900 -m MAC -p XXX” that starts the fan.

It’s really slow (like 25-30 seconds from the push of the button) but it works. Is there a way to make it faster? In Node-red on the Pi zero I see the command from the push button is almost instant, it seems like it’s slow to send the command, or is it PAX that is slow to receive it?

Rather old topic but…in case someone still wants to have a try…

I’ve made a forked version from @MarkoMarjamaa’s original version. I’m actually using fork from another fork from “petrepa”, who had updated the manifest.json to match the requirements of home assistant and I’ve created a package to pypi.

At least with my testing (HA running on raspberry 4 PI) this actually works without having to do anything else than 1) copy the required files under “custom_components”, 2) reboot, 3) modify configuration.yaml, 4) check configuration and 5) reboot again.

Note: there might be otther dependencies / requirements for the installation to succeed, but which I do not see as I have those packages installed due to other integrations etc…

3 Likes

Is it correct that init.py is empty?

in my system all sensor is unknown, and i get some error

init.py under custom components does not contain any data.

What’s the error message you get, and does the command line work fine?

Hi, thanks for reply.
For some reason I did now manage to get data from PaxCalima into HomeAssistant after hours of messing around with this. :slight_smile:
So I think I have done it correct now. But it seems like the Bluetooth on Rpi3 dont have large range, maybe it is because i dont have the right power adapter (will get it within few days)

Now I need to find out how i send command from HomeAssistant to PaxCalima.

If you browse through this whole topic, you’ll find some python scripts created for sending commands to Calima. I had those in my installation sometime ago, and they do work.

I am too newbie (= no experience at all) to understand how to merge them to the integration in a way that one could via the integration e.g. change the fan speed. But having bi-directional integration would be excellent, as then one could enable boost mode, stop, change rpm etc… via home assistant (and that way build more advanced automations, such as “drop the RPM while not at home” or “enable boost mode if co2 levels do increase”). However even with the above mentioned python scripts, you could do this (automation to run a python script after something acting as a trigger).

There’s a way to do this. I’ll get around to set it up myself. Previously I did this with a combination of Home Assistant, MQTT and Homey. I’ve moved away from Homey so I need to make it independent of it which I don’t think should be a problem. It’s somewhat hacky but here’s how I did it:

  1. I have a separate Home Assistant-instance on a RPi close to the PAX fan, this is probably unnecessary if you are close enough for the Bluetooth to reach the fan with your original install.
  2. The RPi HA have pycalima installed and set up (GitHub - PatrickE94/pycalima: Python interface for Pax Calima Fan via Bluetooth LE)
  3. I have set up a command line sensor with the following code (i made some changes to the cmdline.py from pycalima to remove some unnecessary things when using the command):
- platform: command_line
  name: PAX_Calima
  command: python3 /home/pi/pycalima/xxx.py
  scan_interval: 180
  1. Then I get a sensor that says “FanState(humidity=xxx, Temp=xxx, Light=xxx, RPM=xxx, Mode=xxx)” that I can then use to publish different data to MQTT. I use automations for example:
topic: garage/sensors/pax_temp
payload_template: '{{ states.sensor.pax_calima | regex_findall_index("Temp(\d+\.\d+)") }}'
  1. Then I make MQTT sensors in my main HA-installation or use it any other way.

Now to change the values I used Homey but I think you can use HA in a similar way. I made an MQTT device that has a state_topic same as the topic I set as fan speed topic. Then I made the /set topic something else (for example the same topic but with added /set).
After this is done I made an automation that monitored the /set topic and sent a SSH command to my garage raspberry pi with pycalima with the following code:

python3 /home/pi/pycalima/cmdline.py -t {{MQTT_SET_TOPIC_VALUE}}

The MQTT value needs to be between 0-2250 because it should correspond to the RPM on the fan.

Has anyone been able to use Calima with home Assistant after HA python was updated to 3.10.

Bluepy does not work anymore with Python 3.10, which why calima.py does not work either.

I do not have experience overall with python, so am not able to convert calima.py to use BlueZ. I did investigate also options to use esp32 board (esphome), but basis of what I understand, esphome does not yet support connecting to devices with pin code, which why connection via esphome is not possible.

I’m trying to get this working in Home Assistant but It looks like code is relying on bluepy which won’t work with python 3.10 as mentioned. Since I hardly know how code I am willing to offer a funding. I really want to integrate my Pax Calima fan to Home assistant and it looks like it’s possible based on previous attempts.

2 Likes

I’m also interested! Willing to offer a funding as well.

2 Likes

Same here!

2 Likes

I’m also interested! Willing to offer a funding

2 Likes

Here is a new functional integration for the Pax Calima fan GitHub - eriknn/ha-pax_ble: Home Assistant component for Pax Calima bluetooth-enabled fans.

3 Likes

Hi Everybody,

I am trying to implement support for this fan for ESPhome. For now, just reading sensors data (temp, humidity, illuminance, and rotation). Can somebody try it with the original Calima fan? I have Vent-Axia Svara which looks like 100% the same device but who knows?
My repo: GitHub - paveldn/esphome-calima

3 Likes