I’ve created small bluetooth <-> mqtt gateway which im using on raspberry pi zero w to get bluetooth status updates / control thermostats that are out of reach from the server that hosts HA. It’s probaly also useful when run on the same computer as HA, because its doing sequential status update / commands to devices, making bluetooth status updates more reliable. I’m not a python programmer so its probably not best python code, but it works stable for me. Maybe someone finds it usefull. There is also support for mysensors configured as serial gateway.
I got this up and running with my EQ3 Bluetooth Thermostats. It’s already been up for a few weeks with no issues. Perhaps when I find some time I will try to implement BT Beacon support.
I plan to extend it with GUID support, but it already has support for listening to broadcasts (beacons) and also for all read+write operations over BT LE.
Thanks for sharing this. I’m not familiar with BT protocols - do you think the Xiaomi Bluetooth Thermostat will work with the BT-MQTT bridge? Or perhaps natively through the eq3btsmart component (can’t tell if this is a brand, proprietary format, open standard, etc.)?
I’d like to add simple, battery-powered physical thermostats that sync/control my HASS virtual thermostats regulating each room (via a combination of window openings, fans, space heaters, duct fans & closures, etc). Certainly not worth buying 3-4 nest/ecobees for this purpose, and I’m considering picking up a handful of basic z-wave thermostats in the $30-$50 range. At ~$15, the Xiaomi platform sounds enticing, but only if it can be integrated (locally, that is).
Without adding support for it, it won’t work. I don’t know that device so not sure how it communicates. EQ3 is name of other thermostat and they are using different protocol for sure.
Thanks @Michal_Ciemiega. I picked one up from China for $12 that will arrive in 2-3 weeks and will try configuring it with a BT-MQTT bridge. At that price it’s worth a shot…
Setting LWT to: hostname/lwt_topic
Traceback (most recent call last):
File "./gateway.py", line 32, in <module>
manager.register_workers(settings['manager']).start(mqtt)
File "/home/pi/bt-mqtt-gateway/workers_manager.py", line 39, in register_workers
module_obj = importlib.import_module("workers.%s" % worker_name)
File "/usr/lib/python3.4/importlib/__init__.py", line 109, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 2254, in _gcd_import
File "<frozen importlib._bootstrap>", line 2237, in _find_and_load
File "<frozen importlib._bootstrap>", line 2226, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 1200, in _load_unlocked
File "<frozen importlib._bootstrap>", line 1129, in _exec
File "<frozen importlib._bootstrap>", line 1471, in exec_module
File "<frozen importlib._bootstrap>", line 321, in _call_with_frames_removed
File "/home/pi/bt-mqtt-gateway/workers/mithermometer.py", line 3, in <module>
from workers.base import BaseWorker
File "/home/pi/bt-mqtt-gateway/workers/base.py", line 11
return '/'.join([self.topic_prefix, *args])
^
SyntaxError: can use starred expression only as assignment target
@Michal_Ciemiega I am struggling to install yaml for raspbian can you help me with correct install for raspbian?
pi@raspberrypi:~/bt-mqtt-gateway $ ./gateway.py
Traceback (most recent call last):
File "./gateway.py", line 9, in <module>
import logger
File "/home/pi/bt-mqtt-gateway/logger.py", line 3, in <module>
import yaml
ImportError: No module named 'yaml'
Install libs from requirements.txt , as stated in readme:
sudo pip3 install -r requirements.txt
It should install correct version of pyyaml and other required libs. What do you mean by no luck after doing install pyYaml ? Maybe you got pyyaml installed via apt-get ? Or something is wrong with pythonpath settings ?