# \[HOW TO\] Advanced Virtual Device for Bluetti devices (need an ESP32)

**URL:** <https://community.homey.app/t/how-to-advanced-virtual-device-for-bluetti-devices-need-an-esp32/112609>\
**Category:** Tutorials\
**Tags:** tutorial, homeyscript, virtual-device, avd\
**Created:** [July 9, 2024, 9:22am UTC](https://community.homey.app/t/how-to-advanced-virtual-device-for-bluetti-devices-need-an-esp32/112609 "2024-07-09T09:22:11Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![diapolon](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/diapolon/32/82612_2.png) [@diapolon](https://community.homey.app/u/diapolon)\
**Post date:** [July 9, 2024, 9:22am UTC](https://community.homey.app/t/how-to-advanced-virtual-device-for-bluetti-devices-need-an-esp32/112609/1 "2024-07-09T09:22:11Z")

</div>

Hi, i created a method for interfacing a Bluetti power station with Homey.  
You need an esp32 with a firmware can bridge bluetooth data to json data  
You can use it for reading value from your power station and populate a virtual device created with Device Capabilities app.  
I have tested it with an bluetti AC200Max and a battery pack  
Actually it only read some info.

**Prerequisites:**

- You need a esp32 with [my fork of Bluetti ESP32 bridge](https://github.com/diapolon/Bluetti_ESP32_JSON_Bridge) for reading data in JSON format. See github url for configure it
- Install “[Device Capabilities](https://homey.app/nl-nl/app/nl.qluster-it.DeviceCapabilities/Device-Capabilities/)” app from the Homey App Store.
- Install [HomeyScript](https://homey.app/nl-nl/app/com.athom.homeyscript/HomeyScript/) app from the Homey App Store

**Step 1: Create a homeyscript for get the power station data (example bluetti\_bridge.js)**

```auto
const b_ip = 'YOUR_ESP32_BRIDGE_IP';
const b_baseurl = 'http://'+ b_ip + '/getData';

function toFixed(num) {
  return Math.trunc((num / 1000) * 100) / 100;    
}

function toFixed2(num) {
  return Math.trunc((num * 100) / 100);    
}

let bluetti = { 'solar_power': '-1', 'home_power': '-1', 'grid_power': '-1', 'battery': '-1', 'ac': 0, 'dc': 0, 'batteries': { 'main': '-1', 'one': '-1', 'two': '-1'} };
try {
  const res = await fetch(b_baseurl);
  if (res.ok) {
    // Get the body JSON
    const data = await res.json();
    //log(data)
    if (data != null) {      
      if (data['dc_input_power'] != null) bluetti.solar_power = toFixed(data['dc_input_power']);
      if (data['ac_output_power'] != null) bluetti.home_power = toFixed2(data['ac_output_power']);
      if (data['ac_input_power'] != null) bluetti.grid_power = toFixed2(data['ac_input_power']);      
      if (data['total_battery_percent'] != null) bluetti.battery = toFixed2(data['total_battery_percent']);
      if (data['pack_battery_percent'] != null) {
        bluetti.batteries.main = toFixed2(data['pack_battery_percent']);
        bluetti.batteries.one = toFixed2((data['total_battery_percent']*2) - data['pack_battery_percent']);
      }
      if (data['ac_output_on'] != null) bluetti.ac = toFixed2(data['ac_output_on']);
      if (data['dc_output_on'] != null) bluetti.dc = toFixed2(data['dc_output_on']);      
    }
  }
} catch (err) {
  bluetti = { 'solar_power': 0, 'home_power': 0, 'grid_power': 0, 'battery': 0, 'ac': 0, 'dc': 0 };
}

if (bluetti.solar_power != '-1') await tag('bluetti_data_solar_power', bluetti.solar_power);
if (bluetti.home_power != '-1') await tag('bluetti_data_home_power', bluetti.home_power);
if (bluetti.grid_power != '-1') await tag('bluetti_data_grid_power', bluetti.grid_power);
if (bluetti.battery_percent != '-1') await tag('bluetti_data_battery', bluetti.battery);
if (bluetti.batteries.main != '-1') await tag('bluetti_data_battery_main', bluetti.batteries.main);
if (bluetti.batteries.one != '-1') await tag('bluetti_data_battery_one', bluetti.batteries.one);
if (bluetti.ac != '-1') await tag('bluetti_data_ac', bluetti.ac);
if (bluetti.dc != '-1') await tag('bluetti_data_dc', bluetti.dc);
     
//log(bluetti);
return true;

```

**Step 2: Create a Virtual Device for your Bluetti power station**

- With app or [my.homey.com](http://my.homey.com) create a new “Device capabilities” device.

**Step 3: Configuring Device Settings**

- Define the capabilities your virtual device will have, you could also import this sample [TEF] String

```auto
[tef:AVD:"H4sIAAAAAAACA42Wa4+qOhSG/8qkyfk0TkBuosn5IPUy6iDe0Tk52SmlXBQotkX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U1rNBs1IGge48uCYRqNv/yVZ0oWEoKwGN0IKlBSYVK+gUl5g8n7U+1UVXlB8U+19JFt5bXta6bKp8SVd/CqzwYnjPrFOaYZueE0QayyqH7DovrGIi4YI5moqrzX++0EqJ8aUD+Con4GRZ2RICFYgBa4HFiBRMFfpv9vY+3lONCMFym9wYijKvgNBNqXCLRPvWlvYWjvMNM+QqB9hkB/PcY5izMc59ejrH/DpP7lKOtvR1l/x4bxWhAnmGY+YnFF3fiGIONLQcZbQcaVoF+157vKs6A2VGTZRiWoAQRa//3/6zccbzq6zAgAAA==":/tef]

```

**Step 4: Populate the virtual device with a flow**

This is a implementation sample, you can suggest optimization or fix 🙂

---

<div class="post-metadata">

**Author:** ![chaosrain](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/chaosrain/32/80977_2.png) [@chaosrain](https://community.homey.app/u/chaosrain)\
**Post date:** [November 29, 2024, 9:00pm UTC](https://community.homey.app/t/how-to-advanced-virtual-device-for-bluetti-devices-need-an-esp32/112609/2 "2024-11-29T21:00:22Z")

</div>

How do you get this working with AsyncElegantOTA deprecated?

---

<div class="post-metadata">

**Author:** ![diapolon](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/diapolon/32/82612_2.png) [@diapolon](https://community.homey.app/u/diapolon)\
**Post date:** [November 30, 2024, 9:03am UTC](https://community.homey.app/t/how-to-advanced-virtual-device-for-bluetti-devices-need-an-esp32/112609/3 "2024-11-30T09:03:17Z")

</div>

Hi, i have only forked an existent project and add some things, elegantota are in main project

This are my first esp32 experience… Now i known more the ambient and i can rewrite project

---

<div class="post-metadata">

**Author:** ![diapolon](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/diapolon/32/82612_2.png) [@diapolon](https://community.homey.app/u/diapolon)\
**Post date:** [November 30, 2024, 5:04pm UTC](https://community.homey.app/t/how-to-advanced-virtual-device-for-bluetti-devices-need-an-esp32/112609/4 "2024-11-30T17:04:45Z")

</div>

I have update project and removed deprecated libraries

---

<div class="post-metadata">

**Author:** ![Pappiedappie](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/pappiedappie/32/99376_2.png) [@Pappiedappie](https://community.homey.app/u/Pappiedappie)\
**Post date:** [June 26, 2026, 11:46am UTC](https://community.homey.app/t/how-to-advanced-virtual-device-for-bluetti-devices-need-an-esp32/112609/5 "2026-06-26T11:46:55Z")

</div>

Any progress here? I’ve a Bluetti AC180P and I’m trying to communicate with it through an ESP32. Tried different things with help of AI but cann’t get it working. Can anyone help me?

Thanks in advance

---

<div class="post-metadata">

**Author:** ![Peter\_Kawa](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/peter_kawa/32/173848_2.png) [@Peter\_Kawa](https://community.homey.app/u/Peter_Kawa)\
**Post date:** [June 26, 2026, 1:05pm UTC](https://community.homey.app/t/how-to-advanced-virtual-device-for-bluetti-devices-need-an-esp32/112609/6 "2026-06-26T13:05:53Z")

</div>

You def should check out the current ESPhome Controller app.  
De developer is very helpful and keen on getting things to work.

> [@\[APP\]\[Pro\] Esphome Controller App](https://community.homey.app/t/150421):
>
> Hello everyone, I have developed an application to add Esphome devices to Homey Pro and released a test version. When adding an Esphome device, give the device a name, enter its IP address and Encryption Key information. I hope you like the app and look forward to your feedback! I will try to respond to all requests as quickly as possible, but since I have a regular job, I will try to resolve issues as quickly as possible. PayPal Support: If you like my work and want to buy me a coffee: [Pay…](http://paypal.me/ugrbnk)

> **[ESPHome Controller | Homey](https://homey.app/en-us/app/com.ugrbnk.esphome/ESPHome-Controller/)**
>
> Your DIY devices, seamlessly integrated

---

<div class="post-metadata">

**Author:** ![Pappiedappie](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/pappiedappie/32/99376_2.png) [@Pappiedappie](https://community.homey.app/u/Pappiedappie)\
**Post date:** [June 26, 2026, 1:18pm UTC](https://community.homey.app/t/how-to-advanced-virtual-device-for-bluetti-devices-need-an-esp32/112609/7 "2026-06-26T13:18:32Z")

</div>

Thanks, I’ll do that.

---

<div class="post-metadata">

**Author:** ![Gabriel\_Pedrosa\_Mach](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/gabriel_pedrosa_mach/32/176567_2.png) [@Gabriel\_Pedrosa\_Mach](https://community.homey.app/u/Gabriel_Pedrosa_Mach)\
**Post date:** [October 11, 2026, 1:02pm UTC](https://community.homey.app/t/how-to-advanced-virtual-device-for-bluetti-devices-need-an-esp32/112609/8 "2026-10-11T13:02:35Z")

</div>

For anyone finding this thread: there is now a native community app for BLUETTI — no ESP32 needed for units that are connected to Wi-Fi in the BLUETTI app.

It reads battery level, solar/grid input, AC/DC output and remaining time through the BLUETTI cloud (with real-time updates), can switch AC/DC outputs, and has an optional Bluetooth fallback for when Wi-Fi or the cloud is down.

So far it’s only tested with an Elite 30 V2. Units that only have Bluetooth (no Wi-Fi) aren’t supported yet. @Pappiedappie, if your AC180P is on Wi-Fi in the BLUETTI app, it would be great to hear whether it shows up.

- App (test): [BLUETTI | Homey](https://homey.app/a/com.gpm.bluetti/test/)
- Topic: [[APP][Pro] BLUETTI – Power stations via BLUETTI cloud](https://community.homey.app/t/app-pro-bluetti-power-stations-via-bluetti-cloud/160644)

---

<div class="post-metadata">

**Author:** ![Pappiedappie](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/pappiedappie/32/99376_2.png) [@Pappiedappie](https://community.homey.app/u/Pappiedappie)\
**Post date:** [October 11, 2026, 3:01pm UTC](https://community.homey.app/t/how-to-advanced-virtual-device-for-bluetti-devices-need-an-esp32/112609/9 "2026-10-11T15:01:00Z")

</div>

Hallo Gabriel,

Sadly the BLUETTI AC180P has nog WiFi on board. It should made it a lot easier for me. So far no succes for getting usefull information extracting from the BLUETTI 🙂🙂

---

<div class="post-metadata">

**Author:** ![Gabriel\_Pedrosa\_Mach](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/gabriel_pedrosa_mach/32/176567_2.png) [@Gabriel\_Pedrosa\_Mach](https://community.homey.app/u/Gabriel_Pedrosa_Mach)\
**Post date:** [October 13, 2026, 1:31am UTC](https://community.homey.app/t/how-to-advanced-virtual-device-for-bluetti-devices-need-an-esp32/112609/10 "2026-10-13T01:31:34Z")

</div>

Hi Pappiedappie,

Thanks for checking! That explains it. Pairing in this app goes through the BLUETTI cloud, and the AC180P never shows up there without WiFi.

The good news: the app already has a read-only Bluetooth fallback that handles BLUETTI’s encrypted protocol, and the AC180P appears to use the same register layout as the Elite 30 V2. What’s missing is a way to pair a device over Bluetooth only, without the cloud. That would give you battery level, input/output power and time remaining. You wouldn’t be able to switch the outputs on or off.

I can’t test it myself since I don’t own an AC180P. Would you be willing to try a test version if I add Bluetooth-only pairing? Your Homey would need to be within Bluetooth range of the AC180P, and the BLUETTI phone app must not be connected to it at the same time.

Cheers,  
Gabriel

---

<div class="post-metadata">

**Author:** ![Pappiedappie](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/pappiedappie/32/99376_2.png) [@Pappiedappie](https://community.homey.app/u/Pappiedappie)\
**Post date:** [October 13, 2026, 5:22am UTC](https://community.homey.app/t/how-to-advanced-virtual-device-for-bluetti-devices-need-an-esp32/112609/11 "2026-10-13T05:22:57Z")

</div>

Hello Gabriel, thanks for your answer. That’s great, I really like to do that. There’s only a small issue, I’ve little time due to my work currently. That’s also the reason I stopped with my project with the ESP32. If you don’t mind the time, then I’m sure willing to help you with that.
