Great! Would you mind if I will copy it to my code? Because what was here was only beta-version where both skodaconnect library and Homeassistant plugin were together, now I have splitted it so I would like to include it in library package which is then used by HA plugin.
Please do.
Iāll test when itās updated. Thereās more sensor data available that iām planning to add such as outside temp and if vehicle is moving.
The token handling also isnāt great, I have it working im my crude mqtt script. Iāll see if I can patch it in.
Ok will do. Please wait with further updates to be performed in this new package release and make modifications in that one so we can pull request inā¦
Version 1.0.8 available on Github
New sensors available (if you do not specify anything in resources section of configuration, it will automatically create all supported sensors for your car):
- service_inspection_km
- oil_inspection_km
- outside_temperature
- electric_climatisation
- window_heater
- charging
- battery_level
- charging_time_left
- electric_range
- combined_range
- charge_max_ampere
- climatisation_target_temperature
- external_power
- climatisation_without_external_power
- charging_cable_connected
- charging_cable_locked
- trip_last_average_electric_consumption
- hood_closed
@Farfar - I have used your modifications, thank you for that! Regarding modifications you created in HA plugin, I am getting now this message in log:
BinarySensorDevice is deprecated, modify SkodaBinarySensor to extend BinarySensorEntity
LockDevice is deprecated, modify SkodaLock to extend LockEntity
shouldnāt it be reverted back to original āEntityā, not āDeviceā?
@SpeedMaxX & @jhqv - guys with electric vehicles - could you please try and let us know if showing correct data for electric related stuff (currently actions like starting climatisation, charging, window heater arenāt working yet)
Yes it should be Entity and not Device.
I am using Device since Iām still on 0.104
Havenāt upgraded since support for many of my sensors are missing in hass core.
@lendy007 seems I have the same issue as SpeedMaxX, logs look very similar.
Send you logs and config by PM
I have upgraded to 0.110 without breaking anything on my installation. Now I donāt need to change āEntityā to āDeviceāā¦
A few things, I donāt have the time to code myself right now.
- _hood_closed: The value is inverted
-
adblue_level: This is not supported but the config entry is there. Need to add a check if the value is None as I had in my code.
sensor.xxx_external_power: This sensor is created but with no data. The correct sensor is binary_sensor__. Canāt figure out why this incorrect one gets created. - _last_trip_average_electric_consumption: Needs to be divided by 10
- _electric_climatisation: Value is inverted
Else it seems to be working fine for me, except the actions part not working
I have found a few hints on more API endpoints, remote lock and unlock for one, but have only been able to see last actions so far.
I will try to debug the app and see if I can find something.
PM me if you want raw json of requests and responses.
Ok, I will check these small modificationsā¦
Regarding lock/unlock - I have captured it from my mobile app, but even when I send the same JSON I am getting HTTP 403 forbiddenā¦ Need to play with it a bitā¦
- _hood_closed: The value is inverted
- adblue_level: fixed when not supported
- _last_trip_average_electric_consumption: Needs to be divided by 10
- _electric_climatisation: Value is inverted
- beta version of start/stop window heater and start/stop electric climatisation (not able to test, need somebody with electric car to test)
Man! This is super-good news! I just installed it, seems to be working fine so far. I have one Skoda Superb iV (Plugin-Hybrid) and one Scala and both cars shows up. Will do some more testing this weekend.
Big thanks and GREAT JOB!
Iāve successfully sent a climatisation stop now through python with:
data = {
"action": {
"type": "stopClimatisation"
}
}
myheaders = {
"X-App-Version": "3.2.6",
"X-App-Name": "cz.skodaauto.connect",
"X-App-Id": "cz.skodaauto.connect",
"Content-Type": "application/json; charset=UTF-8",
"Connection": "Keep-Alive",
"Accept-Encoding": "gzip",
"User-Agent": "okhttp/3.14.7",
"Accept": "application/vnd.vwg.mbb.ClimaterAction_v1_0_1+json",
"Accept-Charset": "UTF-8",
"Authorization": "Bearer " + <my-access-token>
}
url = $homeregion/fs-car/bs/climatisation/v1/$type/$country/vehicles/$vin/climater/actions
response = requests.post(url, headers=myheaders, json=data)
{"action":{"type":"stopClimatisation","actionId":7136760,"actionState":"queued"}}
Iāve tried off and on and only got invalid payload but finally figured out that the function I was using that in turn calls on requests.post donāt handle json, or so I believe.
Sorry, I do not have an electric Skoda so I canāt help out with that.
I am still successfully running the 1.0.1 release from Nov 18th, but will probably pull the latest version this weekend.
So far, all the sensors seem to work well, but I havenāt tried sending commands like āunlockā or āenable heatingā yet.
My only improval request so far is that Iād like to be able to store my VIN number in my secrets.yaml file, but that doesnāt seem possible since the VIN is in a YAML key, not in a value. The value is a bit sensitive, so it would make sense to not keep it in the configurationā¦
So instead of
name:
abcdefg1234567: 'Octavia'
it could perhaps look like
name:
vin: 'abcdefg1234567'
friendly_name: 'Octavia'
Great work on this, @lendy007!
Turning on climatization does not work currently:
2020-11-21 12:46:40 DEBUG (MainThread) [custom_components.skodaconnect.switch] Turning ON combustion_climatisation.
2020-11-21 12:46:42 WARNING (MainThread) [skodaconnect] Failure to execute: 403, message='Forbidden', url=URL('https://fal-3a.prd.eu.dp.vwg-connect.com/fs-car/bs/rs/v1/skoda/CZ/vehicles/<redacted>/action')
2020-11-21 12:46:42 WARNING (MainThread) [skodaconnect] Failed to start combustion engine climatisation
2020-11-21 12:46:42 DEBUG (MainThread) [custom_components.skodaconnect.switch] Getting state of combustion_climatisation
The app also allows to turn them on simultaneously or only turn on ventilation.
New pull request, start/stop electric climatisation and charging (switches) working for me.
Did some mitmproxy and ssl pinning workarounds this afternoon. The Android app sends a XML request for heater:
POST https://fal-3a.prd.eu.dp.vwg-connect.com/fs-car/bs/rs/v1/Skoda/CZ/vehicles/<redacted>/action HTTP/1.1
X-MbbSecToken: <redacted>
Accept: application/json
Accept-Charset: UTF-8
App-Version: AN 1.0
Authorization: Bearer <redacted>
X-App-Version: 2002275293
X-App-Name: cz.skodaauto.connect
X-App-Id: cz.skodaauto.connect
X-Platform: Android
X-Language-Id: en
X-Country-Id: US
Accept-Language: en-US
Accept-Charset: UTF-8
Content-Type: application/vnd.vwg.mbb.RemoteStandheizung_v2_0_2+xml
Content-Length: 220
Host: fal-3a.prd.eu.dp.vwg-connect.com
Connection: Keep-Alive
Accept-Encoding: gzip
User-Agent: okhttp/3.14.7
<performAction xmlns="http://audi.de/connect/rs">
<quickstart>
<active>true</active>
<startMode>heating</startMode>
<climatisationDuration>30</climatisationDuration>
</quickstart>
</performAction>
Yes, for parking heater. For electric climater itās JSON
@tanelv - this is already working in the plugin. Isnāt it working for you? It is called combustion_engine_heating or combustion_engine_climatisation
Btw. format depends on phone type. Android app is sending XML, Apple is sending JSON. Service is accepting both.
Yes, getting 403 even when I tried directly with the module in python. Doing some additional debugging to see what could cause this.
Are you passing SPIN in quotes (as string)? Strange, because I am using it daily and working perfectly for meā¦