npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

homebridge-virtual-matter-accessories

v1.0.3

Published

Virtual Matter accessories for Homebridge.

Readme

Virtual Matter Accessories For Homebridge

Plugin for Homebridge that provides the ability to create virtual Matter accessories.

UI Languages

Currently Virtual Matter Accessories For Homebridge offers Spanish and Dutch translations for the UI. This can be accessed by changing the Language setting in Homebridge UI. The plugin will use this setting. Please vote in this ticket for which language you would like to see the UI translated to: Looking for people interested in translating the plugin UI into other languages

You do not have to volunteer to translate it, but hopefully will provide feedback if there are issues with the translations.

📝 Table Of Contents

About Virtual Matter Accessories For Homebridge

This plugin is the Matter version of my Virtual Matter Accessories For Homebridge plugin.

The purpose of this plugin is to be able to create different types of Matter virtual accessories. I am in the process of moving my entire smart home setup to Matter, so I wanted to have my virtual accessories exposed as Matter devices also. Hence this plugin.

This is work in progress so I will be releasing bug fixes and updates. Also, I will slowly add new accessories and functionality, either as I need them, or, more likely, in response to requests by users who find this plugin useful.

Currently, these are the implemented virtual accessories:

  • Switch. Allows you to create a number of different types of virtual switches.
    • Plain old switches. What it says on the label.
    • Normally on/off switches. The default state of the switch can be set to "on" or "off". This is also the default state when Homebridge restarts. If you pair it with a timer, the switch will revert back to the default state when the timer expires.
    • Stateful switches. The state of the switch persists across restarts of Homebridge. This includes timed switches.
    • Switches with companion sensors. The switch will trigger a companion sensor when it changes state, generating an Apple Home-native notification in the Home app. Selecting a critical sensor type will allow notifications to bypass Focuses like "Do Not Disturb". This is just the easier way of implementing a switch triggered sensor.
    • Timed switches. This is a way to introduce timers into Apple Home. The switch will revert back to its default state when the timer expires. If the switch is stateful, the timer will be restored after a restart of Homebridge. While care is taken to restore the timer with the appropriate time correction, absolute accuracy is not guaranteed and should not be expected. The accuracy of the restored timer will be affected, among other things, by the hardware and software Homebridge is running on, the number of plugins installed, the order with which the plugins are restored, etc. (see note below)
  • Timer. To create a timer, create a timed switch.

[!NOTE] When a timed switch is restored after a restart, if the the time remaining on the timer after correction is 0 seconds (i.e. the timer expired while Homebridge was not running), this would leave the switch in a bad state. So the timer will always be restored to at least 1 second, thus allowing the timer to end, reset the switch to its default state, and the switch flip event to occur for any automations depending on it. This is a tradeoff wherein a late event is preferred to a lost event.

Back to top

Installation

You can install this plugin via the Homebridge UI or from the command line by typing:

npm install -g homebridge-virtual-matter-accessories

Back to top

Configuration

You can configure the plugin from the Homebridge UI, or by ediiting the JSON configuration directly in the Homebridge JSON Config editor. In the UI, required fields will be marked with an asterisk (*) and you will not be allowed to save the configuration if the required fields are not filled in.

accessoryID, accessoryName, and accessoryType are required fields for all the accessories.

The configuration is validated on startup, so if an accessory is misconfigured, you will see error entries in the logs to help you correct the configuration. The log entries will indicate the misconfigured fields and look something like this:

[12/21/2024, 12:35:38 AM] [Virtual Matter Accessories Platform] Skipping accessory. Configuration is invalid: { "accessoryID": "12345", "accessoryName": "My Switch", ... }
[12/21/2024, 12:35:38 AM] [Virtual Matter Accessories Platform] Invalid fields: [switchDefaultState]

[!IMPORTANT] accessoryID uniquely identifies an accessory and each accessory must have a different value. This is because Apple Home requires a unique and unmodifiable serial number to identify an accessory. The accessory ID acts as a virtual serial number for each accessory that must be unique and unmodifiable. If you do assign the same accessory ID to multiple accessories by mistake, on startup the plugin will skip any accessory that has a duplicate ID and output a message in the logs alerting you to the issue. If you change the value of accessoryID after saving the config, Apple Home will interpret the change as the "old" accessory having been deleted and a "new" one added. This will cause the Home app to delete any scenes and automations that use the deleted accessory. Some plugins use the accessory name as the unique ID, which means that you cannot easily change the name. Virtual Matter Accessories For Homebridge uses a dedicated field as the unique ID, allowing you to modify the accessory name, if you so choose to. I use random.org to generate unique IDs. While the plugin only requires 5 digits for the IDs, I use 7-digit values between 1,000,000 and 10,000,000. This provides a range of 9 million possible IDs, which greatly reduces the chances of a duplicate.

[!NOTE] acccessoryName is the name that will apppear on the Apple Home tile for the accessory, as well as the accessory header in the plugin config. While a unique name is not required, it is recommended to assign different names to each accessory. As Vitual Accessories For Homebridge uses accessoryID as the unique identifier, you can change the accessory name at any time, if you so choose to. The name change will be propagated to the Home app.

It is recommended to use the Homebridge UI to configure this plugin, as the requirements may vary based on the property value selections. If you choose to manually create or modify the accessory JSON configurations, the following configurations are references and do not cover all of the different value permutations. Please adjust for your requirements.

Back to top

Accessory Configurations

These are example configurations of the virtual accessories and provided for reference only. They are not intended to be exhaustive of all the different permutations and it is recommended that you use the UI to fully explore each accessory's setup.

Switch

{
    "name": "Virtual Matter Accessories Platform",
    "devices": [
        {
            "accessoryID": "1234567",
            "accessoryName": "My Switch",
            "accessoryType": "switch",
            "accessoryIsStateful": false,
            "switch": {
                "defaultState": "off",
                "muteLogging": false
            }
        }
    ],
    "platform": "VirtualAccessoriesForHomebridge"
}

Switch with reset timer

{
    "name": "Virtual Matter Accessories Platform",
    "devices": [
        {
            "accessoryID": "1234567",
            "accessoryName": "My Switch",
            "accessoryType": "switch",
            "accessoryIsStateful": false,
            "switch": {
                "defaultState": "off",
                "hasResetTimer": true
            },
            "resetTimer": {
                "duration": {
                    "days": 0,
                    "hours": 0,
                    "minutes": 0,
                    "seconds": 10
                },
                "isResettable": true
            }
        }
    ],
    "platform": "VirtualAccessoriesForHomebridge"
}

Switch with random reset timer

{
    "name": "Virtual Matter Accessories Platform",
    "devices": [
        {
            "accessoryID": "1234567",
            "accessoryName": "My Switch",
            "accessoryType": "switch",
            "accessoryIsStateful": false,
            "switch": {
                "defaultState": "off",
                "hasResetTimer": true
            },
            "resetTimer": {
                "durationIsRandom": true,
                "durationRandomMin": {
                    "days": 0,
                    "hours": 0,
                    "minutes": 5,
                    "seconds": 0
                },
                "durationRandomMax": {
                    "days": 0,
                    "hours": 0,
                    "minutes": 20,
                    "seconds": 0
                },
                "isResettable": true
            }
        }
    ],
    "platform": "VirtualAccessoriesForHomebridge"
}

Switch with companion sensor (sensor triggered on & off by switch state)

{
    "name": "Virtual Matter Accessories Platform",
    "devices": [
        {
            "accessoryID": "1234567",
            "accessoryName": "My Switch",
            "accessoryType": "switch",
            "accessoryIsStateful": false,
            "switch": {
                "defaultState": "off",
                "hasCompanionSensor": true
            },
            "companionSensor": {
                "name": "My Companion Sensor",
                "type": "contact"
            }
        }
    ],
    "platform": "VirtualAccessoriesForHomebridge"
}

Back to top

Known Issues

Issues with Homebridge UI:

  • None currently.

Issues with underlying frameworks:

  • There is an issue with checkboxes requiring two clicks to uncheck. A bug report has been opened on the framework repo.

Back to top

What if I run into a problem?

Check the Wiki. Here you will find entries with instructions in the event of breaking updates. I will also post detailed instructions for using certain functionalities, like the webhook service.

If the Wiki entries do not provide answers to your problem, you can check the #virtual matter accessories channel on Discord for any notifications, or open a bug report or a support request here on GitHub. Please include log outputs and configuration details to the issue, making sure to remove any sensitive information such as passwords, tokens, etc. The more information you provide, the better I can investigate the issues.

Please open a Feature Request issue if you have any enhancement suggestions or any additional functionality that you would like to see added, or comment on an existing issue if one is already open. If the enhancement suggestion fits within the scope of the plugin, I will consider adding it in a future release.

Back to top