Matter Virtual Device

Matter Device SDK

Matter virtual devices are useful for developing and testing Matter solutions, and can be commissioned using the Google Home app (GHA), and controlled using GHA and Google Assistant, just like physical Matter devices.

For app developers and others who need to test or emulate a virtual Matter device but lack the resources to build their own physical or virtual Matter device, Google offers the Matter Virtual Device (MVD). MVD is a lightweight standalone Linux desktop tool that simulates different types of virtual Matter devices and provides a graphical user interface to control and display the states of the virtual Matter device.

Unlike a physical Matter device, MVD does not rely on Bluetooth® Low Energy (BLE) or Thread® in order to join a Matter fabric. Instead, it uses the host Linux machine's existing Wi-Fi network connection for commissioning.

Compared to other tools

The MVD differs from the Virtual Device Controller (VDC) in that it is a self-contained solution, combining a virtual device with a UI for controlling it. In contrast, the VDC is used to control a separate virtual Matter device, such as the one we build in the Matter Virtual Device Development Environment (MVD-DE).

You may have already worked with the MVD-DE codelab. In this codelab, you build a single type of virtual device-a smart bulb. In contrast, the MVD contains several different pre-built virtual devices and includes an integrated UI to run and control them.

Table: Virtual Matter device tool comparison
MVD VDC MVD-DE (Codelab)
Emulate a Matter device
Control an emulated Matter device
Development effort required
Download less than 100 MB 9 GB 20 GB

Supported devices

Currently, the MVD supports the following Matter device types:

Table: Matter device types supported for MVD
Matter Device Type Application Cluster(s) Home Ecosystem Type
Color Temperature Light 0x0300
0x0008
0x0006
Light
Dimmable Light 0x0008
0x0006
Light
Extended Color Light 0x0300
0x0008
0x0006
Light
Occupancy Sensor 0x0406
Sensor
On/Off Light 0x0008
0x0006
Light
On/Off Plug-in Unit 0x0008
0x0006
Outlet

Install MVD

MVD runs on 64-bit x86 processor machines running Debian (11 or above) or Ubuntu (20.04 or above).

To install it:

Download the MVD Debian (.deb) package

Download the armored-ASCII signature (.asc) file

Then run dpkg to install the MVD Debian (.deb) package:

sudo dpkg -i mvd_1.1.0_amd64.deb

Check port usage

The controller module in MVD uses TCP port 33000 to make RPC calls to the virtual device, so if this port is already in use by another process on your computer, be sure to free it up.

To see whether any process is using port 33000:

sudo fuser -v 33000/tcp

You can kill any process using TCP port 33000 with a single command:

sudo fuser -k 33000/tcp

Run MVD

Run MVD from your applications folder or from the terminal:

mvd

Configure your device

The main screen appears upon launch, and allows you to configure a virtual device:

  • Device Type: Select the device type (for example, Light, Switch, Sensor and so forth).
  • Device Name: Give the device a user-friendly name.
  • Discriminator: A 12-bit number used to discern between multiple commissionable device advertisements. (Default: 3840).
  • Matter Port: A port for Matter commissioning and communication through IP networks. Matter uses TCP/UDP port 5540 by default, but you can configure the virtual device to use a different port, as long as no other service is using it.
  • Vendor ID: Currently only test vendor ID 0xFFF1 is supported.
  • Product ID: Currently only test product IDs 0x8000 through 0x801F are supported.

Virtual Device configuration
screen

Configure your firewall

If you have a firewall running in your computer, either shut it down, or allow incoming TCP/UDP connections on the Matter port.

To view the current active netfilter firewall rules, run:

sudo iptables -L -n

Note: If you are using ufw, it can be disabled with:

sudo ufw disable
And it can be re-enabled with:
sudo ufw enable

Run your device

After the device is configured, click Create device. When the device is created, the Controller screen appears. Depending on the type of device you selected, you may see one or more of the following controls:

  • On/Off: Common to the majority of devices.
  • Level: For example, a light could have a level slider to adjust brightness.
  • Color: For example, a color light could have this control.
  • Occupancy: The Occupancy Sensor offers this control, to simulate the occupied/unoccupied state.

All virtual devices have the following controls:

  • QRCode: Shows the QR code used for commissioning.
  • Reboot: Restarts the virtual device. The device is disconnected from the network briefly.
  • Reset: Factory-resets the current device and clears all state, including commissioning, current controls state, and so forth
  • Delete: Destroys the device and returns to the Create device screen.

Virtual Device control
screen

Commission your device

The device is commissionable as soon as it is created.

There are a couple of prerequisites for commissioning the device:

  • You must have a project in Google Home Developer Console. This project must contain a Matter integration that has the same VID/PID combination as the one you used in setting up your virtual device. See the project creation guide for details.

  • You must have a Google Nest Hub that supports Matter

  • You must have an Android phone running Android 8.1 or later, with GHA installed.

  • The Android phone must be connected to the same Wi-Fi network as the hub.

  • The host machine must be connected to the Wi-Fi network.

To commission the device using the GHA, click QRCode to display the device's QR code, then follow the instructions in Pair a Matter device which explain how to onboard a Matter device using the GHA. You may also commission the device using the Google Home Sample App for Matter.

See our Matter Primer to learn how Matter Commissioning works.

Control the device

After you commission a virtual device, you can control the device using the Google Home App or Google Assistant by voice. You can either:

  • Control the device through GHA or Assistant while monitoring state changes on the virtual device, or
  • Control the device using the Sample App for Matter while monitoring state changes on the virtual device,or
  • Control device state through MVD itself while monitoring state changes in GHA or Assistant.

Test with the device

To test with Assistant, we recommend using an utterance simulator such as Google Home Extension for VS Code or Google Home Plugin for Android Studio.

View device details

The Device detail screen shows detailed device information:

  • Name: The friendly name given to the device.
  • Device Type: The device type selected.
  • Discriminator: The current device discriminator.
  • Vendor ID: The current device vendor ID.
  • Product ID: The current device product ID.
  • RPC Port: The RPC port that device communicates with controllers (GUI).
  • Matter Port: The port used by current device to communicate through IP network.
  • Pass Code: The PIN used to commission the device through the network.
  • Configuration Folder: The folder that virtual device stores configuration.
  • Commission Information: Shows the fabric(s) that the device joined and the node id of the device in the fabric

View device logs

If you launched MVD from the terminal, log output appears on stdout. You can also view device logs on the Device logs tab.

Stop the device

To stop and destroy the device, click Delete.

Terminate the app

Closing the control window destroys the device and terminates the MVD application. If you launched from the terminal, you can also terminate the application by typing Ctrl-C in the terminal.

Get help

To get help with MVD, to report a bug, or to request a new feature, reach out to your Google support contact.

Clicking the help button in the upper-right corner of the window takes you to this page.

File a bug

If you feel you have found a defect in the MVD, you may file a bug by clicking the Issue button in the upper-right corner of the window.

Send feedback

To submit your thoughts on what you like about MVD or how we can improve your experience with the tool, complete our Feedback Form.

The form can be launched from the feedback button in the upper-right corner of the window, or by clicking the button below.

Send us your feedback