WiCAN Pro MQTT Command Reference

The WiCAN Pro exposes a powerful command and response channel over MQTT. This interface allows you to remotely control the device, query its status, and trigger on-demand diagnostic polling (AutoPID groups). This is incredibly useful for integrating the WiCAN Pro into smart home platforms like Home Assistant.

MQTT Topics Overview

The device uses the following topics based on its unique Device ID. (Note: Replace <device-id> with your specific WiCAN device ID, e.g., wican-abcdef).

TopicDirectionPurpose
wican/<device-id>/cmdPublish (Send to device)Send commands to the device.
wican/<device-id>/rspSubscribe (Receive from device)Receive command responses.
wican/<device-id>/batterySubscribeBattery voltage, published on connect (Retained).
wican/<device-id>/statusSubscribeDevice availability (online / offline) (Retained, LWT).

Command Payloads

Commands are formatted as JSON and published to the wican/<device-id>/cmd topic.

1. Get Battery Voltage

Query the current 12V battery voltage directly from the WiCAN Pro.

Publish to cmd:

{"cmd": "get_vbatt"}

Response on rsp:

{"battery_voltage": 12.34}

2. Reboot Device

Trigger a remote reboot of the WiCAN Pro adapter.

Publish to cmd:

{"cmd": "reboot"}

Response on rsp:

{"rsp": "ok"}

(Note: The device will reboot approximately 2 seconds after acknowledging this command).

3. Manage AutoPID Groups (On-Demand Diagnostics)

Activate or deactivate a specific AutoPID group configured in the Web UI. This allows you to wake up the network or poll specific ECU data only when needed (preventing constant 12V battery drain).

Publish to cmd:

{
  "command": "set_group", 
  "group_name": "PCM", 
  "active": true, 
  "timeout": 5
}

Parameters:

  • group_name (String): Must exactly match the group name configured in the WiCAN Web UI.
  • active (Boolean): true to start polling the group, false to stop.
  • timeout (Integer, Optional): Minutes until the group auto-deactivates. If omitted, defaults to 15 minutes.

Response on rsp:

{"group": "PCM", "active": true, "timeout": 5}

Home Assistant Integration Example

Using the set_group command, you can trigger on-demand diagnostics from a Home Assistant automation.

For example, you can create an automation that tells the WiCAN Pro to start polling your "Equinox_EV" AutoPID group for 10 minutes as soon as your garage door opens or when the vehicle starts charging:

alias: "WiCAN: Start Polling on Garage Open"
description: "Triggers the WiCAN Pro to poll vehicle data for 10 minutes"
trigger:
  - platform: state
    entity_id: cover.garage_door
    to: "open"
action:
  - service: mqtt.publish
    data:
      topic: "wican/wican-abcdef/cmd" # Replace with your device ID
      payload: '{"command": "set_group", "group_name": "Equinox_EV", "active": true, "timeout": 10}'
mode: single

Example 2: PyScript Integration (Scheduled Battery Polling)

If you prefer writing Python logic using the pyscript custom integration, you can easily schedule MQTT publishes. The following script runs every 10 seconds to poll the WiCAN Pro for its current 12V battery voltage:

TOPIC_CMD = "wican/wican-abcdef/cmd" # Replace with your specific device ID topic

@time_trigger("period(now, 10s)")
def get_wican_voltage():
    """Runs every 10 seconds to poll battery voltage the wican reports."""  
    service.call("mqtt", "publish", 
        topic=TOPIC_CMD, 
        payload='{"cmd": "get_vbatt"}')