diy solar

diy solar

Monitoring Bluetti Systems

Has anyone looked at doing an Openhab integration?
I now have this working in Openhab 4.0.1. I am using an RPi4 as my Openhab server. I installed Mosquitto on this server. I installed the Bluetti-MQTT package with PIP and followed all the other instructions to configure it. I installed MQTT Broker on this server and a remote server both pointing to the Mosquitto server. My Bluetooth is on the remote RPI 3 with an external BT dongle, as the internal BT was not strong enough to reach my Bluetti AC300. I also installed the Jinja Transformation addon. I searched for new Things using the HomeAssistant MQTT component. It immediately found my Bluetti AC300. I used MQTT Explorer to verify that all the data was coming in as configured. Setup the channels I wanted to see, and everything is working great. Thank you all for the work on this. The documentation is great, and it made it easy to install and configure.

1691786037465.png
 
Hello all,

I have recently bought a second hand AC300 with two B300. And came across this threat. So I also wanted to connect my AC300 to Home Assistant.

I don't like the fact that when I want to control the AC300 by wifi, it first go's unencrypted to Singapore and back. So I installed Python on macbook air running windows 10. And installed the bleutti-mqtt package through pip. All went well.

The only problem I did face was that when I want to try to start the service, the program exited on a error that match was a none type in bluethoot\__int__.py line 28.
So did some digging in the code (I not a python programmer, but can read it well) and this is what I figured out:

The name string in "def build_device(address: str, name: str):" contains the the device name that contains of model and serial number. Only there are 3 characters at the end of this string that care blank. I print the name string to the console with:
print('#' + name + '#')
And the console gives me:
#AC300123456789012345 #
And this is going to conflict with
DEVICE_NAME_RE = re.compile(r'^(AC200M|AC300|AC500|AC60|EP500P|EP500|EP600|EB3A)(\d+)$')

So what I did to make it work on my laptop is to trim the last 3 characters of the string. Only this is not a good fix in my opinion.
my fix isname = name[:-3]
My question is, where are the extra characters coming from?

When I run
bluetti-mqtt --scann
it is giving me the device name without the extra characters.
 
I recently bought a Bluetti AC180. I use a Hubitat (with homeasssitasnt bridge driver) and recently installed Homeassistant on a PI. I have mqtt-broker and bluetti_mqtt running on a Ubuntu 22.04 system.

Initially the bluetti-mqtt would get a fatal exception on startup. I managed to hack a work around for that by copying the ep600.py file to ac180.py and some modifications to load the ac180.py. This at least got to a point where it would send data too homeassistant.

I get two sensors
Battery percentage which is accurate with what I see on the AC180 front panel.
Total power generation with is always zero.

Two numbers Battery range start and end. I do not know what that is supposed to be.

So for now I can at least charge the AC180 when there is excess solar power and when the AC180's battery runs low, controlled via the rule machine in Hubitat. The AC180 for now powers a small aquaponics setup.

So I am looking for ideas on how to further modify the ac180.py to add functionality. I do have a bluetti-logger output but I am not sure that it is telling me.

And the AC180 only allows one device to connect at a time. So if bluetti-logger is running the APP wont connect, and visa versa. That sound like the norm for Bluetti.

Thanks for any advice.
 
Hello all,
maybe you can help me.
I control and monitor a Bluetti AC200MAX via the Home Assistant.
Unfortunately it does not work without problems, from time to time the Home Assistant loses the connection to the AC200MAX.
It also happens rarely that the ADD-ON "Bluetti to MQTT" is not started when booting from the Raspi. But this is not the main problem.

I have set the query interval to 10 seconds, but it is not really better.
When I get no connection at all, I have to restart the HA completely, then the connection is there again.

I don't know where else I can set something.

The Raspi is on the powerbox, so the Bluetooth range should not be a problem.

Technical data.
Home Assistant 2023.8.4 Supervisor 2023.08.1 Operating System 10.5 Frontend 20230802.1 - latest

Rasbeery Pi3 rpi3-64

attached the log file

thank you....
 

Attachments

  • AC200MAX.log.txt
    19.3 KB · Views: 6
  • HA Log.txt
    3.7 KB · Views: 2
Last edited:
Hello all,
maybe you can help me.
I control and monitor a Bluetti AC200MAX via the Home Assistant.
Unfortunately it does not work without problems, from time to time the Home Assistant loses the connection to the AC200MAX.
It also happens rarely that the ADD-ON "Bluetti to MQTT" is not started when booting from the Raspi. But this is not the main problem.

I have set the query interval to 10 seconds, but it is not really better.
When I get no connection at all, I have to restart the HA completely, then the connection is there again.

I don't know where else I can set something.

The Raspi is on the powerbox, so the Bluetooth range should not be a problem.

Technical data.
Home Assistant 2023.8.4 Supervisor 2023.08.1 Operating System 10.5 Frontend 20230802.1 - latest

Rasbeery Pi3 rpi3-64

attached the log file

thank you....

Problem fixed, has taken care of itself.
 
Hi - Having a little trouble connecting Bluetti_MQTT to an AC500.

I have managed installed Bluetti_MQTT and run a scan and tried to connect and tried to run the logger. Errors are indicating a failure to determine the device name, more specifically the code is looking for the characteristic UUID 00002a00-0000-1000-8000-00805f9b34fb which is supposed to determine the device name. This doesn't appear to be a characteristic published by the AC500. I was able to connect to the logger by cloning the git repository and changing the device name UUID to the serial string characteristic of 00002a24-0000-1000-8000-00805f9b34fb. This allowed this characteristic to be found (As it is a published one) and the logger to connect via bluetooth and return data. However there are a lot of dependencies on returning the actual device name when you run the mqtt service. I tried playing around with the code to change this name requirement but to no avail. Has anyone else run into this problem with the AC500 and got it to work?
 
I managed to connect by bypassing the 'name = await self.client.read_gatt_char(self.DEVICE_NAME_UUID)' and name decode. Entered in my device name into the client.py script. At least it is working for now.

I noticed I'm only getting 1 dc_input detail (ie. Total DC input plus one of the mppt controllers). Anyone had any luck in connecting to the second MPPT controller to get the data?
 
Hello all,

I have recently bought a second hand AC300 with two B300. And came across this threat. So I also wanted to connect my AC300 to Home Assistant.

I don't like the fact that when I want to control the AC300 by wifi, it first go's unencrypted to Singapore and back. So I installed Python on macbook air running windows 10. And installed the bleutti-mqtt package through pip. All went well.

The only problem I did face was that when I want to try to start the service, the program exited on a error that match was a none type in bluethoot\__int__.py line 28.
So did some digging in the code (I not a python programmer, but can read it well) and this is what I figured out:

The name string in "def build_device(address: str, name: str):" contains the the device name that contains of model and serial number. Only there are 3 characters at the end of this string that care blank. I print the name string to the console with:
print('#' + name + '#')
And the console gives me:
#AC300123456789012345 #
And this is going to conflict with
DEVICE_NAME_RE = re.compile(r'^(AC200M|AC300|AC500|AC60|EP500P|EP500|EP600|EB3A)(\d+)$')

So what I did to make it work on my laptop is to trim the last 3 characters of the string. Only this is not a good fix in my opinion.
my fix isname = name[:-3]
My question is, where are the extra characters coming from?

When I run
bluetti-mqtt --scann
it is giving me the device name without the extra characters.
I missed your post - I was dealing with the same issue and entered in my device name directly into the code to get around it. I'm not sure what the extra characters are that you are seeing. I have an AC500. I noticed that when I run a scan on MacOS I get my full serial number as the 'name' and when I run the scan from a different OS I get AC500 + the first 4 numbers. I'm not sure on the exact break down but the device name appear to be 'AC500' + the first 4 characters the remainder are a unique identifier to make up the serial.
 
Is it possible to share this data to 2 separate MQTT servers? I have this in my camper for local display when on the road, but I would also like to keep a copy on my primary server at the house. I would like it to sync all updates as long as it sees the primary server. If I am gone and come back, I would like to to bring the primary up to date.
 
Is it possible to share this data to 2 separate MQTT servers? I have this in my camper for local display when on the road, but I would also like to keep a copy on my primary server at the house. I would like it to sync all updates as long as it sees the primary server. If I am gone and come back, I would like to to bring the primary up to date.
Just run bluetti-mqtt twice and use the ip and login data of the second MQTT Broker when you start it the second time.
 
Just an FYI to everyone.. it appears that the latest firmware from Bluetti appears to break the Bluetti-mqtt service.... therefore don't upgrade the firmware of your bluetti at this time.
 
I noticed I'm only getting 1 dc_input detail (ie. Total DC input plus one of the mppt controllers). Anyone had any luck in connecting to the second MPPT controller to get the data?
For my AC300 I created a new entity for PV2 which is the subtraction of the reported PV1 input from the total PV input. Works a treat.
 
Is there a walkthrough on how to set this up? I'm having a hard time following what the chain is supposed to look like. Here's what I'm gathering:
  1. Bluetti (AC300) -> connects over Bluetooth to a Device running BLE + WiFi + the Python scripts found in Bluetti_MQTT
  2. The Device is either a laptop, Raspberry Pi, or ESP32
  3. A MQTT server (broker?) subscribes to the Device. It communicates messages over WiFi (Mosquitto broker?)
  4. These messages are parsed by Home Assistant (through... add-ons?).
  5. Visualization is handled by... ?
  6. Command setting is handled by... ? (turning AC on or off, say)
Anyone have an update as to whether this works with the latest firmware? Can someone post what that version is?
 
Is there a walkthrough on how to set this up? I'm having a hard time following what the chain is supposed to look like. Here's what I'm gathering:
  1. Bluetti (AC300) -> connects over Bluetooth to a Device running BLE + WiFi + the Python scripts found in Bluetti_MQTT
  2. The Device is either a laptop, Raspberry Pi, or ESP32
  3. A MQTT server (broker?) subscribes to the Device. It communicates messages over WiFi (Mosquitto broker?)
  4. These messages are parsed by Home Assistant (through... add-ons?).
  5. Visualization is handled by... ?
  6. Command setting is handled by... ? (turning AC on or off, say)
Anyone have an update as to whether this works with the latest firmware? Can someone post what that version is?
1. yes. When Bluetti is connected to your device, the Bluetti app is no longer capable to connect via bluetooth (only one single BT session is allowed)
2. Or, in my case, a Bananapi Zero
3. Mosquitto locally running running on the device, bluetti-mqtt script also
4. with the MQTT integration
5. Home Assistant
1709554248304.png
6. Home Assistant

1709554176283.png
HTH
 
This can only be done via the app, right?
Yes, I believe so.

(I got it running yesterday with an ESP32 and Bluetooth relay)

I'm in a tough spot. I can't upgrade my AC300 to the latest firmware, so I won't get broken monitoring, but my Wifi is unstable so I can't use the cloud connectivity. I also can't get the whispered about "custom" firmware that remembers output settings when it comes back to life after a battery run-down.

Tough call...
 
@Dorkfind - thanks for the tips! I got it running with this HA module: https://github.com/Patrick762/hassio-bluetti-bt

Right now I can only use the 0.16 version, because the newer ones are for the new "broken" firmware, I believe. Checking into that.

Basically, what I did was:

Prelim:
  1. Get Home Assistant running (I used scripts for Proxmox: https://tteck.github.io/Proxmox/)
  2. Confiture HA - wade through it, but it's WAY better than when I looked ages ago
  3. Get HACS running on HA
  4. Add this Repo to HA: https://github.com/Patrick762/hassio-bluetti-bt
  5. Install Bluetti BT
And Then...
  1. Get an ESP32 from Amazon
  2. Flash it with the ESP32 Bluetooth Bridge
  3. Configure it per instructions
  4. Discover the ESP32 in HA (should show up as a new device discovered automagically)
  5. ... this is where I get confused ... I think Bluetti BT and the Bridge eventually found each other and it started working
From there, you go to Settings -> Devices & Services -> Bluetti BT -> Click on the device ("1 device") link and from there you can add controls or sensors to your dashboard. It even tracked a few watts input from my portable 100w solar panel!

1709575513720.png
 
Back
Top