Eqiva eQ3 Bluetooth Thermostat as the HomeKit device

I decided to upgrade my Homekit with another group of devices — thermostats for heating control. After doing some researches, I found this device:
It looks good (maybe not as good as Netatmo or Tado) and the price is fair enough.
I also found homebridge-eq3ble plugin:
But unfortunately this plugin doesn’t work on iOS 13. That is why, I decided to create my own one.
Here is my PoC how to make this device Homekit enabled.
I would like to add, that I’m testing this code and I have to say, that it’s working quite good. I cannot take responsibility for any malfunctioning of the following instructions — you do it at your own risk.
Installation
1. I decided to use node 8.8.0 version:
curl -o node-v8.8.0-linux-armv6l.tar.gz https://nodejs.org/dist/v8.8.0/node-v8.8.0-linux-armv6l.tar.gz
tar -xzf node-v8.8.0-linux-armv6l.tar.gz
sudo cp -r node-v8.8.0-linux-armv6l/* /usr/local/
node -v
npm -v
homebridge-web-thermostat (more below) warns, that you need node 12.x but 8.x works fine also.
2. You have to install eQ3-radiator-thermostat:
git clone https://github.com/Heckie75/eQ-3-radiator-thermostat.git
cd eQ-3-radiator-thermostat
npm install
3. Install expect to run the above code:
sudo apt install expect
4. Open Bluetooth and connect to your thermostat (this has to be done only once when setting up the device and repeat if you want to add another thermostat to your HomeKit). You have to find your thermostat on the list.
sudo bluetoothctl
agent on
scan on
pair XX:XX:XX:XX:XX:XX
Replace XX:XX:XX:XX:XX:XX by your thermostat Bluetooth address.
5. Whole communication is based on the localhost server — that’s why we need to install Apache2 and PHP:
sudo apt-get install apache2
sudo apt-get install php libapache2-mod-php
6. Now we need very simple API in PHP to control our thermostat (to get and set temperature) — some good example of PHP usage with this thermostat can be found here:
First create .htaccess file:
cd /var/www/html
sudo mkdir eq3
sudo nano .htaccess
Here is the code:
sudo nano index.php
And here is the code for index.php:
One important thing regarding index.php:
Replace this part XX:XX:XX:XX:XX:XX by your Bluetooth address using — instead of : — example:
11:22:33:44:55:66 -> 11–22–33–44–55–66
This allows you to add more devices with different Bluetooth address (currently I have only one thermostat so I haven’t tested above solution with more than one device, but from the code point of view, everything should be ready).
7. Now let’s enable mod_rewrite in PHP:
sudo a2enmod rewrite
sudo nano /etc/apache2/sites-available/000-default.conf
And add this to the end of the file:

More details can be found here:
8. Install homebridge-web-thermostat plugin:
sudo npm install -g homebridge-web-thermostat
9. Add this configuration to your config.json file:
10. Set your device to Manual mode (using Calor BT mobile app) — this allows you to create your own Automation in the Home app.
Now it’s time to restart your Raspberry Pi and run the Homebridge.
BOOM, you have eqiva eQ3 thermostat in your HomeKit :-)
Modes description

- OFF — switched off thermostat (you can use this mode to do the automation in Home app);
- HEAT — sets thermostat to manual mode (you can use this mode to do the automation in Home app);
- COOL — sets thermostat to manual mode, Home app sets this state when the temperature is below 20 °C (you can do automation via Home app using this mode);
- AUTO —sets thermostat to auto mode and temperature is also sets automatically (you can define auto mode temperatures in Calor BT app or directly on your thermostat).
What is working fine:
- You can set the temperature between 5 and 29 °C;
- Auto / Manual Mode;
- Home app identifies 4 states of the thermostat: OFF / HEAT / COOL / AUTO;
- You can do the automation with other devices using Home app.
What doesn’t work:
- You can’t check current room’s temperature — this device doesn’t have external thermometer;
- Vacation mode (this can be set using Calor BT app + Auto state in Home app);
- Battery indicator;
- ???.
Calor BT
Here is some screens showing my default settings in calor BT app (default Bluetooth app to control your Thermostat).
I decided to reset almost all settings in this app and use Home app to do my daily schedules and automation with other devices. For me it’s more convenient.
Week program:

Basic temperature reset to 17 °C:

Your thoughts and comments are appreciated :-)
