Thanks it runs .. but this is only a forecast for my location right ?I thought you intercept the real values and add them up@Cernu I’m using this integration: https://www.home-assistant.io/integrations/forecast_solar/
Glad it worked for you!
Thanks it runs .. but this is only a forecast for my location right ?I thought you intercept the real values and add them up@Cernu I’m using this integration: https://www.home-assistant.io/integrations/forecast_solar/
Glad it worked for you!
I tried to install that on an Intel NUC native Installation of HA and get the following error message when I try to test the script from the command line.
[core-ssh shell]$ chmod +x install start bluetti mqtt.sh
[core-ssh shell]$ .//install start bluetti matt.sh
.//install start bluetti mqtt.sh: line 2: pip: command not found
nohup: appending output to nohup.out
2 Questions.
1. Is that a limitation of HAOS that it cannot run/test the script with the "pip install bluetti_mqtt" via command line but that would work during a reboot ?
2. does the id in the first line of the automation.yaml have to match the device-id or ist it just an id which have to be unique within the automation.yaml ?
Thanks
UPDATE:
Just configured everything as described in the post and restarted HA and it works immediately !!!!!
Now I don't need the Raspberry PI and can use it for something else.
Everything of the Bluetti_MQTT Installation runs on the Intel NUC.
Great Job, THANKS !!!!
Hi Cernu,Big thanks for your short guide, it works for my AC200Max. But a question, how you get the Estimated Energy Production Today in your Dashboard ? i am new in home assistant and with the bluetti-mqtt integration i only get the total battery, dc in/out, ac in/out and the two switches .. thanks for your help
Thanks for that, if i add the lines in the py the service doesnt starts anymore. maybe it is not possible for the ac200max and generate an error ?Hi Cernu,
you have to edit mqtt_client.py and add following lines within async def _handle_message(self, client: Client, msg: ParserMessage):
if 'power_generation' in msg.parsed:
await client.publish(
topic_prefix + 'power_generation',
payload=str(msg.parsed['power_generation']).encode()
)
@chromedshark - maybe/please can you add this in your git repository
Let me get this correct... You're runing HA OS and you were able to install the bluetti-mqtt service inside of HA? Can you create multiple instances? As I have four units to track?Really appreciate getting all this started @chromedshark and others!
For anyone looking for a super simple way to integrate into HA OS (Home Assistant Operating System), here's the cleanest, lowest code route I've found:
Find your device ID: I did this by getting into the HA OS host, then Docker instance, then manually installing bluetti_mqtt (pip install bluetti_mqtt) and running the --scan command (there's likely an easier way to do this).
Setup MQTT (if you haven't yet): Follow directions here - https://www.home-assistant.io/docs/mqtt/broker/ (including user/password combo)
Create script/shell_command integration: I created a new directory in /config/ called "shell" and placed a new script called install_start_bluetti_mqtt.sh in it. Inside that script (replace USERNAME, PASSWORD, DEVICE_ID with yours):
#!/bin/bash pip install bluetti_mqtt nohup bash -c "bluetti-mqtt --broker 127.0.0.1 --username USERNAME --password PASSWORD DEVICE_ID &"
Once that's in there, add this to the root of your configuration.yaml:
shell_command: install_start_bluetti: bash /config/shell/install_start_bluetti_mqtt.sh
Setup automation: Super simple automation that trigger's on HA start (can create with the GUI in Settings>Automations>Create Automation):
Note: the "id" value here has no connection to the DEVICE_ID, it's auto-generated by HA when creating a new automation
- id: '1665937079543' alias: Install and start bluetti-mqtt on HA start description: '' trigger: - platform: homeassistant event: start condition: [] action: - service: shell_command.install_start_bluetti data: {} mode: single
-
Have this up and running for my WIP AC300+2xB300+2xPV350 build - running HA OS 9 on a Raspberry Pi 3. Obviously a temp solution, but working well for now! Going to dig into HA OS 9+ BT support and see if I can help further a native HA integration.
I believe my hacky shell_command solution with nohup sends logs into the ether with HA OS unfortunately . Looking into how to send those somewhere easily reachable.Unfortunately it only worked for a short time, after some time none of the values gets updated anymore.
Where can I find an info what could have caused the freeze ?
Yup! As I mentioned, it's a very hacky/temp solution and doesn't "natively" integrate with HA OS, but it has held up for my setup over the past week or so. Hoping to get some time soon to help out @chromedshark with the HA integration (https://github.com/warhammerkid/bluetti_ha).Let me get this correct... You're runing HA OS and you were able to install the bluetti-mqtt service inside of HA? Can you create multiple instances? As I have four units to track?
This would be great, as I'm currently running it on a Raspberry PI instance.
Huh, looking at the Home Assistant add-on system, it probably wouldn't be that difficult to build a configurable add-on that runs bluetti-mqtt as a service, so you'd get logs, configurability, and automatic restarting. It's not anywhere close to what a native "integration" can provide, but that's significantly more effort. If I have time this weekend I might put up a simple add-on repo.I believe my hacky shell_command solution with nohup sends logs into the ether with HA OS unfortunately . Looking into how to send those somewhere easily reachable.
I still strongly recommend tracking multiple units with one "instance". It's easier, and should provide better bluetooth polling performance as well. You can list as many devices as you want to track:Can you create multiple instances? As I have four units to track?
bluetti-mqtt --broker 192.168.0.0 00:11:22:33:44:55 00:11:22:33:44:66 00:11:22:33:44:77 00:11:22:33:44:88
I still strongly recommend tracking multiple units with one "instance". It's easier, and should provide better bluetooth polling performance as well. You can list as many devices as you want to track:
Code:bluetti-mqtt --broker 192.168.0.0 00:11:22:33:44:55 00:11:22:33:44:66 00:11:22:33:44:77 00:11:22:33:44:88
How do i get this beautiful reports in HA ?I signed up to say thank you for the code and discussion. It works great and it adds so much to the functionality of the AC300. The phone app leaves a lot to be desired.
I set it up on a NUC and it ran flawlessly for a few days and now I've moved it over to a low power pi. So far I haven't had a dropped connection or any hiccups at all.
I had issues installing it but was able to use the post history here to install the bleak dependency.
I'm hoping it will run unattended for a few years.
View attachment 118617
sag
You have to convert the Power to Energy, then you can select it in the Energy Panel Config.Hi rather I am interested in how I get the data as an entity to the energy panel because in my konfig is a 800W balcony power plant and I would like to have the 1600 watt solar panels that are attached to the Blutet including the battery in the energy display, who has already done something in this direction?
At the moment only the displays run in the panel looks nice I also like better than forever to look at the phone
It's a custom SVG grapher. I need to use bluetti-mqtt to post to an MQTT broker then another service/program to subscribe to the broker and post the data I want to a SQL database, and then a website that uses a hierarchical config file to browse select data in the database. The code is ugly though so it's not something I've ever shared.How do i get this beautiful reports in HA ?
Hi MrGPS, thx for the Tipp I take your entries and changed the Sensors . My sensor names are for the PV Input sensor.ac300_dc_input_power and for the AC Output sensor.ac300_ac_output_powerYou have to convert the Power to Energy, then you can select it in the Energy Panel Config.
I added the following to the configuration.yaml of my HA, if you don't have a EP500Pro, then you have to change the source names to match what the Bluetti_MQTT creates for your Type.
#My Sensors:
sensor:
# EP500Pro Convert Power to Energy
- platform: integration
source: sensor.ep500p_dc_input_power
name: EP500Pro_PV_IN_Energy
unit_prefix: k
round: 2
- platform: integration
source: sensor.ep500p_ac_output_power
name: EP500Pro_AC_OUT_Energy
unit_prefix: k
round: 2
I am also new to HA, it worked for me. The new sensors showed up in the main window and i added them manually to the Energy Tab.Hi MrGPS, thx for the Tipp I take your entries and changed the Sensors . My sensor names are for the PV Input sensor.ac300_dc_input_power and for the AC Output sensor.ac300_ac_output_power View attachment 118667
In the Energy Board after restart I have the 2 entities in but no data comes from there
and in the Device> Enities are now
is this on your side the same orhave you assign a uniqueID ? Sry for the Questions im a beginner with HA
You have to convert the Power to Energy, then you can select it in the Energy Panel Config.
I added the following to the configuration.yaml of my HA, if you don't have a EP500Pro, then you have to change the source names to match what the Bluetti_MQTT creates for your Type.
#My Sensors:
sensor:
# EP500Pro Convert Power to Energy
- platform: integration
source: sensor.ep500p_dc_input_power
name: EP500Pro_PV_IN_Energy
unit_prefix: k
round: 2
- platform: integration
source: sensor.ep500p_ac_output_power
name: EP500Pro_AC_OUT_Energy
unit_prefix: k
round: 2
I also have the AC200Max and a setup with bluetti-mqtt, Mosquitto, Telegraf and Grafana which just works fine. Only current downside is: As long as the Raspberry is connected via Bluetooth, I can' connect with the Bluetti app to turn AC on/off as the Bluetti can only be connected to one device at a time.Fantastic job ! I operate a Bluetti AC200MAX and i monitor the device with a Raspberry Pi 3 and this software. I run bluetti-mqtt as a service in systemd with the
Thanks for the info, it was working for me without unique_id and it is optional according to the user manual, but to be on the safe side I also added a unique_id.How does this work? Does it convert the original sensor to KWH?
UPDATE:
I answered my own question after looking it up:
sensor:
- platform: integration
unique_id: ac300_a_total_dc_input_power
source: sensor.ac300_dc_input_power_2
name: "AC300-A TOTAL DC INPUT POWER"
unit_prefix: k
unit_time: h
@chekey you need to add "unique_id" to anything you add for the front UI to be able to interact with it.