diff --git a/README.md b/README.md
index 8a6829e..a9c303c 100644
--- a/README.md
+++ b/README.md
@@ -1,21 +1,33 @@
-# Homebridge Porsche Taycan
+# Homebridge Porsche EV
[![verified-by-homebridge](https://badgen.net/badge/homebridge/verified/purple)](/~https://github.com/homebridge/homebridge/wiki/Verified-Plugins)
This Homebrudge plugin offers a range of useful features for your Porsche Taycan and Macan EV, including real-time monitoring of battery level, charging status and charging power. Moreover, it also enables you to easily toggle the direct climatisation option on or off and automate your home with your vehicles location.
-## Supported cars:
+## Supported vehicles:
- Taycan (MY19 and newer)
- Macan EV (MY25 and newer)
+## Key features
+- Switch for **Precool / heat**
+- Switch for **Direct Charge**
+- Sensor for your **Charger** with **SoC**
+A *contact sensor* will indicate if your vehicle is charging, SoC (battery level) is available as accessory characteristic or as separate sensor
+- Sensor for the **Charging Power** (Optional)
+A *light (lux)* sensor will show current charging power. E.g. 10 lux means your vehicles charges with a speed of 10 kwh.
+- Sensor for the **Location** fo your vehicle (Optional)
+An *occupancy sensor* indicates if your vehicle is at home when the location of your vehicle is within 300 meters of your home
+- Sensor for the **SoC** (optional)
+By default SoC is available as characteristic of the charger sensor. Optionally the SoC can be exposed as *humidity sensor*.
+
## Installation
-To install Homebridge Porsche Taycan follow these steps:
+To install the *Homebridge Porsche Taycan* plugin follow these steps:
- Follow the instructions on the [Homebridge Wiki](https://homebridge.io/how-to-install-homebridge) to install Node.js and Homebridge;
-- Install the Homebridge Porsche Tycan plugin through Homebridge Config UI X or manually by:
+- Install the *Homebridge Porsche Taycan* plugin through Homebridge Config UI X or manually;
```
$ sudo npm -g i homebridge-porsche-taycan
```
-- Edit config.json and add the Porsche Taycan platform. For example,
+- Edit config.json and add the *Porsche Taycan* platform. E.g;
```
{
"username": "<>",
@@ -40,4 +52,4 @@ To install Homebridge Porsche Taycan follow these steps:
## Credits
This plugin is not an official plugin from Porsche. The usage of Porsche Connect API endpoints are reverse engineered on MyPorsche with help of Google Chrome Dev tools. It uses the unofficial 'porsche-connect' node package to communicate to Porsches servers.
-This plugin started as a hobby project but is now available to the public. Pull requests to improve the plugins are welcome.
+This plugin started as a hobby project but is now available to the public. Pull requests to improve the plugins are more than welcome.
diff --git a/config.schema.json b/config.schema.json
index 2b9e0b4..1b11688 100644
--- a/config.schema.json
+++ b/config.schema.json
@@ -58,7 +58,7 @@
"type": "string",
"required": false,
"default": "",
- "description": "When your (home) location as latitude/longitude is filled in an occupancy sensor is exposed to indicate if your vehicle is at home. Your vehicle is recognized as being at home if the distance between it and the specified location is within 300 meters (approximately 0.2 miles). Use https://www.latlong.net/ to get the latitude and logitude of your address."
+ "description": "When your (home) location as latitude/longitude is filled in an occupancy sensor is exposed to indicate if your vehicle is at home. Your vehicle is recognized as being at home if the distance between the vehicle and the specified location is within 300 meters (approximately 0.2 miles). Use https://www.latlong.net/ to get the latitude and logitude of your address."
}
}
}
diff --git a/package-lock.json b/package-lock.json
index 39c2f33..6db9180 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,15 +1,15 @@
{
"name": "homebridge-porsche-taycan",
- "version": "0.16.0",
+ "version": "0.18.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "homebridge-porsche-taycan",
- "version": "0.16.0",
+ "version": "0.18.0",
"license": "Apache-2.0",
"dependencies": {
- "porsche-connect": "^0.0.14"
+ "porsche-connect": "^0.0.15"
},
"devDependencies": {
"@types/node": "^20.2.5",
@@ -2888,16 +2888,16 @@
}
},
"node_modules/porsche-connect": {
- "version": "0.0.14",
- "resolved": "https://registry.npmjs.org/porsche-connect/-/porsche-connect-0.0.14.tgz",
- "integrity": "sha512-mnGnQyEsViQbX2eVr/2j5Cf6XAdL7p8t+oV12NrPAWjKE43q2go90rNWk9SwKSrzqxZ9WY29StDoum4vojB9sA==",
+ "version": "0.0.15",
+ "resolved": "https://registry.npmjs.org/porsche-connect/-/porsche-connect-0.0.15.tgz",
+ "integrity": "sha512-0UD4Qi6RvnNLwz3BM0CXlSXAYrM9WvgcfIdk2nX/CqAy3onhQJEUt0PDrIVYligtLvhc3/n5FJQdldlAUTcjrw==",
"dependencies": {
"axios": "^1.6.7",
"axios-cookiejar-support": "^5.0.0",
"jsonwebtoken": "^9.0.2",
"moment": "^2.30.1",
"source-map-support": "^0.5.21",
- "tldts": "^6.1.8",
+ "tldts": "^6.1.11",
"tough-cookie": "^4.1.3",
"tslib": "~2.6.2"
}
@@ -3419,20 +3419,20 @@
"dev": true
},
"node_modules/tldts": {
- "version": "6.1.9",
- "resolved": "https://registry.npmjs.org/tldts/-/tldts-6.1.9.tgz",
- "integrity": "sha512-LcOAb4CxqEI0+6JI0z3Z0cN0GPGO3VK6SyWwJM28BhVwIseJ05WAxGmXvSzZCqlIFeU4C5BFvJ3LnAeeHYg6ww==",
+ "version": "6.1.11",
+ "resolved": "https://registry.npmjs.org/tldts/-/tldts-6.1.11.tgz",
+ "integrity": "sha512-AAgE/IWvbsg4Lr4KGFNR7bL/MhQfBlgGV9UBg2uy5mCwSGi5f12eZ7ZydAqv4ACys6pUYjNoV2qfZdcCn4RS+Q==",
"dependencies": {
- "tldts-core": "^6.1.9"
+ "tldts-core": "^6.1.11"
},
"bin": {
"tldts": "bin/cli.js"
}
},
"node_modules/tldts-core": {
- "version": "6.1.9",
- "resolved": "https://registry.npmjs.org/tldts-core/-/tldts-core-6.1.9.tgz",
- "integrity": "sha512-YEExedCJDgJ29LPbZ7Q+QLoTJccmiVUaMLIjpN9VxpQGwJa2+qN7bbnNRZ3gD0p0I9l8BZ42fCAE0kNvxk7FGA=="
+ "version": "6.1.11",
+ "resolved": "https://registry.npmjs.org/tldts-core/-/tldts-core-6.1.11.tgz",
+ "integrity": "sha512-ZFcT+/fdEc5VRndQIJtArNBHsaq4udRoeE4E6cwLzGaH0dq7Ng2L7cAoea6riM2uhNFD09EDa1bN8lrfrOBCLg=="
},
"node_modules/to-regex-range": {
"version": "5.0.1",
diff --git a/package.json b/package.json
index f53d500..3601cfe 100644
--- a/package.json
+++ b/package.json
@@ -1,7 +1,7 @@
{
"displayName": "Homebridge Porsche Taycan",
"name": "homebridge-porsche-taycan",
- "version": "0.17.0",
+ "version": "0.18.0",
"description": "Control your Porsche Taycan through the home app",
"license": "Apache-2.0",
"author": "Jasper Seinhorst",
@@ -46,6 +46,6 @@
"typescript": "^4.9.5"
},
"dependencies": {
- "porsche-connect": "^0.0.14"
+ "porsche-connect": "^0.0.15"
}
}
diff --git a/src/Accessories/DirectCharge.ts b/src/Accessories/DirectCharge.ts
index 67b8fab..54c1da7 100644
--- a/src/Accessories/DirectCharge.ts
+++ b/src/Accessories/DirectCharge.ts
@@ -17,11 +17,9 @@ export default class DirectCharge implements PorscheAccessory {
this.switchService = this.accessory.getService(this.Service.Switch) || this.accessory.addService(this.Service.Switch);
this.switchService.getCharacteristic(this.Characteristic.On).on('set', this.setStatus.bind(this));
- this.switchService.setCharacteristic(this.Characteristic.On, false);
}
private async setStatus(value, callback) {
- // Only call API when status is not changed during heartbeat
if (this.vehicle && !this.heartBeatActive) {
if (value) {
this.log.debug('Connecting with API to initiate Direct charge');
@@ -36,7 +34,7 @@ export default class DirectCharge implements PorscheAccessory {
callback();
}
- public beat(emobilityInfo: VehicleEMobility, positionInfo : VehiclePosition, vehicle: Vehicle) {
+ public beat(emobilityInfo: VehicleEMobility, positionInfo: VehiclePosition, vehicle: Vehicle) {
this.heartBeatActive = true;
this.vehicle = vehicle;
diff --git a/src/Accessories/PrecoolHeat.ts b/src/Accessories/PrecoolHeat.ts
index 49b987e..35e9045 100644
--- a/src/Accessories/PrecoolHeat.ts
+++ b/src/Accessories/PrecoolHeat.ts
@@ -17,11 +17,9 @@ export default class PrecoolHeat implements PorscheAccessory {
this.switchService = this.accessory.getService(this.Service.Switch) || this.accessory.addService(this.Service.Switch);
this.switchService.getCharacteristic(this.Characteristic.On).on('set', this.setStatus.bind(this));
- this.switchService.setCharacteristic(this.Characteristic.On, false);
}
private async setStatus(value, callback) {
- // Only call API when status is not changed during heartbeat
if (this.vehicle && !this.heartBeatActive) {
if (value) {
this.log.debug('Connecting with API to start Precool/heat');
@@ -36,7 +34,7 @@ export default class PrecoolHeat implements PorscheAccessory {
callback();
}
- public beat(emobilityInfo: VehicleEMobility, positionInfo : VehiclePosition, vehicle: Vehicle) {
+ public beat(emobilityInfo: VehicleEMobility, positionInfo: VehiclePosition, vehicle: Vehicle) {
this.heartBeatActive = true;
this.vehicle = vehicle;
diff --git a/src/Platform.ts b/src/Platform.ts
index a7be997..b5d2628 100644
--- a/src/Platform.ts
+++ b/src/Platform.ts
@@ -87,19 +87,17 @@ export class PorscheTaycanPlatform implements DynamicPlatformPlugin {
}
// Register Direct charge
- if (this.config.directChargeDevice === true) {
- const directChargeUuid = this.api.hap.uuid.generate(`${vehicle.vin}-direct-charge`);
- const directChargeExistingAccessory = this.accessories.find(accessory => accessory.UUID === directChargeUuid);
+ const directChargeUuid = this.api.hap.uuid.generate(`${vehicle.vin}-direct-charge`);
+ const directChargeExistingAccessory = this.accessories.find(accessory => accessory.UUID === directChargeUuid);
- if (directChargeExistingAccessory) {
- platformVehicle.accessories.push(new DirectCharge(this.config, this.log, this.api, directChargeExistingAccessory));
- } else {
- this.log.info('Direct charge added as accessory');
- const accessory = new this.api.platformAccessory('Direct charge', directChargeUuid);
- accessory.context.device = vehicle;
- platformVehicle.accessories.push(new DirectCharge(this.config, this.log, this.api, accessory));
- this.api.registerPlatformAccessories('homebridge-porsche-taycan', 'PorscheTaycan', [accessory]);
- }
+ if (directChargeExistingAccessory) {
+ platformVehicle.accessories.push(new DirectCharge(this.config, this.log, this.api, directChargeExistingAccessory));
+ } else {
+ this.log.info('Direct charge added as accessory');
+ const accessory = new this.api.platformAccessory('Direct charge', directChargeUuid);
+ accessory.context.device = vehicle;
+ platformVehicle.accessories.push(new DirectCharge(this.config, this.log, this.api, accessory));
+ this.api.registerPlatformAccessories('homebridge-porsche-taycan', 'PorscheTaycan', [accessory]);
}
// (Optionally) Register Battery