Skip to content

Commit 9af1c67

Browse files
authored
Update mqtt.md
1 parent 6dde3db commit 9af1c67

File tree

1 file changed

+58
-35
lines changed
  • docs/content/1.home assistant

1 file changed

+58
-35
lines changed

docs/content/1.home assistant/mqtt.md

+58-35
Original file line numberDiff line numberDiff line change
@@ -2,38 +2,61 @@
22
title: MQTT
33
---
44

5-
# Home Assistant and WiCan over MQTT
6-
This tutorial will show you how to get up and running with Home Assistant and WiCan using MQTT. We are making the below assumptions
7-
8-
* Home Assistant OS is installed, so you can use addons.
9-
* Your Vehicle already has a Vehicle Profile created
10-
11-
## Installing and Configuring MQTT
12-
* [Follow the official docs](https://github.com/home-assistant/addons/blob/master/mosquitto/DOCS.md) for installing MQTT Addon
13-
* Create a WiCan user for HA via `Settings -> People -> Users`. Make sure to record the username and password
14-
* Make sure your WiCan has Station mode enabled
15-
* On the `Settings` Tab of the WiCan website fill in the following settings
16-
* `MQTT URL` This should be the IP/domain of your HA server. If you are using a reverse proxy you will also need to forward port 1883
17-
* `MQTT Port` HA uses the default port 1883
18-
* `MQTT User` This is the user you just created
19-
* `MQTT Pass` The Password for the user you just created
20-
* `TX Topic` Default is fine
21-
* `RX Topic` Default is fine
22-
* `Status Topic` Default is fine
23-
* `MQTT elm327 log` Leave Disabled
24-
* `Protocol` Change to "AutoPID"
25-
* On the `Automate` Tab
26-
* Upload the latest `vehicle_profiles.json` you view it [here](https://github.com/meatpiHQ/wican-fw/blob/main/vehicle_profiles.json) Just press the download button on the file.
27-
* Enable Vehicle Specific
28-
* Select your car from the dropdown.
29-
* Enable Grouping
30-
* Enable Home Assistant Discovery
31-
* Press `Store`
32-
Thats it, restart the WiCan from the `About` tab, and you should start to get values in Home Assistant from the WiCan.
33-
34-
## Debugging
35-
36-
### MQTT Explorer
37-
You can use the MQTT Explorer to view the MQTT data to see whats happening. This can be downloaded as a desktop app, or [as a HA addon](https://community.home-assistant.io/t/addon-mqtt-explorer-new-version/603739)
38-
39-
If you are having issues getting it working we recommend using MQTT explorer to make sure your `status` topic is getting a status, this at least confirms the MQTT part is at least working.
5+
# Integrating Home Assistant and WiCAN via MQTT
6+
7+
In this guide, you'll learn how to set up WiCAN with Home Assistant using MQTT to monitor your vehicle's data in real time. This integration provides seamless access to your vehicle's sensors and allows for automatic Home Assistant discovery.
8+
9+
## Prerequisites
10+
11+
Before you begin, ensure that the following requirements are met:
12+
13+
- **Home Assistant OS** is installed on your device, and you have access to the add-ons feature.
14+
- Your **WiCAN device** is set up and has a vehicle profile created.
15+
16+
## Step 1: Installing and Configuring the MQTT Add-on
17+
18+
1. [Install the MQTT add-on](https://github.com/home-assistant/addons/blob/master/mosquitto/DOCS.md) by following the official documentation.
19+
2. Create a **WiCAN user** for Home Assistant by navigating to `Settings -> People -> Users`. Record the username and password.
20+
3. Ensure WiCAN is operating in **Station Mode**.
21+
4. In the **Settings** tab of the WiCAN interface, input the following settings:
22+
- **MQTT URL**: Use the IP or domain of your Home Assistant server. If you're using a reverse proxy, forward port 1883.
23+
- **MQTT Port**: The default port for Home Assistant is 1883.
24+
- **MQTT User**: The username you created in Step 2.
25+
- **MQTT Password**: The password you created in Step 2.
26+
- **TX Topic, RX Topic, Status Topic**: The default values are sufficient.
27+
- **MQTT ELM327 Log**: Leave this option disabled unless you are debugging.
28+
- **Protocol**: Set this to **AutoPID**.
29+
30+
## Step 2: Configuring WiCAN Automation
31+
32+
1. In the **Automate** tab of the WiCAN interface:
33+
- Upload the latest `vehicle_profiles.json` file. You can download it [here](https://github.com/meatpiHQ/WiCAN-fw/blob/main/vehicle_profiles.json) by pressing the download button.
34+
- Enable **Vehicle-Specific Settings**.
35+
- Select your vehicle from the dropdown menu.
36+
- Set the **Destination Topic** where your vehicle data will be sent.
37+
- Set the **Cycle Time** for sensor updates in milliseconds
38+
- Enable **Home Assistant Discovery** to automatically detect the sensors in Home Assistant.
39+
- Press `Store` to save your changes.
40+
41+
2. Restart your WiCAN device from the **About** tab.
42+
43+
Now, your WiCAN should start sending sensor data to Home Assistant. You can view the available sensors by navigating to [Entities](https://my.home-assistant.io/redirect/entities) in Home Assistant.
44+
45+
## Step 3: Debugging and Troubleshooting
46+
47+
### Using MQTT Explorer
48+
49+
If you encounter issues, you can use **MQTT Explorer** to monitor your MQTT data and identify potential problems.
50+
51+
- MQTT Explorer is available as a [desktop app](https://mqtt-explorer.com/) or [Home Assistant add-on](https://community.home-assistant.io/t/addon-mqtt-explorer-new-version/603739).
52+
53+
1. Check if the `status` topic is receiving updates. If it is, this confirms that the MQTT connection is functioning correctly.
54+
2. If no data appears in Home Assistant, ensure that:
55+
- Your WiCAN is connected to the correct MQTT server.
56+
- Home Assistant discovery is enabled in the WiCAN settings.
57+
58+
### Additional Tips
59+
60+
- **Cycle Time**: Adjust the cycle time if sensor updates are too frequent or too slow.
61+
- **WiCAN Reboot**: If you encounter connection issues, reboot both your WiCAN and Home Assistant.
62+

0 commit comments

Comments
 (0)