ConnectedCar Binding myAudi, Volkswagen, VW ID, Skoda, Enyaq, Seat, Ford, WeCharge

Ok, with help of the carconnectivity developer Till Steinbach I managed to run carconnectivity on openhab 4.3.4 (openhabian) for my Skoda Enyaq. Here is a step-by-step manual (also for my records):

  1. Create a virtal enviroment venv (in my case I named it “enyaq-venv”):
python3 -m venv enyaq-venv
  1. go to directory:
cd /home/openhabian/skoda-venv/bin
  1. activate venv
source ~/skoda-venv/bin/activate
  1. Install all packages:
pip install \
  git+https://github.com/tillsteinbach/carconnectivity-plugin-mqtt.git \
  git+https://github.com/tillsteinbach/carconnectivity-connector-skoda.git \
  git+https://github.com/tillsteinbach/carconnectivity-cli.git
  1. Upgrade all packages:
  pip install --upgrade \  
  git+https://github.com/tillsteinbach/carconnectivity-plugin-mqtt.git \
  git+https://github.com/tillsteinbach/carconnectivity-connector-skoda.git \
  git+https://github.com/tillsteinbach/carconnectivity-cli.git
  1. Create a file called carconnectivity.json:
sudo nano carconnectivity.json

The file has to contain the following:

{
    "carConnectivity": {
        "log_level": "error", // set the global log level, you can set individual log levels in the connectors and plugins
        "connectors": [
            {
                "type": "skoda", // Definition for a MySkoda account
                "config": {
                    //"log_level": "info",
                   //"api_log_level": "info",
                    "interval": 600, // Interval in which the server is checked in seconds
                    "username": "xxxxxxxxxxx", // Username of your MySkoda Account
                    "password": "xxxxxxxxxxx" // Password of your MySkoda Account
                }
            }
        ],
        "plugins": [
            {
                "type": "webui",
                "config": {
                    "enabled":true, 
                    "host":"192.168.1.172",
                    "port":4000,
                    "username": "openhabian", // Generic  username for login
                    "password": "**************" // Password for login
 }
            },
            {
                "type": "mqtt", // Definition for the MQTT Connection
                "config": {
                    "broker": "192.168.1.172", // Broker hostname or IP address
                    "username": "", // Broker username to login (optional)
                    "password": "", // Broker password to login, (optional)
                    //"api_log_level": "info",
                    "keepalive": 60
              }
            }
        ]
    }
}
  1. Fire-up the program:
carconnectivity-mqtt carconnectivity.json

Use MQTT Explorer to find your topics or just use the console:

mosquitto_sub -h 192.168.1.172 -t "carconnectivity/0/plugins/mqtt/topics" -v

mosquitto_sub -h 192.168.1.172 -t "carconnectivity/0/plugins/mqtt/writeable_topics" -v

You can now also access the webui: 192.168.1.172:4000

You will need a rule that starts the program every 10 mintues (for some reason…). Create an openab rule running the following code every 10minutes:

var command = ["bash", "-c", "source /home/openhabian/skoda-venv/bin/activate && carconnectivity-mqtt /home/openhabian/carconnectivity.json"]; 
actions.Exec.executeCommandLine(command);

Most useful topics:

SoC: 
stateTopic:carconnectivity/0/garage/YOURVIN/drives/primary/level

Target Charging Level: 
stateTopic: carconnectivity/0/garage/YOURVIN/charging/settings/target_level
commandTopic: carconnectivity/0/garage/YOURVIN/charging/settings/target_level_writetopic

Position: 
stateTopic: carconnectivity/0/garage/YOURVIN/position/latitude
stateTopic: carconnectivity/0/garage/YOURVIN/position/longitude

Range: 
stateTopic: carconnectivity/0/garage/YOURVIN/drives/primary/range

Climatization Temperature:
commandTopic: carconnectivity/0/garage/YOURVIN/climatization/settings/target_temperature_writetopic
stateTopic: carconnectivity/0/garage/YOURVIN/climatization/settings/target_temperature

Clima-Control:
commandTopic: carconnectivity/0/garage/YOURVIN/climatization/commands/start-stop_writetopic
stateTopic: carconnectivity/0/garage/YOURVIN/climatization/commands/start-stop


2 Likes