Skip to main content

CarConnectivity plugin for publishing data to MQTT

Project description

CarConnectivity Plugin for MQTT

GitHub sourcecode GitHub release (latest by date) GitHub GitHub issues PyPI - Downloads PyPI - Python Version Docker Image Size (latest semver) Docker Pulls Donate at PayPal Sponsor at Github

CarConnectivity will become the successor of WeConnect-python in 2025 with similar functionality but support for other brands beyond Volkswagen!

CarConnectivity is a python API to connect to various car services. If you want to publish the data collected from your vehicle in a standard protocol such as MQTT this plugin will help you. This Client enables you to integrate with the MQTT Broker of your choice (e.g. your home automation solution such as ioBroker, FHEM or Home Assistant)

How to install

Install using PIP

If you want to use CarConnectivity-mqtt, the easiest way is to obtain it from PyPI. Just install instead using:

pip3 install carconnectivity-plugin-mqtt

Connectors & Plugins

In order to connect vehciles from various brands, you need to install connector, e.g. with:

pip3 install carconnectivity-connector-volkswagen
pip3 install carconnectivity-connector-skoda

Create config file

Create a carconnectivity.json config file like this (Example if you have a Volkswagen and a MySkoda account). A documentation of all possible config options can be found here.

{
    "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": {
                    "interval": 600, // Interval in which the server is checked in seconds
                    "username": "test@test.de", // Username of your MySkoda Account
                    "password": "testpassword123" // Password of your MySkoda Account
                }
            },
            {
                "type": "volkswagen", // Definition for a Volkswagen account
                "config": {
                    "interval": 300, // Interval in which the server is checked in seconds
                    "username": "test@test.de", // Username of your Volkswagen Account
                    "password": "testpassword123" // Username of your Volkswagen Account
                }
            }
        ],
        "plugins": [
            {
                "type": "mqtt", // Definition for the MQTT Connection
                "config": {
                    "broker": "192.168.0.123", // Broker hostname or IP address
                    "username": "testuser", // Broker username to login
                    "password": "testuser", // Broker password to login
                }
            }
        ]
    }
}

Startup

When using docker-compose configure CarConnectivity-MQTT like that:

carconnectivity-mqtt carconnectivity.json

Updates

If you want to update, the easiest way is:

pip3 install carconnectivity-plugin-mqtt --upgrade
pip3 install carconnectivity-connector-volkswagen --upgrade
pip3 install carconnectivity-connector-skoda --upgrade

With Docker

There is also a Docker image to easily host CarConnectivity-MQTT: See on Dockerhub

Other

Times

By default the times coming from the car are UTC isoformat. You can convert times to your local timezone by adding convert-times to your config. Convert times will use the timezone specified in TZ variable. You can format times in your local format by adding timeformat to your config. This will use the default Date/Time format of your locale setting (LC_ALL variable). If you want to set a specific format add e.g. timeformat '%a %d %b %Y %T' to your config.

...
  carconnectivity-mqtt:
    image: "tillsteinbach/carconnectivity-mqtt:edge"
    environment:
      - TZ=Europe/Berlin
      - LANG=de_DE
      - LC_ALL=de_DE
...

Using Miles or Farenheit

CarConnectivity will guess your desired temperature or range/speed unit based on the systems locale. If it does not match what you want, you can set a different locale in your carconnectivity.json json config.

Credentials

If you do not want to provide your username or password inside the configuration you have to create a ".netrc" file at the appropriate location (usually this is your home folder):

# For MQTT broker
machine mymqttbroker
login test@test.de
password testpassword123

In this case the configuration needs to look like this:

{
    "carConnectivity": {
        "connectors": [
            ...
        ]
        "plugins": [
            {
                "type": "mqtt",
                "config": {
                    "broker": "mymqttbroker"
                }
            }
        ]
    }
}

You can also provide the location of the netrc file in the configuration.

{
    "carConnectivity": {
        "connectors": [
            ...
        ]
        "plugins": [
            {
                "type": "mqtt",
                "config": {
                    "broker": "mymqttbroker"
                    "netrc": "/some/path/on/your/filesystem"
                }
            }
        ]
    }
}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

carconnectivity_plugin_mqtt-0.1a12.tar.gz (27.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

carconnectivity_plugin_mqtt-0.1a12-py3-none-any.whl (17.9 kB view details)

Uploaded Python 3

File details

Details for the file carconnectivity_plugin_mqtt-0.1a12.tar.gz.

File metadata

File hashes

Hashes for carconnectivity_plugin_mqtt-0.1a12.tar.gz
Algorithm Hash digest
SHA256 aa7785733af9609208d7b11f35ef00369aa37abb3c43afb78c748c6ff563c2f6
MD5 9092d5c83c6f2f0bdf60bef1950dee40
BLAKE2b-256 e23c18c54823efdd504bf332621794038c7b9943c92f840f06eca242d7768193

See more details on using hashes here.

Provenance

The following attestation bundles were made for carconnectivity_plugin_mqtt-0.1a12.tar.gz:

Publisher: build_and_publish.yml on tillsteinbach/CarConnectivity-plugin-mqtt

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file carconnectivity_plugin_mqtt-0.1a12-py3-none-any.whl.

File metadata

File hashes

Hashes for carconnectivity_plugin_mqtt-0.1a12-py3-none-any.whl
Algorithm Hash digest
SHA256 01223d1a529c5f72373b8ef9d86c25d28fe84e949aa4d367d4fd4b3144f0c652
MD5 b7cd5982daec65198ec75c31698a5efc
BLAKE2b-256 c24c5d090f394d3d73b953a41a6a9c2c0e30577f78bd6dc2d3632484f95deaa8

See more details on using hashes here.

Provenance

The following attestation bundles were made for carconnectivity_plugin_mqtt-0.1a12-py3-none-any.whl:

Publisher: build_and_publish.yml on tillsteinbach/CarConnectivity-plugin-mqtt

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page