Continuing the discussion from Monitoring a Bluetti Power System:
Due to updating to OH 4, I had to update my Bluetti-mqtt Binding. I am currently running 4.2.1 on RPI4 with Bookworm.
I did this with a fresh build, so here are my steps.
Install Mosquitto through Openhabian-config. Configure it as you see fit.
Install the Jinja Transformation.
Add your MQTT Broker to things.
Install Bluetti_mqtt binding using,
$ pip install git+https://github.com/ftrueck/bluetti_mqtt --break-system-packages
Update the path statement. Add /home/openhabian/.local/bin
to both path statements.
$ sudo nano /etc/profile
Now run a scan to see if it sees your Bluetti. It uses Bluetooth to talk to the Bluetti.
$ bluetti-mqtt --scan
Found AC3001234567890123: address 00:11:22:33:44:55
Now add the service file.
$ sudo nano /etc/systemd/system/bluetti-mqtt.service
Add the following using the device address found. Interval is how often to update in seconds. If you have MQTT configured with username and password, you will have to add --username “username” --password “password” before --interval.
[Unit]
Description=Bluetti MQTT
After=network.target
StartLimitIntervalSec=0
[Service]
Type=simple
Restart=always
RestartSec=30
TimeoutStopSec=15
User=openhabian
ExecStart=/home/openhabian/.local/bin/bluetti-mqtt --broker 192.168.1.10 --interval 120 00:11:22:33:44:55
[Install]
WantedBy=multi-user.target
Run these commands to enable and start the service.
$ sudo systemctl daemon-reload
$ sudo systemctl start bluetti-mqtt
$ sudo systemctl enable bluetti-mqtt
At this point, I installed MQTT Explorer on my PC and pointed it to the server. I could see my data coming in from the Bluetti.
After a reboot, it found my Bluetti AC300 in things. I configured all my items.
Power From Solar Panels. The sharp cutoff was when the battery was full.
I used a Label Cell to display these on my Overview Page.
Many thanks to Florian Trück for his work on the MQTT connector.
See this article https://github.com/ftrueck/bluetti_mqtt/