This is a homemade Bluetooth to MQTT Gateway, I use it to control BLE Lights and monitor a thermometer for my Homeassistant installation. It's going to grow with the devices I'm gonna buy.
python BluetoothGateway.py
and that's all.
- Awoxpy
- Bluepy
- paho-mqtt
{
"user": "Your_MQTT_Username",
"password": "Your_MQTT_password",
"host": "Your_MQTT_host",
"ca_cert":"Path/To/Your/certificate (If you have one)",
"devices": [
{
"mac": "BTLE Mac",
"type": "xiaomiht",
"refresh" : 300
},
{
"mac": "BTLE Mac",
"type": "awoxaroma"
}
]
}
- xiaomiht : http://bit.ly/XMF_XMST
- Battery level, temperature, humidity in json format are reported every
refresh
seconds on topicsensor/{device_MAC}
- Battery level, temperature, humidity in json format are reported every
- awoxaroma : http://www.awox.com/awox_product/aromalight/
- turn ON/OFF with payload
ON
orOFF
on topiclight/{device_MAC}/state/set
- Change brightness level with payload
1 to 127
on topiclight/{device_MAC}/brightness/set
- Change white temperature with payload
153 to 500
on topiclight/{device_MAC}/white/set
- Change the color with payload
(0 to 255),(0 to 255),(0 to 255)
(Red,Green,Blue) on topiclight/{device_MAC}/color/set
- After each change, it report it state on the topic without the
/set
part.
- turn ON/OFF with payload
- Clean component loading.
- Improve refresh time algorithm.
- Make Awox Aroma fan working.
Home assistant : https://www.home-assistant.io/
BLEA : https://www.jeedom.com/forum/viewforum.php?f=157