|
4 | 4 | ---
|
5 | 5 | ## MeatPi [Discord server](https://discord.com/invite/2hpHVDmyfw)
|
6 | 6 | ## Please update to the [latest firmware version](https://github.com/meatpiHQ/wican-fw/releases/)
|
| 7 | +--- |
| 8 | +# [Official Docs](https://meatpihq.github.io/wican-fw/) |
7 | 9 |
|
8 | 10 | ## Order on [**Mouser**](https://www.mouser.com/c/?m=MeatPi) or [**Crowd Supply!**](https://www.crowdsupply.com/meatpi-electronics)
|
9 | 11 |
|
|
65 | 67 | - [OBDII PID Request Over MQTT](#5-obdii-pid-request-over-mqtt)
|
66 | 68 | - [Request Battery SoC MQTT Example](#6-request-battery-soc-mqtt-example)
|
67 | 69 | - [CAN to JSON interpreter - Filtring](#7-can-to-json-interpreter---filtring)
|
68 |
| -- [Home Assistant](#home-assistant) |
69 |
| - |
70 | 70 | - [Firmware Update](#firmware-update)
|
71 | 71 | - [OTA](#1-ota)
|
72 | 72 | - [USB Flash](#2-usb-flash)
|
@@ -443,102 +443,6 @@ Custom ID|355| 170| 170| 170| 170|_5_| _34_| 170| 170
|
443 | 443 |
|
444 | 444 | The PID in the configuration should be set to -1. The values to extract are from Byte 4 and Byte 5. The formula used here is (5 + 34)/2, so the expression to set is (B4 + B5)/2.
|
445 | 445 |
|
446 |
| -# Home Assistant |
447 |
| - |
448 |
| -WiCAN seamlessly integrates with Home Assistant via the MQTT protocol, automatically retrieving vehicle data and publishing it. Sensors are created in Home Assistant without any manual intervention, making setup effortless. |
449 |
| - |
450 |
| -**Note:** The [WiCAN PRO](https://www.crowdsupply.com/meatpi-electronics/wican-pro) model supports more car models. |
451 |
| - |
452 |
| -<img width="394" alt="image" src="https://github.com/user-attachments/assets/75460d61-3656-4458-aeca-0f8a3657d6ad"> |
453 |
| - |
454 |
| -### Getting Started Guide |
455 |
| - |
456 |
| -1. **Install the Home Assistant [Mosquitto broker add-on](https://github.com/home-assistant/addons/blob/master/mosquitto/DOCS.md).** |
457 |
| - |
458 |
| -2. **Create a new Home Assistant user account for WiCAN.** |
459 |
| - The credentials for this account will be used to configure the MQTT settings in WiCAN. |
460 |
| - |
461 |
| -3. **Connect to the WiCAN access point** (WiCAN_xxxxxxxxxxxx). |
462 |
| - Open a web browser and navigate to [http://192.168.80.1/](http://192.168.80.1/). |
463 |
| - |
464 |
| -4. **Set the "Mode" to AP+Station.** |
465 |
| - |
466 |
| -5. **Enter your home WiFi network SSID and password.** |
467 |
| - |
468 |
| -6. **Set the Protocol** to Autopid |
469 |
| - |
470 |
| -7. **Enable [MQTT](#mqtt)** and enter the Home Assistant credentials created in step 2. |
471 |
| - |
472 |
| -8. **Go to the "Automate" tab and enable "Vehicle Specific".** |
473 |
| - |
474 |
| -9. **Select your vehicle model from the dropdown list.** |
475 |
| - If the list is empty, download the latest [vehicle profiles file](https://github.com/meatpiHQ/wican-fw/blob/main/vehicle_profiles.json) and upload it using the "Choose File" button. |
476 |
| - |
477 |
| -10. **If your vehicle isn't supported,** open an issue on GitHub, and I’ll assist you in creating a new vehicle profile if possible. |
478 |
| - |
479 |
| -11. **Enable "Home Assistant Discovery".** |
480 |
| - This will automatically create sensors in Home Assistant. |
481 |
| - |
482 |
| -12. **Fill in the "Destination Topic" and "Cycle Time".** |
483 |
| - - **Destination Topic:** The MQTT topic where WiCAN will publish the vehicle data. |
484 |
| - - **Cycle Time:** Defines how frequently WiCAN will pull and publish the vehicle parameters to Home Assistant. |
485 |
| - |
486 |
| -13. **Press the "Store" button and reboot the device** for the changes to take effect. |
487 |
| - |
488 |
| ---- |
489 |
| - |
490 |
| -### ---Deprecated method--- |
491 |
| -### 1. EV Battery Examples [Wiki Page](https://github.com/meatpiHQ/wican-fw/wiki/EV-Battery-SoC-in-Home-Assistant-%E2%80%90-Example) |
492 |
| -In this example, we will learn how to set up Home Assistant to request the battery State of Charge (SoC) without using Node-RED. This example has been tested on an ORA Funky Cat vehicle and can also serve as a reference for requesting other Parameter IDs (PIDs) in addition to SoC. EV Battery Examples [Wiki Page](https://github.com/meatpiHQ/wican-fw/wiki/EV-Battery-SoC-in-Home-Assistant-%E2%80%90-Example) |
493 |
| - |
494 |
| -### 2. Node-RED Example |
495 |
| - |
496 |
| -WiCAN is able to send CAN bus messages to Home Assistant using MQTT protocol. I found that using Node-RED is the simplest way to create automation based on the CAN messages received. This short video highlights some of the steps https://youtu.be/oR5HQIUPR9I |
497 |
| - |
498 |
| -1. Install Home Assistant [Mosquitto broker add-on](https://github.com/home-assistant/addons/blob/master/mosquitto/DOCS.md) |
499 |
| -2. Create Home Assistant new user account for WiCAN. These user credentials will be used to set up the MQTT setting for WiCAN. |
500 |
| -3. Connect to WiCAN access point WiCAN_xxxxxxxxxxxx then, using a web browser, go to http://192.168.80.1/ |
501 |
| -4. Set the "Mode" to Ap+Station |
502 |
| -5. Fill in your Home WiFi network SSID and Password. |
503 |
| -6. Enable [MQTT](#mqtt) and fill in the Home Assistant credentials created in step 2 |
504 |
| -7. Install Home Assistant [Node-RED Add-on](https://github.com/hassio-addons/addon-node-red) |
505 |
| -8. Download [wican_example_flow.json](https://github.com/meatpiHQ/wican-fw/blob/main/ha/wican_example_flow.json) and replace **device_id** with your WiCAN ID. |
506 |
| -9. Open Node-RED Add-on and import the edited "wican_example_flow.json" |
507 |
| -10. Double click on the subsction Node and edit the server fill in MQTT broker IP address and credentials created in step 2 |
508 |
| -11. Click deploy. |
509 |
| -12. To create a new MQTT sensor, you’ll need to edit the configuration.yaml file by adding the following lines: |
510 |
| - |
511 |
| -``` |
512 |
| -mqtt: |
513 |
| - sensor: |
514 |
| - - name: "Amb Temp" |
515 |
| - state_topic: "CAR1/Amb_Temp" |
516 |
| - unit_of_measurement: "C" |
517 |
| - value_template: "{{ value_json.amb_temp }}" |
518 |
| - - name: "Fuel Level" |
519 |
| - state_topic: "CAR1/Fuel_Level" |
520 |
| - unit_of_measurement: "%" |
521 |
| - value_template: "{{ value_json.fuel_level }}" |
522 |
| -``` |
523 |
| -11. Restart Home assistant |
524 |
| -12. After restart go to dashboard and Add new Card entity. |
525 |
| - |
526 |
| -## Workflow summery |
527 |
| - |
528 |
| -In this example we've got one Node subscribed to topic ``` wican/device_id/status ```, when WiCAN connects to the local network it will publish ``` {"status": "online"} ```. Once the Node function ``` Send Get Amb Temp req ``` receives online status it will send a OBD2 request to get the ambient temperature. The OBD2 request message looks like this: |
529 |
| - |
530 |
| -``` { "bus": "0", "type": "tx", "frame": [{ "id": 2015, "dlc": 8, "rtr": false, "extd": false, "data": [2, 1, 70, 170, 170, 170, 170, 170] }] } ``` |
531 |
| - |
532 |
| -Frame ID : 2015 or 0x7DF |
533 |
| -PID: 70 or 0x46 |
534 |
| - |
535 |
| -Here is a good [reference](https://www.csselectronics.com/pages/obd2-pid-table-on-board-diagnostics-j1979) on how to construct a PID request. Note select DEC from drop down list. |
536 |
| - |
537 |
| -We have another Node subscribed to topic ``` wican/device_id/can/rx ```, once the car ECU responds to the request the function ``` Parse Amb Temp RSP ``` will parse the message and publish a message to topic ``` CAR1/Amb_Temp ```. Notice that when you edited ``` configuration.yaml ``` file create an MQTT Entity that subscribes to ``` CAR1/Amb_Temp ``` and expects a message ``` { value_json.amb_temp } ``` with unit_of_measurement C. |
538 |
| - |
539 |
| - |
540 |
| - |
541 |
| - |
542 | 446 | # Firmware Update
|
543 | 447 |
|
544 | 448 | ## 1. OTA:
|
|
0 commit comments