ReneNulschDE / mbapi2020

Custom Component to integrate MercedesME devices into Home-Assistant
Other
142 stars 27 forks source link

Calling the configure max soc service switches the charging program to standard #229

Closed josephdouce closed 1 month ago

josephdouce commented 2 months ago

The problem

Calling the configure max soc service switches the charging program to standard.

Is this the desired behaviour?

What version of MBAPI2020 do use?

v0.13.0

What was the last working version of MBAPI2020?

v0.13.0

What type of installation are you running?

Home Assistant OS

Diagnostics information

config_entry-mbapi2020-8214be536ccc11f2e4386e0cdfb082d6.json

Example YAML snippet

alias: Charge Automation
description: ""
trigger:
  - platform: time_pattern
    minutes: "01"
  - platform: time_pattern
    minutes: "31"
condition:
  - condition: state
    entity_id: sensor.car_charging_program
    state: Home
action:
  - choose:
      - conditions:
          - condition: numeric_state
            entity_id: >-
              sensor.octopus_energy_electricity_acc_current_rate
            above: 0.15
        sequence:
          - service: mbapi2020.battery_max_soc_configure
            data:
              vin: !secret
              max_soc: "50"
      - conditions:
          - condition: numeric_state
            entity_id: >-
              sensor.octopus_energy_electricity_acc_current_rate
            below: 0.15
        sequence:
          - service: mbapi2020.battery_max_soc_configure
            data:
              vin: !secret
              max_soc: "100"
mode: single

Anything in the logs that might be useful for us?

No response

Additional information

I was hoping to use the "Home" profile to enable me to automate my dumb chargers, I can simply use standard however I would expect the update max soc to update the current charge program.

ReneNulschDE commented 1 month ago

No its not, I have not found a way to prevent this yet. I will keep it open and will dive deeper and check if I can use a different API to achieve the expected behavior.

josephdouce commented 1 month ago

On the app you are able to adjust the max SoC and the program remains, so not sure what they're doing differently.

On Wed, 5 Jun 2024, 17:13 Rene Nulsch, @.***> wrote:

No its not, I have not found a way to prevent this yet. I will keep it open and will dive deeper and check if I can use a different API to achieve the expected behavior.

— Reply to this email directly, view it on GitHub https://github.com/ReneNulschDE/mbapi2020/issues/229#issuecomment-2150324314, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAN74Y4NQUNDZWEQWMLFPQTZF4TJJAVCNFSM6AAAAABIBFXMW2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNJQGMZDIMZRGQ . You are receiving this because you authored the thread.Message ID: @.***>

josephdouce commented 1 month ago

Do you have a link to the API docs? I can't find a useful list of commands anywhere 😩 the website is awful and gives 1 example and doesn't list any of the commands, it's painful!

On Wed, 5 Jun 2024, 19:01 Joseph Douce, @.***> wrote:

On the app you are able to adjust the max SoC and the program remains, so not sure what they're doing differently.

On Wed, 5 Jun 2024, 17:13 Rene Nulsch, @.***> wrote:

No its not, I have not found a way to prevent this yet. I will keep it open and will dive deeper and check if I can use a different API to achieve the expected behavior.

— Reply to this email directly, view it on GitHub https://github.com/ReneNulschDE/mbapi2020/issues/229#issuecomment-2150324314, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAN74Y4NQUNDZWEQWMLFPQTZF4TJJAVCNFSM6AAAAABIBFXMW2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNJQGMZDIMZRGQ . You are receiving this because you authored the thread.Message ID: @.***>

ReneNulschDE commented 1 month ago

There is no documentation as the API is not supported. There is just this repo. I will check it later this week.

josephdouce commented 1 month ago

Seems you can set maxsoc with the charge program configure, might be that if you don't specify the charge program it defaults to 0.

On Thu, 6 Jun 2024, 10:42 Rene Nulsch, @.***> wrote:

There is no documentation as the API is not supported. There is just this repo https://github.com/mercedes-benz/MBSDK-CarKit-iOS. I will check it later this week.

— Reply to this email directly, view it on GitHub https://github.com/ReneNulschDE/mbapi2020/issues/229#issuecomment-2151730175, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAN74YYMCTOKZLIBDOSIWTLZGAOGDAVCNFSM6AAAAABIBFXMW2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNJRG4ZTAMJXGU . You are receiving this because you authored the thread.Message ID: @.***>

ReneNulschDE commented 1 month ago

I have added the code to set the charge_program in the max_battery_configure service... Are you able to check the master branch code? Otherwise, it will be part of the beta release in the next a few days...

josephdouce commented 1 month ago

I checked the master branch, still switces to Standard when you call

service: mbapi2020.battery_max_soc_configure data: vin: VIN max_soc: "100" charge_program: "2"

ReneNulschDE commented 1 month ago

ok, let me check again... don't have an car with charge templates right now...

josephdouce commented 1 month ago

image

This screenshot was with charge program 3 selected.

Looks like the profile isn't being passed to the function,

If I change it to "charge_program: int" instead of "charge_program: int = 0" I get a missing argument error.

image

josephdouce commented 1 month ago

See PR https://github.com/ReneNulschDE/mbapi2020/pull/248

Fixed and Tested

josephdouce commented 1 month ago

Fixed with PR#248