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

[Delta 2] Noisy Remaining time estimates #3

Open
taras-sereda opened this issue Jul 2, 2024 · 2 comments
Open

[Delta 2] Noisy Remaining time estimates #3

taras-sereda opened this issue Jul 2, 2024 · 2 comments
Assignees

Comments

@taras-sereda
Copy link

Hi and thanks for this tiny lib!

I'm interested at the moment in the REMAINING_TIME attribute only and observed very noisy estimates for that value. Could it be a bug?

Another question, can you elaborate more on how parsing of the packets work? Is there any specification I can consult?

Here is a code I'm running:

import asyncio
import bleak
from ecoflow import Delta2

async def main():
    mac = "00:00:00:00:00:00"
    ble_client = bleak.BleakClient(mac, timeout=15)
    async with Delta2(ble_client) as dev:

        await dev.start_state_stream(print_state)
        await asyncio.sleep(40)
        await dev.stop_state_stream()

async def print_state(data):
    print("state update...")
    for k, v in data.items():
        print(f"{k} = {v}")
    print("-"*20)

asyncio.run(main())

The output is as bellow:

skipped a data page 69
state update...
StateField.CHARGE_TH_MIN = 0
StateField.CHARGE_TH_MAX = 100
StateField.REMAINING_TIME = Time(hrs=98, mins=59)
--------------------
skipped a data page 123
state update...
--------------------
state update...
StateField.CHARGE_SPEED = 1200
--------------------
skipped a data page 70
state update...
--------------------
skipped a data page 123
state update...
--------------------
skipped a data page 69
state update...
StateField.CHARGE_TH_MIN = 52
StateField.CHARGE_TH_MAX = 80
StateField.REMAINING_TIME = Time(hrs=149, mins=27)
--------------------
skipped a data page 123
state update...
--------------------
skipped a data page 70
skipped a data page 123
state update...
--------------------
state update...
StateField.CHARGE_SPEED = 1200
--------------------
skipped a data page 69
state update...
StateField.CHARGE_TH_MIN = 89
StateField.CHARGE_TH_MAX = 61
StateField.REMAINING_TIME = Time(hrs=334, mins=34)
@anton-ptashnik
Copy link
Owner

Hi @taras-sereda ,
Unfortunately there is no BLE API documented for the device, or at least, I'm not aware of any in open access. Initially I sniffed a couple of requests between Delta 2 and a mobile app which were most stable but now it can be out of date.

Packet structure seems to change from time to time so looking at your logs it seems that some of data items shifted to another place in packet, on instance even these below. MAX definitely should be > MIN but it is not.

StateField.CHARGE_TH_MIN = 89
StateField.CHARGE_TH_MAX = 61

Moreover in recent firmware updates the way of communication establishment was changed so currently I cannot execute any command for my Delta 2 and I do not know an easy way of figuring out how to establish connection.

@taras-sereda
Copy link
Author

Hi @anton-ptashnik, thank you for the reply,

Looks like there is no easy way to talk to the power station :(
It's what it's, thank you for sharing the details.

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

No branches or pull requests

2 participants