Welcome to Smart Home Forum by FIBARO
Dear Guest,
as you can notice parts of Smart Home Forum by FIBARO is not available for you. You have to register in order to view all content and post in our community. Don't worry! Registration is a simple free process that requires minimal information for you to sign up. Become a part of of Smart Home Forum by FIBARO by creating an account.
As a member you can:
- Start new topics and reply to others
- Follow topics and users to get email updates
- Get your own profile page and make new friends
- Send personal messages
- ... and learn a lot about our system!
Regards,
Smart Home Forum by FIBARO Team
Question
uwuertz 1
I really wanted to integrate my Bluetti EP 500 Pro into Fibaro HC3. Unfortunately, the Bluetti doesn't have a directly accessible API as far as I can see. So I had to get a little creative. And this is how it works:
Step 1: You first need an intermediary between the Bluetti and Fibaro. I use a Raspberry Pi with the latest Raspian for this. The RPi must be able to use Bluetooth and be located near the Bluetti. After the RPi has been booted with a fresh OS and you can log in via SSH, you need to install a service that has been developed by
Please login or register to see this link.
I assume that someone who builds this has the appropriate knowledge to install a RPi, so this is not a guide for absolute beginners, sorry for that.a) Installing the MOSQUITTO MQTT broker. There are thousands of instructions for this, use one of them.
Then adjust the config:
sudo nano /etc/mosquitto/conf.d/local.conf
add:
listener 1883
allow_anonymous true
and restart the service.
b) Installing a Python environment and activating it
sudo apt install python3.11-venv
python3 -m venv Bluetti
source Bluetti/bin/activate
c) Install the dependencies by creating a requirements.txt
pip install -r requirements.txt
where requirements.txt has the following content
bleak==0.14.0
asyncio-mqtt==0.16.2
crcmod==1.7
paho-mqtt==1.6.1
requests==2.25.1
dbus-fast==1.84.0
flask==3.0.3
flask-MQTT==1.2.1
paho-mqtt==1.6.1
gunicorn==22.0.0
dbus-next==0.2.3
bluetti-mqtt==0.15.0
Then the command bluetti-mqtt --scan should generate an output and display the bluetti. If not, check.
d) If this works, a service can be created for it. Change username, IP and MAC also according to the results of the scan!! The IP address is your MOSQUITTO MQTT Broker.
sudo nano /etc/systemd/system/bluetti-mqtt.service
[Unit]
Description=Bluetti MQTT
After=network.target
StartLimitIntervalSec=0
[Service]
Type=simple
Restart=always
RestartSec=30
TimeoutStopSec=15
User=uwuertz
WorkingDirectory=/home/uwuertz/Bluetti
ExecStartPre=/bin/sleep 15
ExecStart=/home/uwuertz/Bluetti/bin/bluetti-mqtt --broker 192.168.100.20 EC:6A:60:88:23:12 --interval 15
[Install]
WantedBy=multi-user.target
and install it:
sudo systemctl daemon-reload
sudo systemctl start bluetti-mqtt.service
sudo systemctl status bluetti-mqtt.service
sudo systemctl enable bluetti-mqtt.service
Final Step:
Install the attached QA file and adjust the IP address in the Variables field.
As soon as SDM_ACTIVE is set to true, the child devices are created. Then the icons of the sensors and switches have to be adjusted by hand, I will make this prettier again at some point. When I have time.
Some other Variables:
You also need the TOPIC entry, in my case this is bluetti/state/EP500P-123456781111. The number is the serial number and must match your Bluetti SN. You can also simply use tools such as MQTT Explorer after installing the MQTT service to see what the entry is called. Because we use a broker and an additional service, there are small delays between pressing a binary switch and the executed action.
VERY IMPORTANT: Please go into the LUA code once in the parent device, insert a space bar somewhere where it won't hurt and save. Maybe this is a bug, but otherwise the binary switches are not processed correctly. Maybe someone from Fibaro can have a look at this.
Use at your own risk, I have written the device myself for my own purposes and the code can be used without any guarantee of completeness and correctness. If you don't want to take any risks, just leave it. Code is still subject to change. You'll have to test for yourself which Bluetti's work. From what I hear, it works for many models. But no guarantee.
Have fun!
Please login or register to see this attachment.
Please login or register to see this attachment.
0 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.