Unlock Open OBD2 Data with WiCAN and Home Assistant for Smart Car Monitoring

Unlock Open OBD2 Data with WiCAN and Home Assistant for Smart Car Monitoring

Integrating your vehicle’s data into your smart home system opens up a world of possibilities for automation and monitoring. With Open Obd2 access, you can tap into a wealth of real-time information from your car’s engine and sensors. This guide demonstrates how to seamlessly connect your car’s CAN bus data to Home Assistant using WiCAN and MQTT, empowering you to create custom dashboards and automated routines based on your vehicle’s performance.

To begin, ensure you have the Mosquitto broker add-on installed in your Home Assistant setup. This MQTT broker will serve as the communication bridge between your WiCAN device and Home Assistant. Next, you’ll need to create a dedicated user account within Home Assistant specifically for WiCAN. These credentials will be essential for configuring the MQTT settings on your WiCAN device.

Now, connect to the WiCAN access point, typically named “WiCAN_xxxxxxxxxxxx,” using your preferred device. Once connected, navigate to http://192.168.80.1/ in a web browser to access the WiCAN configuration interface. Within the WiCAN settings, switch the “Mode” to “Ap+Station” to allow WiCAN to connect to both your car and your home Wi-Fi network. Enter your home Wi-Fi network’s SSID and password to establish this connection.

Enable the MQTT functionality within the WiCAN configuration and input the Home Assistant user credentials you created earlier. This step is crucial for WiCAN to transmit open OBD2 data via MQTT. To process and visualize this data in Home Assistant, install the Node-RED Add-on. Node-RED provides a visual flow-based programming environment, ideal for handling MQTT messages and creating automations.

Download the “wican_example_flow.json” file, and remember to replace the placeholder “device_id” with your unique WiCAN ID. Import this edited JSON flow into your Node-RED Add-on in Home Assistant. Within Node-RED, double-click the “subscription” node and configure the server details with your MQTT broker IP address and the same Home Assistant credentials used previously. Deploy these changes in Node-RED to activate the data flow.

To display specific open OBD2 data points as sensors in Home Assistant, you’ll need to modify your configuration.yaml file. For example, to monitor ambient temperature and fuel level, add the following MQTT sensor configurations:

mqtt:
  sensor:
    - name: “Ambient Temperature”
      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 replace "CAR1/Amb_Temp" and "CAR1/Fuel_Level" with the actual MQTT topics your WiCAN device is publishing for these parameters, aligning with your open OBD2 data stream. After modifying the configuration.yaml file, restart Home Assistant to apply the changes. Once Home Assistant restarts, you can add new entity cards to your dashboard to visualize the newly created MQTT sensors, bringing your car’s open OBD2 data directly into your smart home environment for monitoring and automation.

Comments

No comments yet. Why don’t you start the discussion?

Leave a Reply

Your email address will not be published. Required fields are marked *