daernsinstantfortress / cupra_we_connect

Cupra integration for Home Assistant
Apache License 2.0
60 stars 8 forks source link

Missing button to toggle charge and A/C #79

Closed WazoAkaRapace closed 3 months ago

WazoAkaRapace commented 3 months ago

Hello,

The buttons for starting/stopping the charge and A/C are not showing up in the entities.

The numbers for changing the max SoC and desired temperature are showing up and it's possible to toggle the charge and A/C from the My Cupra app.

Integration version: 0.8.4 HA version : 2024.8.1

Feel free to ask if you need any more information, thanks for your work 🙏

daernsinstantfortress commented 3 months ago

The buttons are there, but don't show up in the integration page. Personally speaking, I use two template switches for this:

Heating / cooling:

- platform: template
  switches:
    car_heating:
      friendly_name: "Heating"
      value_template: "{{ states('sensor.cupra_born_climatisation_state') in ['cooling', 'heating', 'ventilation'] }}"
      turn_on:
        service: button.press
        target:
          entity_id: button.cupra_born_start_climate
      turn_off:
        service: button.press
        target:
          entity_id: button.cupra_born_stop_climate
      icon_template: >-
        {% if states('sensor.cupra_born_climatisation_state') in ['cooling', 'heating', 'ventilation'] %}
          mdi:radiator
        {% else %}
          mdi:radiator-off
        {% endif %}

Charging:

- platform: template
  switches:
    car_charging:
      friendly_name: "Charging"
      value_template: "{{ states('sensor.cupra_born_charging_state') in ['charging'] }}" 
      turn_on:
        service: button.press
        target:
          entity_id: button.cupra_born_start_charging
      turn_off:
        service: button.press
        target:
          entity_id: button.cupra_born_stop_charging
      icon_template: >-
        {% if states('sensor.cupra_born_charging_state') in ['charging'] %}
          mdi:car-electric
        {% else %}
          mdi:car-outline
        {% endif %}

Note that because of the long lag from sending the command to the servers and the car accepting it, the switches might move briefly to their new setting before returning to the old one. If you then wait a bit, when the car updates its settings and sends back a confirmation, the switch will move itself to the correct, new setting.

WazoAkaRapace commented 3 months ago

Oh right, thanks ! It's strange that they are not linked to the device :/