WiCAN Configuration Page
WiCAN Configuration Page

Connect Your Car to Home Assistant with an ESP Wireless OBD2 Module

Wireless OBD2 modules, particularly those based on the ESP32 microcontroller, offer a seamless way to integrate your vehicle’s data with Home Assistant. This guide outlines the steps to connect a WiCAN, an Esp Wireless Obd2 Module, to Home Assistant using MQTT and Node-RED for data visualization and automation.

Setting up the WiCAN ESP Wireless OBD2 Module

Before diving into Home Assistant, configure your WiCAN module for network connectivity and MQTT communication.

  1. Initial Setup: Connect to the WiCAN’s access point (WiCAN_xxxxxxxxxxxx) via Wi-Fi. Access the configuration page using a web browser at http://192.168.80.1/.

  2. Network Configuration: Set the “Mode” to “Ap+Station”. Enter your home Wi-Fi network’s SSID and password, allowing the WiCAN to connect to your local network.

  3. Enable MQTT: In the WiCAN’s configuration page, enable MQTT. You’ll need to input the MQTT broker’s IP address, username, and password. These credentials will be created in the following steps within Home Assistant.

WiCAN Configuration PageWiCAN Configuration Page

Configuring Home Assistant for the ESP Wireless OBD2 Module

Now, let’s prepare Home Assistant to receive data from the WiCAN esp wireless obd2 module.

  1. Install Mosquitto Broker: Install the Mosquitto broker add-on in Home Assistant. This will act as the MQTT server for handling communication with the WiCAN.

  2. Create a Home Assistant User: Create a new user account specifically for the WiCAN within Home Assistant. Assign a username and password; these credentials will be used in the WiCAN’s MQTT settings (Step 3 above).

  3. Install Node-RED: Install the Node-RED add-on in Home Assistant. Node-RED provides a visual interface for creating flows to process and visualize data from the WiCAN.

  4. Import Node-RED Flow: Download the wican_example_flow.json file from the WiCAN GitHub repository (https://github.com/meatpiHQ/wican-fw/blob/main/README.md#home-assistant). Replace “device_id” with your WiCAN’s unique ID. Import this edited JSON file into your Node-RED instance.

  5. Configure Node-RED MQTT Node: Within Node-RED, double-click the MQTT subscribe node in the imported flow. Configure the server settings with the Mosquitto broker’s IP address and the credentials created in step 2.

Creating MQTT Sensors in Home Assistant

Finally, create sensors in Home Assistant to display the data received from the esp wireless obd2 module.

  1. Edit configuration.yaml: Add the following lines to your configuration.yaml file, replacing “CAR1” with your preferred device identifier:
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 }}" 
  1. Restart Home Assistant: Restart Home Assistant to apply the changes.

  2. Add Sensors to Dashboard: After restarting, add the newly created sensors to your Home Assistant dashboard. You should now see live data from your vehicle.

By following these steps, you can successfully integrate your car with Home Assistant using an esp wireless obd2 module like the WiCAN. This setup opens up a wide range of possibilities for monitoring vehicle data, creating automations, and gaining deeper insights into your car’s performance.

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 *