ha-ef-ble icon indicating copy to clipboard operation
ha-ef-ble copied to clipboard

Invalid Reserve Settings

Open Pyroserenus opened this issue 3 months ago • 4 comments

If a user sets Reserve and Minimum charge to the same value the AC will cut out before the passthrough enables due to the spread range that reserve uses to prevent excessive relay triggers.

The ecoflow app enforces a 5% spread between reserve and min SoC to ensure this doesn't happen.

I'm suggesting a change such as

    key="energy_backup_battery_level",
    name="Backup Reserve",
    icon="mdi:battery-sync",
    device_class=NumberDeviceClass.BATTERY,
    native_unit_of_measurement=PERCENTAGE,
    native_step=1.0,
    min_value_prop="battery_charge_limit_min",  # still works for UI range
    max_value_prop="battery_charge_limit_max",
    async_set_native_value=(
        lambda device, value: device.set_energy_backup_battery_level(
            max(int(value), device.battery_charge_limit_min + 5)
        )
    ),
    availability_prop="energy_backup",
),

onto custom_components/ef_ble/number.py#L43

I have not looked over the rest of the code and do not know if this suggested code is valid nor can I verify it, hence me posting it as an issue.

I honestly have no way of testing if this will work as I lack a 3rd gen device. This is in response to an issue posted on reddit https://www.reddit.com/r/Ecoflow_community/comments/1npk7u1/river_3_plus_turns_off_ac_output_when_hitting/

Pyroserenus avatar Sep 24 '25 20:09 Pyroserenus

Ok, that's a problem. I never needed to test these limits so I didn't add any constraints.

I'm not sure if your suggestion will work as I think that it will only constrain values when set from UI, but it won't update when discharge limit is set. The ideal solution would be to create new prop that is always battery_charge_limit_min + 5, set minimum to that and make battery backup update when min limit is set.

I'll fix it over this weekend.

GnoX avatar Sep 24 '25 21:09 GnoX

Actually, looking at the app, it only sets the 5% backup spread when you change discharge limit but you can still switch it back to discharge limit value so I would say this is not a bug of this integration as the app allows you to do the same.

If it should be allowed is a different discussion though. Spread of 5 might be limiting in some situations, but I noticed that backup level is a bit inconsistent - I've seen it trigger immediately when the battery goes above/below the level but it was 5 points above in some cases. Most of the time it was 3 percent though.

GnoX avatar Sep 24 '25 22:09 GnoX

@GnoX I'm the OP of the Reddit post and I agree with your assessment that this is not a bug of this integration because the app allows the same configuration.

Maybe it's just worth documenting this known issue.

IngmarStein avatar Sep 25 '25 06:09 IngmarStein

Actually, looking at the app, it only sets the 5% backup spread when you change discharge limit but you can still switch it back to discharge limit value so I would say this is not a bug of this integration as the app allows you to do the same.

If it should be allowed is a different discussion though. Spread of 5 might be limiting in some situations, but I noticed that backup level is a bit inconsistent - I've seen it trigger immediately when the battery goes above/below the level but it was 5 points above in some cases. Most of the time it was 3 percent though.

https://www.reddit.com/r/Ecoflow_community/comments/1npk7u1/comment/ng4iqdl/?context=1

The mystery deepens, the behavior is not consistent across generations. (silly me assuming consistency from Ecoflow).

Probably best to just document for the time being.

Pyroserenus avatar Sep 25 '25 15:09 Pyroserenus