API or Web Server power status

Let me know how I can help… I’m would be interested in this ability as well.

One thing I’ve noticed since allowing the AC300’s on my network are warning from my security system about the AC300. It calls it a “Shanghai High-Flying Smart Plug” and says that it’s authentication procedure uses unencrypted (plain text) authentication… this is actually being flagged by my network monitoring as a high risk item.

1 Like

And yet… https://api.bluettipower.com/ exists. There is an API, we just lack the public endpoints to make it usable for us.

I installed the bluetti_mqtt package, but when I try to run the following command I get this error:
bluetti_mqtt --scan

Traceback (most recent call last):
File “<pyshell#8>”, line 1, in
bluetti_mqtt --scan
NameError: name ‘scan’ is not defined

It appears that you’re running this from inside the Python shell, when the command should be run from inside PowerShell or the Command Prompt on Windows. It should also be bluetti-mqtt --scan, without the underscore.

I got your email…

It looks like the variable “bluetti-mqtt” was not mapped in my windows system environment variables. I had to run sysdm.cpl and add the keyword “bluetti-mqtt” to map to the location of the bluetti-mqtt.exe file.

So I see both AC300 after my scan… but is this going through my computers WIFI or Bluetooth?

The Bluetti EP500 Pro does not have the possibility to log data such as the solar energy coming in via solar panels, the additional grid energy at low capacity level, the current consumption or the current capacity in a database.

However, the data logged in a database would allow for a variety of interesting analyses. For example, numerous statistics and interesting graphs can be generated from the data. If I integrate over the logged data in certain time periods, I can calculate the total energy harvested or consumption during that period. This data in turn can be used to calculate monthly statistics or how differently the plant performs in the 4 seasons.

Basically anything can be calculated that is possible with a little SQL and a few tables.

Also a fancy website would be possible, where you can see from anywhere in the world what the energy production and usage at home is doing.

For this reason I developed the Bluetti DB Bridge. An ESP32 based device that makes contact with the Bluetti via Bluetooth, gets the data I mentioned and then some, and transmits it directly via WiFi to a MySQL database located on a Raspberry Pi where it is stored in a table. This was only possible with some initial help about the codes from Chromedshark!

In addition, the Bluetti DB Bridge allows me to display the most important data directly at my workstation!

3 Likes

Absolutely amazing, guys! Looking forward to whatever will be coming out of these efforts :partying_face:

That’s pretty cool! Would you be willing to share the parts list so I could go ahead and try to build one?

I’m running Home Assistant on a Raspberry Pi but I have never done anything with an ESP32 device.

My setup these days basically involves one Raspberry Pi running the MQTT service I wrote in bluetooth range of my AC300+B300 and connected over wifi to my “server” Raspberry Pi running my MQTT broker, Prometheus for data storage, Grafana, and a script I wrote to publish data from the MQTT broker to Prometheus. This gives me pretty charts for monitoring my setup, as well as historical records, which is all I really need at the moment.

3 Likes

You only need a TTGO T-Display and a little bit programming skills.

I have to give props to @Chromedshark I’m using his project. The default setup and integration with Home Assistant allows one to easily gather and chart the data without much manual setup. Pretty much the MQTT integration with HA provides everything needed for decent analysis.

This is from Home Assistant for two EP500Ps with minor customization (top charts are for DC in and bottom for AC out):

If you need to capture into another mysql database, this is also pretty easy to do just with the previously mentioned project. Using a little python script mqttdb.py, you can capture it all into a database. Once you have that you can use Grafana or other utilities to plot anything you like.

Some people may be wondering, how useful is it to plot the data?
For reference, I’m using a few solar panels to charge the batteries, then running the inverter for a few hours a day during sunlight as well as charge back up the batteries until the next day. I’ve learned from the data on the EP500Ps I’ve monitored. The resting voltage you leave the battery charged up at and the way you taper the charge matters at how quickly the battery discharges until the next day. Check out the red and green nightly drops:

Again, much thanks go to @Chromedshark his contirbution is greatly appreciated!

Any chance this could integrate with IFTTT? I posted separately about my interest in triggering grid charging when the Bluetti battery level got too low.

You can already do this (trigger grid charging when battery level becomes predefined low) with the latest release in Home Assistant (no need for IFTTT). Since Home Assistant already supports IFTTT anyway, it’s entirely possible to tie that in if you choose to do something with that anyway.

1 Like

Hi @Chromedshark - wow you did an amazing work!! I just struggle with the server.rb to get the data into my Prometheus db. Can you help with that? Thanks already!!!

hello folks - any new news on this thread? Or other solutions? Seems like a big gap with the Bluetti app and easy to fix.

At current time I use a combination of scheduled AC charging and manually monitoring via the iOS app - then using the remote switch to top it up as needed. (I had issues the last time I accidentally ran it down to 0%)

It would be great to have an IFTTT or SmartThings visibility to battery levels (which would also allow a connection into Amazon Echo, etc).

I too recommend setting up Home Assistant with Bluetti-MQTT. You’ll need to roll up your sleeves a bit but it’s worth it in the end!

That looks great! Thanks for you suggestion

If someone is using Home Assistant, you can also use my integration now which is based on bluetti_mqtt: GitHub - Patrick762/hassio-bluetti-bt: Bluetti Integration for Home Assistant

I also asked Bluetti about more info on the bluetooth addresses they used but got no real answer.

The biggest problem right now is that I cannot add new Bluetti devices since I can’t buy them all. It would be great if there was a way to test the integration on devices that Bluetti provides.

Hello @Chromedshark, nice work - that ‘reverse-engineering’ you do. I tried to follow your instructions and could successfully install pip and python on my manjaro-linux (arch based). So finally I could run:

bluetti-mqtt --scan # CC:DB:A7:46:29:0E
We renamed asyncio-mqtt to aiomqtt and released a version 1.0.0 in the process. This is the last release under the asyncio-mqtt name. You can find the new repository at GitHub - sbtinstruments/aiomqtt: The idiomatic asyncio MQTT client, wrapped around paho-mqtt
Scanning…
Found AC3002318000074592: address CC:DB:A7:46:29:0E

But I do not know what the --broker parameter expexts nor what a MQTT broker generally is at all!
I did install “mosquitto” - but I am not able to get just some simple parameters read vie bluetooth from that AC300.

So: I want to ask that BLUETTI-Company - maybe a manager - not a technican: What the heck! Why don’t you open your specs and describe it into your manual! Please sit togehter and discuss that. I was in my former live alos an embedded software-developer - and I can not (absolutely not) understand, why you make an api secret?! I expect a working REST-API on the ARM-Controlled device. I absolutly don’t like your crazy idea of an app, where I can turn on and of my AC over INTERNET and must register and have a FORUM. You can make all that, but do not FORCE people to an online-registration BUT not describing an API. Thats the wrong way. You BLUETTI should send you marketing-guys and your software-guys to a team-meeting over a weekend, to discuss that. Here is something really going wrong. Look here in the forum, what kind of people buy your product.

Just my two cents. Please think about that - my advise is for free. But your management should read this message.
Ingo Baab