Skoda Connect

Pull request for adding to HACS repository created. Once it gets approved, plugin will appear in HACS to install…

6 Likes

Hi,

I’ve been using this integration a few weeks now and I love it, thanks to the devs!

I was wondering if it might be possible to adapt the timing of the heating and cooling so it accepts the value selected from an input select. Since I’m not very versed in coding, I have no idea what this would entail, just thought I’d ask and see if it might be worth considering.

Do you mean to set a schedule or a input_select withbonly options like heating/cooling or…?

Sorry I wasn’t clear: I meant set the heating/cooling duration via an input_select instead of hardcoding it to the configuration of the integration.

That should be easy enough to do.
I am working on a quite large update but things are progressing slowly.
I will release as a testing branch when I feel it’s ready. I can include an option to set the duration outside of the config.
What’s best, input slider or input select?

No rush whatsoever, as stated, just a suggestion.

My money would be on input select. On the other hand, since it’s possible to define your own input slider or input select easily in the config of HA, maybe it would be easier for you to just accept the output of one such inputs and the user can decide for himself.

Been using this for a few days but have noticed the even though I have miles as true the distances that are returned are still in Km. Am I missing something or is this a bug.

It’s a missing feature :upside_down_face:
Even though the config option is there, there’s no conversion going on and I’m not sure how to request data in imperial units.
Do you have distance in miles in the app? In the car?

We are still very much using miles here in the UK.

Yes the app show all distances in miles.

Took me a little while to realise they were still in Km and not a random number.

I know you are, just didn’t know which country you are from.
I wanted to make sure that the car and app both show values in miles. Though it makes it a bit more difficult knowing that they are.
Are the values in actual km? Does the units show as miles?

The challenge is knowing if the app is requesting data differently or if there’s conversion going on which would make things more difficult.

Edit: can you check the debug logs how the values seem to be formatted. Check the StoredVehicleDataResponse and the items milCarCaptured and milCarSent if they appear to be in miles or km.

Units show as miles but actual data is in km

I have added the debug lines to the logger as per the github readme. There are skodaconnect items in the log but no data am I looking in the right place.

I also not that the odometer dose not seem to represent any specific value.

I think it might be outdated since the library was separated to a pypi package.
Add this to configuration.yaml:

logger:
  logs:
    skodaconnect: debug

That should enable debug logging for the skodaconnect python library.

logger:
  logs:
    custom_components.skodaconnect: debug
    custom_components.skodaconnect.sensor: debug

That code would enable debugs for the integration “init.py” and sensor parts.

I have added a new branch to skdoaconnect and homeassistant-skodaconnect.
The new branch name is test and I have added many, many functions and small changes.
The major points are:

  • Aux heating for EV/PHEV
  • Improved(?) code and consolidated functions
  • Token handling and only new login when tokens fail to renew.
  • Small changes to sensors, some new such as “request result”, some renamed to improve code visibility
  • Exposed two service calls:
    • set_schedule - Set deaprture timers
    • set_pheater_duration - Set parking heater duration, can be used in combo with for instance input_select
  • When using a switch, data should update in HA
  • Fetch and use car nickname from portal, VIN: NAME in configuration.yaml overrides

Much more small changes, can’t remember all.
I have totally changed the functions for handling the parking heater (non EV/PHEV only, EV/PHEV have aux heater with climater) and it might have broken things. I can’t test it though since I don’t have a car with that function.
Climate entities are most probably broken rn but switches should work.

I welcome those that can and want to try it out to do so, only manual installation at the moment since I don’t know how to handle pypi.
Install:

  • BACKUP! Or better yet, setup a new HA testing venv
  • Install skodaconnect test lib with:
python -m pip install git+https://github.com/lendy007/skodaconnect.git@test
  • git clone the homeassistant-skodaconnect test repo and link/copy the custom_components/skodaconnect to homeassistant root/custom_components/skodaconnect

Everything is working for me but ofc YMMV:

5 Likes

So I updated the debug as requested and this now shows the requested info.

Don’t want to post the full string as it contains vehicle specific data but will PM it to you if it helps.

‘milCarCaptured’: 3052, ‘milCarSent’: 3052

If this is the total mileage of the car then this is in Km

1 Like

Yes please do send me some data over PM. The most interesting part I think could be one of theese lines:

[skodaconnect] Received [200] response: {'carportData': {'country': 'CZ', 'systemId': 'unknown', 'color': 'LW5Q', 'mmi': '7UF', 'modelYear': '2020', 'modelName': 'SUP.COM iVL&K TS115/1.4A6F', 'transmission': 'TRS', 'engine': 'DGE', 'requestId': '----', 'modelCode': '3V55XC', 'countryCode': 'SE', 'vin': '----', 'brand': 'Skoda'}}

and also some data from vsr for instance.

I have peeked at the audi connect component and it’s converting in the code so no secret parameter to set when requesting data.
I will fix conversion in next commit, should be easy enough to fix in both testing and main.

hey @Farfar 2 questions…

  1. I don’t understand the 2 heating options ( electric and aux ) for PHEV cars? In the skoda connect app I only see one ( the climate ).
  2. Can you share your car dashboard yaml, looks great :slight_smile:

What an amazing job @Farfar @lendy007 :raised_hands:. Ever since I saw the Carnet integration, I thought it could be leveraged to support Skoda Connnect – I even investigated but quickly got caught back by my lack of skills :slight_smile: –.

Edit: Now when I re-read your post I understand. If you only have the electric option in the app then your car isn’t equipped with auxiliary heater (parking heater)? See text below:
The climate entity is somewhat broken, haven’t fixed it since it doesn’t really map well to how the current library handles data. If you change temp in climate entity for instance, there will be a call to the API to set the temperature. And when you activate heating another call… All of theese calls counts toward your maximum ammount (15) of requests until no further request can be made until the car has been started.
I am only using the switches for electric/aux heating.

You need the test branch of the library and integration to use the aux heater for PHEV. In short there’s two different API functions: rs and climater.
rs is legacy(?) function for cars with parking heater, petrol/diesel only afaik.
climater is newer and is used for EV/PHEV cars. Some PHEVs also have a parking heater, I named this auxiliary so it isn’t mistaken for the parking heater in non PHEV cars.
I’m not sure though how to tell if a car is equipped with aux heater since mine is and I can’t compare. So all EV/PHEVs should show the aux heater atm.

It’s 4 cards stack vertically, you will need some custom lovelace plugins and get the car image from skoda connect portal. The charger cable etc is ugly .pngs I have manually created in GIMP. Positions aren’t 100% accurate but looks good enough:

type: picture-elements
image: /local/skoda.png
elements:
  - type: image
    entity: binary_sensor.superb_charging_cable_connected
    tap_action:
      action: none
    style:
      top: 50%
      left: 50%
      width: 100%
    image: /local/blank.png
    state_image:
      'on': /local/skoda_charger_connected.png
  - type: image
    entity: binary_sensor.superb_energy_flow
    tap_action:
      action: none
    style:
      top: 50%
      left: 50%
      width: 100%
    image: /local/blank.png
    state_image:
      'on': /local/skoda_charger_charging.png
  - type: image
    entity: switch.superb_window_heater
    tap_action:
      action: none
    style:
      top: 50%
      left: 50%
      width: 100%
    image: /local/blank.png
    state_image:
      'on': /local/skoda_window_heating.png
  - type: image
    entity: switch.superb_electric_climatisation
    tap_action:
      action: none
    style:
      top: 50%
      left: 50%
      width: 100%
    image: /local/blank.png
    state_image:
      'on': /local/skoda_heating.png
  - type: image
    entity: binary_sensor.superb_doors_locked
    tap_action:
      action: none
    style:
      top: 34%
      left: 55%
      width: 3%
    image: /local/blank.png
    state_image:
      'off': /local/blink.gif
  - type: state-icon
    entity: sensor.superb_combustion_range
    style:
      top: 4%
      left: 5%
  - type: state-label
    entity: sensor.superb_combustion_range
    style:
      top: 5%
      left: 15%
  - type: state-icon
    entity: sensor.superb_electric_range
    style:
      top: 15.5%
      left: 5%
  - type: state-label
    entity: sensor.superb_electric_range
    style:
      top: 15%
      left: 15%
  - type: state-icon
    entity: lock.superb_door_locked
    style:
      bottom: 0%
      right: 5%
  - type: state-icon
    entity: binary_sensor.superb_windows_closed
    style:
      bottom: 0%
      right: 15%
type: horizontal-stack
cards:
  - type: button
    tap_action:
      action: more-info
    entity: switch.superb_charging
    name: Charge
    show_state: false
    hold_action:
      action: toggle
    icon_height: 48px
  - type: button
    tap_action:
      action: more-info
    entity: switch.superb_electric_climatisation
    name: Electric heater
    hold_action:
      action: toggle
    icon_height: 48px
  - type: button
    tap_action:
      action: more-info
    entity: switch.superb_auxiliary_climatisation
    name: Aux heater
    hold_action:
      action: toggle
  - type: button
    entity: switch.superb_window_heater
    name: Defrost
    tap_action:
      action: more-info
    hold_action:
      action: toggle
    icon_height: 48px
type: entities
entities:
  - entity: binary_sensor.superb_charging_cable_connected
    type: 'custom:multiple-entity-row'
    name: Charger
    secondary_info: last-changed
    state_header: Connector
    entities:
      - entity: binary_sensor.superb_external_power
        name: Power
      - entity: binary_sensor.superb_energy_flow
        name: Flow
      - entity: binary_sensor.superb_charging_cable_locked
        name: Plug
  - entity: sensor.superb_battery_level
    type: 'custom:multiple-entity-row'
    name: Battery
    secondary_info: last-changed
    state_header: Level
    entities:
      - entity: sensor.superb_charger_max_ampere
        name: Amps
        unit: ' '
      - entity: sensor.superb_charging_time_left
        name: To full
show_header_toggle: false
state_color: true
type: entities
entities:
  - entity: switch.superb_climatisation_from_battery
    type: 'custom:multiple-entity-row'
    name: Climatisation settings
    state_header: From battery
    toggle: true
    secondary_info: last-updated
    entities:
      - entity: sensor.superb_outside_temperature
        name: Outside
      - entity: sensor.superb_climatisation_target_temperature
        name: Target
  - entity: binary_sensor.superb_vehicle_moving
    type: 'custom:multiple-entity-row'
    name: Vehicle Parked
    state_header: Moving
    secondary_info:
      entity: sensor.superb_parking_time
      name: 'Parked:'
    entities:
      - entity: device_tracker.superb
        name: Location
  - entity: sensor.superb_requests_remaining
    type: 'custom:multiple-entity-row'
    name: Requests
    state_header: Remaining
    secondary_info: last-updated
    entities:
      - entity: sensor.superb_request_result
        name: Last result
  - entity: switch.superb_request_in_progress
    name: Data
    type: 'custom:multiple-entity-row'
    state_header: Force refresh
    toggle: true
    secondary_info:
      entity: sensor.superb_last_connected
      name: 'Latest data:'
  - entity: sensor.superb_last_trip_average_electric_consumption
    type: 'custom:multiple-entity-row'
    name: Last Trip
    unit: kWh
    icon: 'mdi:map-marker-distance'
    state_header: Electric
    entities:
      - entity: sensor.superb_last_trip_average_speed
        name: Speed
      - entity: sensor.superb_last_trip_duration
        name: Time
      - entity: sensor.superb_last_trip_length
        name: Length
      - entity: sensor.superb_last_trip_average_fuel_consumption
        name: Fuel
        unit: l
show_header_toggle: false
state_color: true
2 Likes

Just tried to update to 1.0.21

All entities are unavailable and log shows this error

Logger: homeassistant.util.package
Source: util/package.py:95
First occurred: 17:49:49 (1 occurrences)
Last logged: 17:49:49

Unable to install package skodaconnect==1.0.21: ERROR: Could not find a version that satisfies the requirement skodaconnect==1.0.21 (from versions: 1.0.7.dev2, 1.0.8.dev1, 1.0.9.dev1, 1.0.10, 1.0.11, 1.0.13, 1.0.14, 1.0.16, 1.0.17, 1.0.18) ERROR: No matching distribution found for skodaconnect==1.0.21 WARNING: You are using pip version 20.2.4; however, version 20.3.3 is available. You should consider upgrading via the '/usr/local/bin/python3 -m pip install --upgrade pip' command.