mitch-dc / volkswagen_we_connect_id

Apache License 2.0
202 stars 53 forks source link

Expose "Reduced AC charging current" setting as control/switch #184

Closed FirstRulez closed 1 year ago

FirstRulez commented 1 year ago

Is your feature request related to a problem? Please describe. I would like to be able to control the setting "Reduced AC charging current" on my ID.4 so that when charging at home during the day my charge rate is lower than my solar generation capacity meaning I do not use expensive grid energy.

Describe the solution you'd like An additional control/configuration entity exposed as an on/off switch to control this setting on my car.

Describe alternatives you've considered Any other controls which the API exposes allowing me to limit the charge rate of the vehicle, particularly one I can control from an HA automation would be helpful and resolve my request.

Additional context I do not have a smart car charger which can be used to control the rate of charge so am looking to use the capability of the vehicle instead. This setting is exposed by the VW mobile app and works when used on my vehicle. Note my car is currently on v2.4 so ideally would like something which works for all vehicle software versions from 2.4 upwards.

GrmpfNarf commented 1 year ago

Hi, this is already possible as a service. IMG_1714

FirstRulez commented 1 year ago

Thanks for the comment - is there a reason that these are exposed as services rather than controls on the integration? I am also looking to expose these controls to users who cannot access the VW app...

GrmpfNarf commented 1 year ago

Hi, there is a Button for that. But it is a button not a switch. The Button toggles the "AC Charging Speed". If you want to get a switch you can put this into your configuration.yaml.

switch:
  - platform: template
    switches:
      reduced_ac_speed:
        friendly_name: "Reduce AC Speed"
        unique_id: "d6634f16-0eeb-4b0b-8c17-46b78b177d94"
        icon_template: "mdi:ev-station"
        value_template: "{{ is_state('sensor.id_4_pro_performance_150_kw_204_ps_max_charge_current_ac', 'reduced') }}"
        turn_on:
          service: button.press 
          target:
            entity_id: "button.id_4_pro_performance_150_kw_204_ps_toggle_ac_charge_speed"
        turn_off:
          service: button.press
          target:
            entity_id: "button.id_4_pro_performance_150_kw_204_ps_toggle_ac_charge_speed"

The problem with the switch is that he shows the state of a variable. When the variable is not changed within a certain amount of time after pressing the switch the switch returns to the previous state. It takes several minutes that the state is changed after pressing the toggle button because it's an asynchronous event. So when the switch is pressed it returns to the previous state after some seconds and, when the variable is changed, it switches to the expected state. I think that's the main reason why it isn't a switch for now.

Bildschirm­foto 2023-06-18 um 13 54 43

ezgif-2-5308fc6f18

mitch-dc commented 1 year ago

Hi,

there is a Button for that. But it is a button not a switch. The Button toggles the "AC Charging Speed". If you want to get a switch you can put this into your configuration.yaml.


switch:

  - platform: template

    switches:

      reduced_ac_speed:

        friendly_name: "Reduce AC Speed"

        unique_id: "d6634f16-0eeb-4b0b-8c17-46b78b177d94"

        icon_template: "mdi:ev-station"

        value_template: "{{ is_state('sensor.id_4_pro_performance_150_kw_204_ps_max_charge_current_ac', 'reduced') }}"

        turn_on:

          service: button.press 

          target:

            entity_id: "button.id_4_pro_performance_150_kw_204_ps_toggle_ac_charge_speed"

        turn_off:

          service: button.press

          target:

            entity_id: "button.id_4_pro_performance_150_kw_204_ps_toggle_ac_charge_speed"

The problem with the switch is that he shows the state of a variable. When the variable is not changed within a certain amount of time after pressing the switch the switch returns to the previous state. It takes several minutes that the state is changed after pressing the toggle button because it's an asynchronous event.

So when the switch is pressed it returns to the previous state after some seconds and, when the variable is changed, it switches to the expected state. I think that's the main reason why it isn't a switch for now.

Bildschirm­foto 2023-06-18 um 13 54 43

ezgif-2-5308fc6f18

You are right. The api is so slow that switches are just not working how we should want it.

Its annoying but in my case the buttons work fine :)

FirstRulez commented 1 year ago

Thank you both for the extra info - I do not see those buttons. Do I need to to something specific to get them to show? I have v0.1.6 installed via HACS at the moment (just about to update to v0.1.7)

mitch-dc commented 1 year ago
type: entities
entities:
  - entity: button.komo_start_climate
    name: Start Climate
    icon: ''
    secondary_info: last-updated
  - entity: button.komo_stop_climate
    secondary_info: last-changed
    name: Stop Climate
  - entity: button.komo_toggle_ac_charge_speed
    name: Toggle Charge Speed
    secondary_info: last-changed
    icon: mdi:tortoise
title: Komo Actions

Your entities will have a different name based on the nickname of your car (mine is Komo). image