HomeAssistant Custom Component for CometBlue/Xavax/Sygonix Bluetooth Thermostats. Based on work of mirko located on Github
- HomeAssistant
- RaspberryPi v3
- cometblue Python library from Github
Feature | Get | Set |
---|---|---|
Mode | ✔️ | ✔️ |
Childlock | ✔️ | ✔️ |
Target Temperature | ✔️ | ✔️ |
Current Temperature | ✔️ | ✔️ |
Open Window Detection | ✖️ | ✖️ |
Holiday | ✖️ | ✖️ |
Battery Level | ✔️ | ➖ |
Low Battery | ✔️ | ➖ |
Model | ✔️ | ➖ |
Manufacturer Name | ✔️ | ➖ |
Firmware Rev. | ✔️ | ➖ |
Software Rev. | ✔️ | ➖ |
Warning: If you are using venv for running hass as I do, You will probably want to shoot your brain out of your head during installation steps 😉 . Just like I did when I was creating this installation procedure.
There are several steps that you will have to execute as pi/root user on the other hand some steps are better executed as homeassistant user in venv (if you are using venv, of course). Such commands will be preceeded by string (homeassistant)$
. Otherwise execute commands as pi/root.
-
Installation of cometblue Python library You should install git if you didn't already.
$ apt install git -y (homeassistant)$ cd /tmp (homeassistant)$ git clone https://github.com/xrucka/cometblue.git (homeassistant)$ cd cometblue
-
Follow original installation procedure at: https://github.com/xrucka/cometblue#installation
-
Install Dbus and some depencies for PyGObject if you didn't already
$ apt install python3-dbus libglib2.0-dev libgirepository1.0-dev libcairo2-dev
Dbus will be installed globally but in case you are running hass in venv you will need to copy dbus folder and some other files to venv site-packages location
$ locate dbus ... /usr/lib/python3/dist-packages/_dbus_bindings.cpython-35m-arm-linux-gnueabihf.so /usr/lib/python3/dist-packages/_dbus_glib_bindings.cpython-35m-arm-linux-gnueabihf.so /usr/lib/python3/dist-packages/dbus ...
Copy at least theese two files and one folder to
/srv/homeassistant/lib/python3.5/site-packages/
and change ownership to homeassistant userOr you can just use
--system-site-packages
switch when you are creatingvenv
. If you havevenv
already created and you want to use system site packages, you can always remove the fileno-global-site-packages.txt
from yourvenv
location. More info in venv docs. Thanks to @danielkucera to point that out.cp -r /usr/lib/python3/dist-packages/{dbus,_dbus_bindings.cpython-35m-arm-linux-gnueabihf.so,_dbus_glib_bindings.cpython-35m-arm-linux-gnueabihf.so} /srv/homeassistant/lib/python3.5/site-packages/
-
Install PyGObject
(homeassistant)$ pip3 install pygobject
-
If you are using venv in you HA installation you have to allow
homeassistant
user to use bluetooth dbus so add this:<policy user="homeassistant"> <allow send_destination="org.bluez"/> </policy>
to config file
/etc/dbus-1/system.d/bluetooth.conf
But you should add it before default
deny
section.<policy context="default"> <deny send_destination="org.bluez"/> </policy>
Restart bluetooth.service
$ systemctl restart bluetooth.service
-
Checkout latest version of cometblue module to your HA config path. If you followed HA recomendations it could be done by this command:
(homeassistant)$ cd /home/homeassistant/.homeassistant/custom_components/ (homeassistant)$ git clone https://github.com/Hy3n4/ha-cc-cometblue cometblue
At this moment you have to change ownership of downloaded files!
-
Copy dbus folder from it's original location (this issue is discussed here)
-
Create HA config file
climate: - platform: cometblue devices: living_room_left: mac: DE:AD:BE:EF:23:42 #pin: 0000 # default living_room_right: mac: DE:AD:BE:EF:42:23 pin: 1234
-
Check config within Home Assistant and restart HA
https://github.com/xrucka/cometblue
This readme file ;) Posibly make it a supported part of HA??
If you encounter any problem you should look into hass logfile located in config dir. If there is no useful information turn on debugging in hass config.
logger:
default: warning
logs:
homeassistant.components.climate: debug
custom_components.climate.cometblue: debug
cometblue.device: debug
Special thanks to mirko for his work on Github