Giter Club home page Giter Club logo

homebridge-porsche-taycan's Introduction

Homebridge Porsche EV

verified-by-homebridge npm npm

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 vehicles:

  • Taycan (MY19 and newer)
  • Macan EV (MY25 and newer)

Key features

room

  • 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.

charger charging power SoC Occupancy

Installation

To install the Homebridge Porsche Taycan plugin follow these steps:

  • Follow the instructions on the Homebridge Wiki to install Node.js and Homebridge;
  • 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. E.g;
    {
        "username": "<<Porsche Connect username>>",
        "password": "<<Porsche Connect password>>",
        "pollInterval": 30,
        "batteryDevice": false,
        "chargingPowerDevice": true,
        "lowBattery": 40,
        "platform": "PorscheTaycan",
        locationConfig: {
          "lat": "<<Latitude of your home address>>",
          "long": "<<Longitude of your home address>>",
        }
    }
    
    In above example the charging state and battery level are updated every 30 minutes. The battery level is considered low when the SoC drops below 40. No separate battery level device is exposed, but the current charging power is.

Caveats

  • The plugin can throw authentication errors. The login method used from Porsche's API expects a captcha now and then. As a work around logon to my.porsche.com and restart the plugin. Logging in on my.porsche.com reset the need for a captcha.
  • Precool/heat cools or heats your vehicle on activation, the desired temperature can only be changed in the My Porsche app when setting a charge timer.

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 more than welcome.

homebridge-porsche-taycan's People

Contributors

jasper-seinhorst avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

homebridge-porsche-taycan's Issues

Error message "Porsche Connect connection failed" and plugin does not work until restart

Describe The Bug:

I randomly get the error message "Porsche Connect connection failed". When this happens, the plugin stops working until it gets restarted manually. I get this failure basically every single day so I have a daily cron job set to run in the middle of the night to try and kickstart this plugin.

To Reproduce:

Nothing special but I do also have the electric sidecar app running on my phone which probably hits the same API. There might be a rate limiting issue due to MyPorsche, Electric Sidecar, and this plugin all trying to use the same API (guessing at what the problem might be).

Expected behavior:

Would love to have a graceful recovery where this app tries to connect again after an appropriate timeout period (maybe 5-10 minutes).

Logs:

[20/11/2023, 04:00:36] Homebridge v1.7.0 (HAP v0.11.1) (Homebridge B4CB) is running on port 51889.
[20/11/2023, 04:00:38] [homebridge-porsche-taycan] Launched child bridge with PID 18661
[20/11/2023, 04:00:38] [Hubitat-v2] Launched child bridge with PID 18660
[20/11/2023, 04:00:39] Registering platform 'homebridge-hubitat-tonesto7.Hubitat-v2'
[20/11/2023, 04:00:39] [Hubitat-v2] Loaded homebridge-hubitat-tonesto7 v2.9.4 child bridge successfully
[20/11/2023, 04:00:39] Loaded 3 cached accessories from cachedAccessories.0E3AF68A4B39.
[20/11/2023, 04:00:39] Registering platform 'homebridge-porsche-taycan.PorscheTaycan'
[20/11/2023, 04:00:39] [homebridge-porsche-taycan] Loaded homebridge-porsche-taycan v0.14.0 child bridge successfully
[20/11/2023, 04:00:39] Loaded 3 cached accessories from cachedAccessories.0EE180F26898.
DEPRECATED user supplied a custom 'mdns' option. This option is deprecated and ignored. Please move to the new 'bind' option.
[20/11/2023, 04:00:39] [homebridge-porsche-taycan] Authentication
[20/11/2023, 04:00:39] [homebridge-porsche-taycan] Retrieving available vehicles
[20/11/2023, 04:00:40] Homebridge v1.7.0 (HAP v0.11.1) (homebridge-porsche-taycan) is running on port 57646.
[20/11/2023, 04:00:40] [Hubitat-v2] Homebridge Version: 2.7
[20/11/2023, 04:00:40] [Hubitat-v2] Plugin Version: 2.9.4
[20/11/2023, 04:00:40] [Hubitat-v2] Checking Package Version for Updates...
[20/11/2023, 04:00:40] [Hubitat-v2] Adaptive Lighting Supported... Assigning Adaptive Lighting Controller to [Office Lights]!!!
DEPRECATED user supplied a custom 'mdns' option. This option is deprecated and ignored. Please move to the new 'bind' option.
[20/11/2023, 04:00:41] [Hubitat-v2] Fetching Hubitat-v2 Devices. NOTICE: This may take a moment if you have a large number of devices being loaded!
[20/11/2023, 04:00:41] [Hubitat-v2] Refreshing All Device Data | Source: (First Launch)
[20/11/2023, 04:00:41] Homebridge v1.7.0 (HAP v0.11.1) (Hubitat-v2) is running on port 59026.
[20/11/2023, 04:00:41] [Hubitat-v2] Temperature Unit is Now: (F)
[20/11/2023, 04:00:41] [Hubitat-v2] Updating Global Values | HubIP: 192.168.68.155 | UsingCloud: false
[20/11/2023, 04:00:41] [Hubitat-v2] Devices to Remove: (0) 
[20/11/2023, 04:00:41] [Hubitat-v2] Devices to Update: (3)
[20/11/2023, 04:00:41] [Hubitat-v2] Devices to Create: (0) 
[20/11/2023, 04:00:41] [Hubitat-v2] Total Initialization Time: (1 seconds)
[20/11/2023, 04:00:41] [Hubitat-v2] Unknown Capabilities: []
[20/11/2023, 04:00:41] [Hubitat-v2] Hubitat DeviceCache Size: (3)
[20/11/2023, 04:00:41] [Hubitat-v2] WebServer Initiated...
[20/11/2023, 04:00:41] [Hubitat-v2] Sending StartDirect Request to Hubitat | UsingCloud: (false)
[20/11/2023, 04:00:41] [Hubitat-v2] Direct Connect Active | Listening at 192.168.68.141:8000
[20/11/2023, 04:00:42] [homebridge-porsche-taycan] Porsche Connect connection failed
[20/11/2023, 04:00:42] [Hubitat-v2] Hubitat-v2 Hub Communication Established
[20/11/2023, 04:00:44] [Hubitat-v2] INFO: Your plugin version is up-to-date
[20/11/2023, 04:00:44] [Hubitat-v2] Sending Plugin Status to Hubitat | UpdateAvailable: false | newVersion: 2.9.4
[20/11/2023, 05:00:41] [Hubitat-v2] Refreshing All Device Data
[20/11/2023, 05:00:41] [Hubitat-v2] Temperature Unit is Now: (F)
[20/11/2023, 05:00:41] [Hubitat-v2] Updating Global Values | HubIP: 192.168.68.155 | UsingCloud: false
[20/11/2023, 05:00:41] [Hubitat-v2] Devices to Remove: (0) 
[20/11/2023, 05:00:41] [Hubitat-v2] Devices to Update: (3)
[20/11/2023, 05:00:41] [Hubitat-v2] Devices to Create: (0) 
[20/11/2023, 05:00:41] [Hubitat-v2] Total Initialization Time: (0 seconds)
[20/11/2023, 05:00:41] [Hubitat-v2] Unknown Capabilities: []
[20/11/2023, 05:00:41] [Hubitat-v2] Hubitat DeviceCache Size: (3)
[20/11/2023, 05:00:41] [Hubitat-v2] Checking Package Version for Updates...
[20/11/2023, 05:00:44] [Hubitat-v2] INFO: Your plugin version is up-to-date
[20/11/2023, 05:00:44] [Hubitat-v2] Sending Plugin Status to Hubitat | UpdateAvailable: false | newVersion: 2.9.4
[20/11/2023, 06:00:41] [Hubitat-v2] Refreshing All Device Data
[20/11/2023, 06:00:41] [Hubitat-v2] Temperature Unit is Now: (F)
[20/11/2023, 06:00:41] [Hubitat-v2] Updating Global Values | HubIP: 192.168.68.155 | UsingCloud: false
[20/11/2023, 06:00:41] [Hubitat-v2] Devices to Remove: (0) 
[20/11/2023, 06:00:41] [Hubitat-v2] Devices to Update: (3)
[20/11/2023, 06:00:41] [Hubitat-v2] Devices to Create: (0) 
[20/11/2023, 06:00:41] [Hubitat-v2] Total Initialization Time: (0 seconds)
[20/11/2023, 06:00:41] [Hubitat-v2] Unknown Capabilities: []
[20/11/2023, 06:00:41] [Hubitat-v2] Hubitat DeviceCache Size: (3)
[20/11/2023, 06:00:41] [Hubitat-v2] Checking Package Version for Updates...
[20/11/2023, 06:00:45] [Hubitat-v2] INFO: Your plugin version is up-to-date
[20/11/2023, 06:00:45] [Hubitat-v2] Sending Plugin Status to Hubitat | UpdateAvailable: false | newVersion: 2.9.4

Plugin Config:

{
    "mdns": {
        "interface": "XXXXXXXXXXXX"
    },
    "bridge": {
        "name": "XXXXXXXXXXXX",
        "username": "XXXXXXXXXXXX",
        "port": 51889,
        "pin": "XXXXXXXXXXXX"
    },
    "accessories": [],
    "platforms": [
        {
            "name": "Hubitat-v2",
            "app_url_local": "XXXXXXXXXXXX",
            "app_url_cloud": "XXXXXXXXXXXX",
            "use_cloud": false,
            "app_id": 1213,
            "access_token": "XXXXXXXXXXXX",
            "direct_port": 8000,
            "polling_seconds": 3600,
            "temperature_unit": "F",
            "round_levels": true,
            "adaptive_lighting": true,
            "adaptive_lighting_offset": 0,
            "consider_fan_by_name": true,
            "consider_light_by_name": true,
            "validateTokenId": false,
            "logConfig": {
                "debug": false,
                "showChanges": true
            },
            "platform": "Hubitat-v2",
            "_bridge": {
                "username": "XXXXXXXXXXXX",
                "port": 59026
            }
        },
        {
            "name": "Config",
            "port": 8581,
            "auth": "form",
            "theme": "auto",
            "tempUnits": "f",
            "lang": "auto",
            "platform": "config"
        },
        {
            "username": "XXXXXXXXXXXX",
            "password": "XXXXXXXXXXXX",
            "pollInterval": 15,
            "chargerDevice": "contact",
            "batteryDevice": true,
            "lowBattery": 30,
            "platform": "PorscheTaycan",
            "_bridge": {
                "username": "XXXXXXXXXXXX",
                "port": 57646
            }
        }
    ]
}

Screenshots:

Environment:

  • Plugin Version: homebridge-hubitat-tonesto7 v2.9.4
  • Homebridge Version: v1.7.0
  • Node.js Version: v18.17.1
  • NPM Version: 9.6.7
  • Operating System: Raspbian

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.