CarConnectivity mqtt setup

Hi there,

Sadly with openhab 5 the connectedcar binding which i used to communicate with my ID.3 soed not work anymore.

I found an mqtt script called CarConnectivity but struggle with the setup.

An MQTT Server is already running and working with openhab. But I have no idea how i can tell the script to use it. Also in the instructions of the script a setup file is mentioned. But I do not know where to put it or which steps are neccessary to setup my car.

Can anyone help?

It is a bit astounding to me that there is no official binding for use with VW cars.

Try this: GitHub - tillsteinbach/CarConnectivity-plugin-mqtt: Plugin for connecting CarConnectivity with MQTT brokers. Enables vehicle telemetry of various brands in MQTT

Did you try to troubleshoot (steps to reproduce, log files etc) the issue and or tag the developer of that binding?

Usually they are very happy when such reports are made and help them to improve the binding.

Hi.

Just came across this thread. I have installed the carconnectivity on my raspberry

  • Volkswagen Connector
  • Mqtt Plugin
  • Webui plugin

The webui is working with the connector and it shows my car
The Mqtt plugin however I was not able to make it work so I have mosquitto installed via openhabian-config and the binding in openhab.

I am a little stuck now. I will post the installation how to link later

Hi.

Just came across this thread. I have installed the carconnectivity on my raspberry

  • Volkswagen Connector
  • Mqtt Plugin
  • Webui plugin

The webui is working with the connector and it shows my car
The Mqtt plugin however I was not able to make it work so I have mosquitto installed via openhabian-config and the binding in openhab.

I am a little stuck now. This is the link for installation of the MQTT binding:

Install carconnectivity-mqtt on openhabian

Anyhow it is not working for me in openhab.

What is working is the webui:

Just do:

cd ~
python3 -m venv carconnectivity
cd carconnectivity
source bin/activate
pip3 install carconnectivity-plugin-mqtt
pip3 install carconnectivity-connector-volkswagen
pip3 install carconnectivity-plugin-webui

Use vi carconnectivity.json and add your configuration like:

{
    "carConnectivity": {
        "log_level": "error",
        "connectors": [
            {
                "type": "volkswagen",
                "config": {
                    "interval": 300,
                    "username": "<your-vw-username>",
                    "password": "<your-vw-password>",
                    "spin": "<your-vw-pin>"
                }
            }
        ],
        "plugins": [
            {
                "type": "webui",
                "config": {
                    "username": "<admin>",
                    "password": "<password>"                    
                }
            }
        ]
    }
}

Start once

In the virtual environment:

carconnectivity carconnectivity.json

then got to your browser:

http://localhost:4000

Link to github for webui:

tillsteinbach/CarConnectivity-plugin-webui

CarConnectivity and the ID.Buzz – Life of a Developer

I did the same based on the description in GitHub without the webui because its not needed with openhab.
Problem: The tool does not start automatically on system start. I needed a systemd service for that

Thats why I created a small start script:

start_car_connect:

source carconnectivity/bin/activate
carconnectivity-mqtt carconnectivity.json

and a systemd config file to start this script:

CarConnectivity-plugin-mqtt.service:

[Unit]
Description=CarConnectivity-plugin-mqtt
After=network.target

[Service]
Type=idle
Restart=on-failure
User=openhabian
Environment=PYTHONPATH=/home/openhabian/carconnectivity
WorkingDirectory=/home/openhabian
ExecStart=/bin/bash start_car_connect

[Install]
WantedBy=multi-user.target

copy this file to systemd and change righst:

sudo cp CarConnectivity-plugin-mqtt.service /lib/systemd/system/CarConnectivity-plugin-mqtt.service
sudo chmod 644 /lib/systemd/system/CarConnectivity-plugin-mqtt.service

and activate it:

sudo systemctl daemon-reload
sudo systemctl start CarConnectivity-plugin-mqtt

Just in case someone has the same issue…

How did you continue once the MQTT setup in the json was complete?

WebUI is working for me, but I don’t see an MQTT thing in my inbox or something like that….

I configured them in a thing file:

//weconnect
    Thing topic Golf "Golf" @ "Garage" { 
            Channels:
                Type number : latitude           [ stateTopic="carconnectivity/0/garage/WVWZZZ____________/position/latitude"]
                Type number : longitude          [ stateTopic="carconnectivity/0/garage/WVWZZZ____________/position/longitude"]
                Type string : position_type      [ stateTopic="carconnectivity/0/garage/WVWZZZ____________/position/position_type"]
                Type string : state              [ stateTopic="carconnectivity/0/garage/WVWZZZ____________/state"]
                Type number : odo                [ stateTopic="carconnectivity/0/garage/WVWZZZ____________/odometer"]
                Type switch : lights             [ stateTopic="carconnectivity/0/garage/WVWZZZ____________/lights/light_state" ,on="on", off="off"]
                Type switch : lights_left        [ stateTopic="carconnectivity/0/garage/WVWZZZ____________/lights/left/light_state", on="on", off="off"]
                Type switch : lights_right       [ stateTopic="carconnectivity/0/garage/WVWZZZ____________/lights/right/light_state", on="on", off="off"]
                Type datetime : inspection_at    [ stateTopic="carconnectivity/0/garage/WVWZZZ____________/maintenance/inspection_due_at"]
                Type datetime : oil_service_at   [ stateTopic="carconnectivity/0/garage/WVWZZZ____________/maintenance/oil_service_due_at"]
                Type number : inspection_after  [ stateTopic="carconnectivity/0/garage/WVWZZZ____________/maintenance/inspection_due_after"]
                Type number : oil_service_after  [ stateTopic="carconnectivity/0/garage/WVWZZZ____________/maintenance/oil_service_due_after"] 
    } 

This is the set of channels which was working without carconnect plus account.
I need to figure out the channels for carconnect plus

You need to replace WVWZZZ____________ with your VIN

WebUI is working for me….

Is the car connector mqtt service automatically starting after reboot when you install the webui?

This is how I configured it in the things file:

Thing topic id4 “ID.4” (mqtt:broker:mqttv2) {
 Channels:
  Type number : odometer “Kilometerstand” [ stateTopic=“carconnectivity/0/garage/WVGZZZ~~~~~~~~~~~~~/odometer”]
...
}

I do however only get NULL in return. WebUI however shows the correct number.

Did you check the correct topic path with MQTT explorer?

Other MQTT devices are working fine in your setup?

Did you connect items with the channels?

Yeah, I did connect the items and other MQTT devices work as well… I’ll try MQTT explorer later and give feedback.

Edit: MQTT Explorer was a great tip. It’s working now.

1 Like