Patrick762 / hassio-bluetti-bt

Bluetti Integration for Home Assistant
MIT License
44 stars 13 forks source link

Add AC180P support #45

Closed stast1 closed 5 months ago

stast1 commented 7 months ago

Is it possible to add AC180P support?

Logger: homeassistant.config_entries
Source: config_entries.py:406
First occurred: 15:59:42 (1 occurrences)
Last logged: 15:59:42

Error setting up entry AC180P2341000448157 for bluetti_bt
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 406, in async_setup
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/bluetti_bt/__init__.py", line 55, in async_setup_entry
    coordinator = PollingCoordinator(hass, address, device_name, polling_interval, persistent_conn, polling_timeout, max_retries)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/bluetti_bt/coordinator.py", line 153, in __init__
    bluetti_device = build_device(address, device_name)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/bluetti_mqtt/bluetooth/__init__.py", line 28, in build_device
    if match[1] == 'AC200M':
       ~~~~~^^^
TypeError: 'NoneType' object is not subscriptable
Patrick762 commented 7 months ago

The basic sensors should be possible, but at the moment I don't know which of the two protocols it uses

Patrick762 commented 7 months ago

Do you see your Powerstation as PBOX in your Bluetooth devices?

Patrick762 commented 7 months ago

I removed your picture because it contained your SN.

You could try the scan command in bluetti_mqtt. In the results we will see what protocol version it uses.

stast1 commented 7 months ago

This is it? discovery.log

Patrick762 commented 7 months ago

Yes. That's the information I'm looking for. I'll need some time to check it.

I'll hide the file because this also contains personal info.

Patrick762 commented 7 months ago

Seems like it's using V2. I also created a new Script to check which version was used for future devices, if you want to learn how I checked which version it is: https://github.com/Patrick762/bluetti-mqtt-discovery-reader

stast1 commented 7 months ago

Super!

Please check which result matches your Powerstation model below
Result V1: 
Result V2:   AC180P
Patrick762 commented 7 months ago

Sorry, I forgot to add the AC180P in the current beta release. I'll add it in the next (probably next friday if I have some spare time). If you want to do it yourself, just create a new device based on a ProtocolV2Device (AC60 is similar)

Patrick762 commented 6 months ago

I've added basic AC180P support in 0.0.19. Can you test if the values show up?

stast1 commented 6 months ago

Ok, I'll check now

stast1 commented 6 months ago

Only two sensors are displayed: AC180P Total Battery Percent AC180P Total Power Generation

Patrick762 commented 6 months ago

That's expected for now. Those two are the only ones available on all v2 devices

If I have more time, I can look deeper into the discovery log

Patrick762 commented 6 months ago

The biggest problem with v2 devices are the different amounts of inputs and outputs (f.ex. solar: 2 on EP600, 3 on EP760)

I hope Bluetti will send me some info about the address ranges

github-actions[bot] commented 5 months ago

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] commented 5 months ago

This issue was closed because it has been inactive for 14 days since being marked as stale.

kvanonavk commented 2 months ago

Thank you for adding even this basic integration! It helped me to resolve a very critical issue with this device. Anyone can connect to it using Bluetti app and control it using Bluetooth when there is no any other device connected to it. I live in the apartment block and any of my neighbors could connect to my power station and mess with it.

It seems that it's a hardware bug which can't be fixed even with the firmware update. By connecting my home assistant instance to my station using your integration I was able to block other people from connecting to it (I had to set "Persistent connection" mode for this device, hopefully it's OK).

Now I can sleep peacefully and don't think all the time that someone can turn off my station or even worse - turn on the power lifting mode and damage some of my electronics. Thanks again for your work!