thanks dietah for your post . Unfortunately I have problems with the deployment.
I’m using a Raspi 4B with Raspberry Pi OS (64-bit). On the Raspi, there are running OH and MQTT containers. I’m using Portainer for container administration. I have connected a z-Wave USB-stick and the EnOncean Pi module on GPIO of the Raspi. My plan is to use the internal Bluetooth interface on the Raspi to control Switchbot switches.
I tried the following according to your readme. I am listing everything in detail as I am still quite a beginner:
- Installing of the necessary Bluetooth libraries => worked well
sudo apt-get install bluetooth bluez libbluetooth-dev libudev-dev
- Read out Bluetooth interface (i have changed Bluetooth to mini-UART because of the EnOcean Pi on the GPIO):
root@*******:~# ls -l /sys/class/bluetooth
lrwxrwxrwx 1 root root 0 10. Aug 01:19 hci0 -> ../../devices/platform/soc/fe215040.serial/tty/ttyS0/hci0
As far as I understand, Bluetooth is now on device /ttyS0/hci0
- Own directory created for the switchbot container
- The docker-compose.yml is created in it (mode privileged: true and network_mode: host added):
- Apply the container with:
docker-compose -f docker-compose.yml up -d
The switchbot container is running well according to Portainer. Unfortunately, I still don’t see any incoming topics from the Switchbot switch in the MQTT Explorer
I have also checked Bluetooth connections with
The switchbot switches are listed and have good RSSI values. So I think that the Bluetooth connection generally works.
- In OH I created a generic MQTT thing, created an on-off switch as a channel and adapted the code for the value to be transferred:
- id: Switchbottest
off: switchbottest/switch/xx:xx:xx:xx:xx:xx/set off
on: switchbottest/switch/xx:xx:xx:xx:xx:xx/set on
The topic with the values arrives correctly at the MQTT broker.
Unfortunately, the Switchbot switch is not responding. Anyone have any ideas what could be wrongly configured? Are the topic settings in the .yml correct? Should the Switch also send it’s status (battery, linkquality) after operate with the Switchbot app?