Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More AC60 fields and AC70 support #79

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

bxm6306
Copy link

@bxm6306 bxm6306 commented May 15, 2023

  • Added 30+ more data fields for the AC60 and B80 devices
  • Removed unused power generation fields based on AC60 test results

Added 30+ more data fields for the AC60
@bxm6306
Copy link
Author

bxm6306 commented May 15, 2023

Sample data extraction using an AC60 prototype.

==2023-05-15 00:30:55.643513 -0400==
{'total_battery_percent': 80, 'estimated_time': 1081, 'device_type': 'AC60', 'serial_number': 2302000074537, 'dc_output_power': 19, 'ac_output_power': 0, 'dc_input_power': 0, 'ac_input_power': 0}
{'device_type': 'AC60', 'serial_number': 2302000074537}
{'num_packs_connected': 1, 'charging_from_internal_dc': False, 'internal_dc_input_power': 0, 'internal_dc_input_voltage': Decimal('0'), 'internal_dc_input_current': Decimal('0'), 'charging_from_pack_dc': False, 'pack_dc_input_power': 0, 'pack_dc_input_voltage': Decimal('0'), 'pack_dc_input_current': Decimal('0')}
{'internal_ac_input_frequency': Decimal('0'), 'internal_ac_input_power': 0, 'internal_ac_input_voltage': Decimal('0.2'), 'internal_ac_input_current': Decimal('0')}
{'total_dc_output_power': 19, 'dc_usb_output_power': 0, 'dc_12v_output_power': 19, 'dc_output_uptime_minutes': 40, 'ac_output_power': 0, 'ac_output_uptime_minutes': 59}
{'ac_output_frequency': Decimal('59.9'), 'ac_output_on': True, 'battery_inputoutput_power': 35, 'ac_output_voltage': Decimal('120'), 'ac_output_amps': Decimal('0.3')}
{'led_mode': <LedMode.OFF: 0>, 'ac_output_on': True, 'dc_output_on': True, 'dc_eco_mode_on': False, 'dc_eco_hours': 4, 'dc_eco_watts': 5, 'ac_eco_mode_on': True, 'ac_eco_hours': 3, 'ac_eco_watts': 13, 'charging_mode': <ChargingMode.STANDARD: 0>, 'power_lifting_on': False}
{'grid_enhancement_mode_on': False}
{'battery_voltage': Decimal('22.95')}
{'battery_type': 'AC60', 'battery_serial_number': 2302000074537, 'battery_voltage': Decimal('22.95'), 'battery_percent': 80, 'bcu_version': Decimal('1030.05')}
{}

bluetti_mqtt/core/devices/ac60.py Outdated Show resolved Hide resolved
bluetti_mqtt/core/devices/ac60.py Outdated Show resolved Hide resolved
bluetti_mqtt/core/devices/ac60.py Outdated Show resolved Hide resolved
@warhammerkid
Copy link
Owner

@bxm6306 I've enabled the automated checks, and it looks like you have a bunch of places where you didn't put a space between the comma and the next value. Those will also need to be addressed before this can be merged. You can see this by clicking on the "Details" button next to the failing "Build distribution / deploy (pull_request)" check.

Also, you might want to add this section to the bottom of the ac60.py file that would allow you to actually control the AC60. You can look at ac300.py to see where this should go:

    @property
    def writable_ranges(self) -> List[range]:
        return [range(2000, 2022)]

Adding missing spaces to structure definitions and added writable address range.
Corrected additional style warnings
Minor field name updates to match MQTT field definitions and added missing address ranges to polling_commands.
Added the following new MQTT fields:
DC USB Output Power
DC 12V Output Power
AC Input Current
AC Eco
DC Eco
Grid Enhancement Mode
Estimated Charge/Run Time

Changed the following MQTT fields to be labeled as normal instead of advanced fields:
AC Input Voltage
AC Input Frequency
@bxm6306 bxm6306 mentioned this pull request Dec 10, 2023
Split out estimated time field because the AC60 reports this field in minutes while the AC70 reports it in hours with 1 decimal place.
Renamed estimated_time to estimated_time_min to reflect the correct unit of measurement.
@bxm6306 bxm6306 changed the title More AC60 fields More AC60 fields and AC70 support Dec 13, 2023
@bxm6306
Copy link
Author

bxm6306 commented Dec 13, 2023

I've added AC70 support to this pull request, 99% of the code was identical to the AC60.

@danricho
Copy link

danricho commented Jan 2, 2024

This is GREAT!
I'm using https://github.com/bxm6306/bluetti_mqtt/commits/patch-2/ with my new AC70.

Thanks heaps for everyone's efforts!

@tripzero
Copy link

What else is needed for this? Would be nice to have ac60/b80 more supported.

@bxm6306
Copy link
Author

bxm6306 commented Mar 10, 2024

What else is needed for this? Would be nice to have ac60/b80 more supported.

Action by @warhammerkid to review the requested changes in the branch. It seems he's currently MIA and I'm not sure if anyone else can assist with merging the changes.

@ZachGoldberg
Copy link

What else is needed for this? Would be nice to have ac60/b80 more supported.

Action by @warhammerkid to review the requested changes in the branch. It seems he's currently MIA and I'm not sure if anyone else can assist with merging the changes.

In the interim, I setup a build for home assistant using bxm6306's fork incase its helpful for anyone who is in the same boat as I am waiting for this to get merged -- https://github.com/ZachGoldberg/bluetti2mqtt

@ftrueck
Copy link

ftrueck commented May 5, 2024

What else is needed for this? Would be nice to have ac60/b80 more supported.

Action by @warhammerkid to review the requested changes in the branch. It seems he's currently MIA and I'm not sure if anyone else can assist with merging the changes.

In the interim, I setup a build for home assistant using bxm6306's fork incase its helpful for anyone who is in the same boat as I am waiting for this to get merged -- https://github.com/ZachGoldberg/bluetti2mqtt

Hey, I made an more advanced fork of the bluetti_mqtt library. I incorporated so far most of the pull requests from all the stuff so far. I would be happy if you would give it a try in your HA addon. That way we could achieve a new addon that would work also for newer devices. I know that this is less ideal then the merge into the main branch of this repo, but at least we could provide sth more working. The URL to my fork is: https://github.com/ftrueck/bluetti_mqtt/

If sth is missing feel free to open a issue in my fork.

@bxm6306
Copy link
Author

bxm6306 commented Sep 2, 2024

Friendly nudge @warhammerkid

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants