API or Web Server power status

Hi @Chromedshark thank you for the response. I’ve managed to take a tcpdump after enabling port mirror on my switch. I’ll DM you the relevant portion and try to help in anyway I can.

The MQTT interface sounds good, REST API would also be good. Hopefully your design can handle multiple units of the same type. I’m curious about the split phase operation modes as well.

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.