Harness the power of your domestic vehicle’s onboard diagnostics system and bring real-time car data into your smart home environment using WiCAN and Home Assistant. This guide will walk you through the process of setting up WiCAN to send CAN bus messages, derived from your car’s OBD2 port, to Home Assistant using the MQTT protocol. By leveraging Node-RED, you can create powerful automations based on the wealth of information available from your vehicle’s Domestic Obd2 system.
Node-RED flow for WiCAN and Home Assistant integration, showing MQTT subscription and data processing nodes.
Here’s a step-by-step guide to seamlessly integrate your domestic OBD2 data into Home Assistant:
Setting up MQTT Broker in Home Assistant
- Begin by installing the Mosquitto broker add-on in your Home Assistant instance. This MQTT broker will act as the central communication hub for WiCAN to send data and for Home Assistant to receive it. You can find the Mosquitto broker add-on in the Home Assistant add-on store.
Creating a Dedicated Home Assistant User for WiCAN
- For security and streamlined access, create a new, dedicated user account within Home Assistant specifically for WiCAN. These credentials (username and password) will be essential for configuring WiCAN’s MQTT settings and ensuring secure data transmission.
Connecting to WiCAN Access Point and Accessing Web Interface
- Power up your WiCAN device and connect to its dedicated access point (WiCAN_xxxxxxxxxxxx) using your computer or smartphone. Once connected, open a web browser and navigate to
http://192.168.80.1/
. This will take you to the WiCAN web configuration interface.
Configuring WiCAN Mode to Ap+Station
- Within the WiCAN web interface, set the “Mode” to “Ap+Station”. This mode allows WiCAN to act as both an access point and a station, enabling it to connect to your home Wi-Fi network while still providing a direct connection for initial setup.
Connecting WiCAN to Your Home Wi-Fi Network
- Enter your Home Wi-Fi network’s SSID and Password in the designated fields within the WiCAN network settings. This step connects WiCAN to your local network, allowing it to communicate with your Home Assistant server.
Enabling MQTT and Inputting Home Assistant Credentials
- Enable the MQTT protocol within the WiCAN configuration settings. Then, input the Home Assistant user credentials (username and password) you created in step 2. Also, specify the MQTT broker address, which is typically your Home Assistant server’s IP address.
Installing Node-RED Add-on in Home Assistant
- Install the Node-RED add-on from the Home Assistant add-on store. Node-RED provides a visual, flow-based programming environment that simplifies the process of creating automations based on your domestic OBD2 data.
Importing the WiCAN Example Flow in Node-RED
- Download the “wican_example_flow.json” file from the WiCAN GitHub repository. Edit this file, replacing the “device_id” placeholder with your specific WiCAN device ID. Then, open the Node-RED add-on in Home Assistant and import the edited “wican_example_flow.json” file. This pre-built flow provides a starting point for processing OBD2 data.
Configuring MQTT Broker Details in Node-RED
- Within Node-RED, double-click on the “subscription” node (likely labeled “MQTT in”). Edit the server details to match your MQTT broker’s IP address and the Home Assistant credentials you created for WiCAN. This ensures Node-RED can subscribe to the MQTT topics where WiCAN publishes OBD2 data.
Deploying the Node-RED Flow
- Click the “Deploy” button in Node-RED. This activates the flow, enabling Node-RED to start listening for MQTT messages from WiCAN and processing the domestic OBD2 data.
Creating MQTT Sensors in Home Assistant Configuration
- To make your domestic OBD2 data accessible as sensors in Home Assistant, you need to edit your
configuration.yaml
file. Add MQTT sensor definitions for the specific OBD2 parameters you want to monitor. For example, to monitor ambient temperature and fuel level, add the following lines:
mqtt:
sensor:
- name: “Amb Temp”
state_topic: “CAR1/Amb_Temp”
unit_of_measurement: “C”
value_template: “{{ value_json.amb_temp }}”
- name: “Fuel Level”
state_topic: “CAR1/Fuel_Level”
unit_of_measurement: “%”
value_template: “{{ value_json.fuel_level }}”
Remember to adjust the state_topic
to match the MQTT topics your WiCAN device is publishing (e.g., “CAR1/Amb_Temp”, “CAR1/Fuel_Level”).
Restarting Home Assistant and Adding Entities to Dashboard
- Restart your Home Assistant instance for the changes in
configuration.yaml
to take effect. After restarting, go to your Home Assistant dashboard and add new “Entity” cards to display the newly created MQTT sensors. You will now be able to see real-time data from your domestic OBD2 system directly within your Home Assistant dashboard.
By following these steps, you can successfully integrate domestic OBD2 data from your vehicle into Home Assistant using WiCAN, opening up a world of possibilities for vehicle monitoring and smart home automations based on your car’s performance and status. Explore the extensive OBD2 parameter IDs (PIDs) available for your domestic vehicle to customize your monitoring and automation setup further.