I feel one shouldn’t need to be a tech wizard to make it work.
Maybe, in between, while we wait, an alternative from Bluretti, could be to give more options within the app.
Like,
Set a discharge level, to switch off AC, and another for DC.
A trigger based on SOC level for AC and another for DC, to switch on.
Maybe have a Solar minimum maximum trigger too.
Definitely some history graph of inputs and outputs.
You get the idea. Give us more control.
I am also flumoxed why the bluetooth signal is so weak, and drops off all the time, even standing right next to it.
Happy to try any suggestions, from Bluetti, or others, to find solutions.
Sure, they could put a lot of work in the App. In my opinion, such a API is much easier for them. Instead of note every little feature people want to see, they just provide a API and people build exactly what they need with it.
Well, i did it.
Using this repo. Had to hack around as root a bit on my Pi, but now it seems to work just fine.
here’s the diff of what i have changed
bluetti_mqtt/bluetooth/__init__.py
13c13
< DEVICE_NAME_RE = re.compile(r'^(AC180|AC200M|AC300|AC500|AC60|EP500P|EP500|EP600|EB3A)(\d+)$')
---
> DEVICE_NAME_RE = re.compile(r'^(AC180P|AC180|AC200M|AC300|AC500|AC60|EP500P|EP500|EP600|EB3A)(\d+)$')
30a31,32
> if match[1] == 'AC180P':
> return V2Device(address, match[2], 'AC180P')
Hope this info is of use to someone.
be carefull with root, everything you do is at your own risk
In your case you’re missing the crypthography package.
install it with
pip install cryptography==44.0.0
also make sure you’ve installed all the other packages as listed in the requirements.txt file that came with bluetti_mqtt.
hope that helps
Thanks for that.
I’m sure I installed all the requirments previously, and then, when errors occured, started again, must have missed it second time around.
It got me further.
.
C:\Windows\System32>bluetti-mqtt --scan
Traceback (most recent call last):
File "<frozen runpy>", line 198, in _run_module_as_main
File "<frozen runpy>", line 88, in _run_code
File "C:\Program Files\Python313\Scripts\bluetti-mqtt.exe\__main__.py", line 7, in <module>
sys.exit(main())
~~~~^^
TypeError: main() missing 1 required positional argument: 'argv'
.
I can’t see anything looking like main.py so not sure what’s missing.
Hmmm… Since im no expert in python whatsoever, i dont know what’s wrong there. I would suggest to remove and reinstall the bluetti_mqtt package via pip. maybe that will help you solving the issue.
That’s exactly how I did it.
C:\Windows\System32>pip uninstall bluetti_mqtt
Found existing installation: bluetti-mqtt 0.15.0
Uninstalling bluetti-mqtt-0.15.0:
Would remove:
c:\program files\python313\lib\site-packages\bluetti_mqtt-0.15.0.dist-info\*
c:\program files\python313\lib\site-packages\bluetti_mqtt\*
c:\program files\python313\scripts\bluetti-discovery.exe
c:\program files\python313\scripts\bluetti-logger.exe
c:\program files\python313\scripts\bluetti-mqtt.exe
Successfully uninstalled bluetti-mqtt-0.15.0
C:\Windows\System32>pip install "C:\Program Files\Python313\Lib\site-packages\bluetti_mqtt_main"
Processing c:\program files\python313\lib\site-packages\bluetti_mqtt_main
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... done
Requirement already satisfied: asyncio-mqtt in c:\program files\python313\lib\site-packages (from bluetti_mqtt==0.15.0) (0.12.1)
Requirement already satisfied: bleak in c:\program files\python313\lib\site-packages (from bluetti_mqtt==0.15.0) (0.22.3)
Requirement already satisfied: crcmod in c:\program files\python313\lib\site-packages (from bluetti_mqtt==0.15.0) (1.7)
Requirement already satisfied: paho-mqtt>=1.6.0 in c:\program files\python313\lib\site-packages (from asyncio-mqtt->bluetti_mqtt==0.15.0) (1.6.1)
Requirement already satisfied: winrt-Windows.Devices.Bluetooth<3,>=2 in c:\program files\python313\lib\site-packages (from bleak->bluetti_mqtt==0.15.0) (2.3.0)
Requirement already satisfied: winrt-Windows.Devices.Bluetooth.Advertisement<3,>=2 in c:\program files\python313\lib\site-packages (from bleak->bluetti_mqtt==0.15.0) (2.3.0)
Requirement already satisfied: winrt-Windows.Devices.Bluetooth.GenericAttributeProfile<3,>=2 in c:\program files\python313\lib\site-packages (from bleak->bluetti_mqtt==0.15.0) (2.3.0)
Requirement already satisfied: winrt-Windows.Devices.Enumeration<3,>=2 in c:\program files\python313\lib\site-packages (from bleak->bluetti_mqtt==0.15.0) (2.3.0)
Requirement already satisfied: winrt-Windows.Foundation<3,>=2 in c:\program files\python313\lib\site-packages (from bleak->bluetti_mqtt==0.15.0) (2.3.0)
Requirement already satisfied: winrt-Windows.Foundation.Collections<3,>=2 in c:\program files\python313\lib\site-packages (from bleak->bluetti_mqtt==0.15.0) (2.3.0)
Requirement already satisfied: winrt-Windows.Storage.Streams<3,>=2 in c:\program files\python313\lib\site-packages (from bleak->bluetti_mqtt==0.15.0) (2.3.0)
Requirement already satisfied: winrt-runtime<3,>=2 in c:\program files\python313\lib\site-packages (from bleak->bluetti_mqtt==0.15.0) (2.3.0)
Building wheels for collected packages: bluetti_mqtt
Building wheel for bluetti_mqtt (pyproject.toml) ... done
Created wheel for bluetti_mqtt: filename=bluetti_mqtt-0.15.0-py3-none-any.whl size=44080 sha256=283c6db554679de632842f921ed33badb3cbb5555a42eeb8eea014631b543dec
Stored in directory: C:\Users\micha\AppData\Local\Temp\pip-ephem-wheel-cache-th0tcu25\wheels\08\45\e2\59a23d3fdd112998c5a88405090be030ceb3c3fcc8127608ca
Successfully built bluetti_mqtt
Installing collected packages: bluetti_mqtt
Successfully installed bluetti_mqtt-0.15.0
[notice] A new release of pip is available: 25.0.1 -> 25.1.1
[notice] To update, run: python.exe -m pip install --upgrade pip
C:\Windows\System32>bluetti-mqtt --scan
Traceback (most recent call last):
File "<frozen runpy>", line 198, in _run_module_as_main
File "<frozen runpy>", line 88, in _run_code
File "C:\Program Files\Python313\Scripts\bluetti-mqtt.exe\__main__.py", line 7, in <module>
sys.exit(main())
~~~~^^
TypeError: main() missing 1 required positional argument: 'argv'
C:\Windows\System32>
I’m the same about Python, and not really in the frame of mind to get too involved with it.
But I do appreciate your suggestions.
Did you try using Python 3.9? I think thats what i used last time
The way you install the package looks kinda odd to me.
maybe you could try installing it from github directly?
pip install git+https://github.com/jesherman/bluetti_mqtt
if that doesnt work, you could try to download the zip archive from the above mentioned repo and install it with
pip install /path/to/bluetti_mqtt-main.zip
Thanks again.
Tried the git, thing, had to install git, and went with all the defaults, all of them!
I got the same errors, and so installed Python 3.9.13, the only 3.9 version still available…
I am getting a bit muddled, as, I think the jesherman version, is to be running on the homeassistant machine, or does it not matter? I tried a variation of that method many moons ago, and left it when I got the warhammer version, running on a PC to work. Does the jesherman version also run from/on a windows PC?
I would like to be sure, what I am trying, is actually achievable. Or do I go back to the nhurman one?
Well, this is the version i am running on my home assistant, so i can definitely say it works. it also should run on windows.
i’m out of ideas now. sorry to hear it didnt work, hope you can find a solution
Thanks, for suggestions. It hopefully will eventually lead to a solution. I’ll keep plugging away.
Just filled the form. Let’s see what happens. Actually I just bought a bluetti checking first at the home assistant bluetti2MQTT add on. I could not get it to run on my new AC70P yet though. A clean API might make life easier. I hope this API will be seamless if you connect BT, BT through Proxies (which seems not to work today) and Wifi. The trick that they just played activating encryptions seems to have made life to many more difficult than necessary. In any case such a device that cannot be controlled/supervised is a no go for me. It is cool to have a device to get power on the run but I cannot let it sit doing nothing while I am home and therefore must be integrated UPS some devices and/or increase solar energy own usage. Stopping charging is key for me and do not understand why the AC70P cannot do this. The 3 level of AC charging speed is also limiting: why not setting the ac charging power at the level you actually need (100W granularity would be fine). An efficient AC passthrough when there is enough AC input power to charge and satisfy the AC load but I guess the limit of the AC70P (or is this for all devices) to always run off the inverter is first a hardware issue.
At this time I will return my AC70P and will see if this API will increase the value I can extract of such a device.
Thanks to have suggested this poll.
I would like to have it as well.
Hi, this is great! Where exactly did you make these changes? In the filesystem somewhere?
Yes, i made those changes directly on the Filesystem of my HAOS installation via root accesss.
The files are stored somewhere under /mnt/data/docker/overlay2/.../diff/usr/local/lib/python3.13/site-packages/bluetti_mqtt/bluetooth/__init__.py
the exact location might differ for each installation, so i cant tell you the exact path. you should use find
to locate the __init__.py
python script and then you can edit it using vi
Or when you dont want to get Headache from using vi, than better use nano xD
Hi all,
I’ve been fighting in the past 3 days with my brand new Elite 200 V2 unit to integrate with HomeAssistant. As reported here the data communication channel is now encrypted and the protocol is updated to V2, so all the modbus registers are different now. I’ve forked and extended in the past warhammerkid/bluetti_mqtt to add support for my other unit, AC240, to be able to add the max grid current adjustments. Of course this has been invalidated by the new changes with V2 machines
BTW, I also tried the bluetti crypt lib does not work on my raspiberry PIs, as it’s only available for x86_64.
HOWEVER… thanks for someone who pointed here to the nhurman/bluetti_mqtt repository, I’ve been able to include his changes and its preliminary implementation of the V2 protocol as well, and I spent the past 2 days reverse engineering the new Modbus registers and the protocol in general, and I think I finally have a working version for V2 units and encryption.
Now at least I’m able to switch on ac, dc, eco mode, grid charge and update the max grid charge current from HomeAssistant, and in general the modbus registers are now identified.
If someone is interested, the code it’s here, in the v2devices branch:
I’ve been testing this with my Elite 200 V2, so I cannot tell you if it works with other models too but should be fairly generic.
The updated server in github is also exposing prometheus metrics, for those who are interested.
Hi @desalvo
Thanks for letting us know! The Hassio plugin from Patrick als implement the code from nhurman recently. He is a real goat!
So, sadly but as expected: not much happening here in terms of a cloud or local API. @Bluetti, just to let you know: just did a project for 6 small off-grid holiday housing units, would have done it with Bluetti equipment, but one requirement was data integration into a billing system, so I had to use other stuff. (Can´t sell a hacked bluetooth connection to a commercial customer…)