{"id":16220029,"url":"https://github.com/kuba2k2/hassio-virtual-devices","last_synced_at":"2026-04-28T00:31:39.395Z","repository":{"id":215168462,"uuid":"738283185","full_name":"kuba2k2/hassio-virtual-devices","owner":"kuba2k2","description":"Create virtual devices in Home Assistant, add programmable custom entities","archived":false,"fork":false,"pushed_at":"2024-01-02T22:51:27.000Z","size":21,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-02-07T00:10:17.695Z","etag":null,"topics":["custom-integration","hacs-integration","home-assistant","home-assistant-entity","home-assistant-integration","integration","virtual-devices"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kuba2k2.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2024-01-02T21:45:51.000Z","updated_at":"2025-12-13T17:42:47.000Z","dependencies_parsed_at":"2024-01-03T00:07:17.690Z","dependency_job_id":"08ce2c54-4edd-4eca-a42b-d7e012f7d7ec","html_url":"https://github.com/kuba2k2/hassio-virtual-devices","commit_stats":null,"previous_names":["kuba2k2/hassio-virtual-devices"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/kuba2k2/hassio-virtual-devices","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kuba2k2%2Fhassio-virtual-devices","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kuba2k2%2Fhassio-virtual-devices/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kuba2k2%2Fhassio-virtual-devices/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kuba2k2%2Fhassio-virtual-devices/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kuba2k2","download_url":"https://codeload.github.com/kuba2k2/hassio-virtual-devices/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kuba2k2%2Fhassio-virtual-devices/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32361477,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-27T20:07:02.737Z","status":"ssl_error","status_checked_at":"2026-04-27T20:07:00.910Z","response_time":128,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["custom-integration","hacs-integration","home-assistant","home-assistant-entity","home-assistant-integration","integration","virtual-devices"],"created_at":"2024-10-10T11:56:54.295Z","updated_at":"2026-04-28T00:31:39.372Z","avatar_url":"https://github.com/kuba2k2.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Virtual Devices\n\nCreate virtual devices in Home Assistant, add programmable custom entities\n\n[![Open your Home Assistant instance and open a repository inside the Home Assistant Community Store.](https://my.home-assistant.io/badges/hacs_repository.svg)](https://my.home-assistant.io/redirect/hacs_repository/?owner=kuba2k2\u0026repository=hassio-virtual-devices\u0026category=integration)\n\n## Introduction\n\nThis is a custom integration for Home Assistant, that allows you to create virtual, software-defined devices.\n\nEach device you create can have its own set of entities. The entities that can be added are Python classes\n(called *modules* in this project), extending HA's base entity classes, as usual. Each entity class can execute\ndifferent code upon interaction, for example:\n\n- a `button` entity can light up an LED or play a sound\n- a `switch` entity can send ON/OFF signals to a 433 MHz-controllable plug\n- ...more examples to come (hopefully).\n\nThe major advantage of this integration is that it's fully GUI-configurable - no need to work with YAML files OR\n*ever* restart Home Assistant (well, at least once upon installation). Modules are also reloaded whenever the\nintegration starts (or a device is added), so they can be easily tested by just reloading the device entry.\n\n## Usage\n\n1. Install the integration, either via HACS (custom repository) or by copying directly to HA config.\n2. Restart Home Assistant to load the integration (it is needed the first time).\n3. Add the integration in Settings - this will create a virtual device.\n4. Write an entity module - examples are below.\n5. Click `Configure` next to the newly added device entry - from there you can add or edit virtual entities.\n\n## Modules\n\n*Entity modules* are just Python files that consist of a few mandatory parts:\n\n- `TITLE` (`str`) - a friendly name of the module, visible in GUI\n- `DESCRIPTION` (`str`) - a longer description of the module, not used yet\n- `PLATFORMS` (`dict[Platform, Type[Entity]]`) - a dictionary of all entity types provided by the module.\n\nModules are stored in the **`virtual_devices`** directory, which lies alongside the `configuration.yaml` file\n(that is, `/usr/share/hassio/homeassistant/virtual_devices/` on Supervised installations).\n\nEach module may provide one or more *entity types* (sometimes called \"platforms\" in HA). This should be\nself-explanatory: common types are for example `button`, `switch`, `light`, `sensor`, etc.\n\nThe `PLATFORMS` dictionary maps an entity type to a Python class. This class must extend one of Home Assistant base\nentity classes, such as `SwitchEntity`, `ButtonEntity`, `LightEntity`, etc. It must also extend `EntityMixin` from\nthis integration.\n\n**More info on writing entity classes: [Home Assistant Developer Docs](https://developers.home-assistant.io/docs/core/entity)**\n\nA simple module would look like this:\n\n```python\nimport voluptuous as vol\nfrom homeassistant.components.switch import SwitchEntity\nfrom homeassistant.config_entries import ConfigEntry\nfrom homeassistant.const import Platform\n\nfrom custom_components.virtual_devices import VirtualEntity\n\nTITLE = \"Linux GPIO Access\"\nDESCRIPTION = \"\"\n\n\nclass ExampleSwitch(SwitchEntity, VirtualEntity):\n\tdef __init__(self, config_entry: ConfigEntry, data: dict):\n        super().__init__(config_entry, data)\n\t\t# initialize the entity, e.g. set default state\n        self._attr_is_on = False\n\n\t@staticmethod\n    def get_config_schema() -\u003e vol.Schema:\n\t\t# get a schema for the GUI config flow - see below\n        return vol.Schema({})\n\n\tdef turn_on(self, **kwargs) -\u003e None:\n        # do something when switch turns ON\n        self._attr_is_on = True\n\n    def turn_off(self, **kwargs) -\u003e None:\n        # do something when switch turns OFF\n        self._attr_is_on = False\n\n\nPLATFORMS = {\n    Platform.SWITCH: ExampleSwitch,\n}\n```\n\n## Schema \u0026 configuration\n\nAn entity class must also have a configuration schema (even if it's empty). This will be used in the GUI config flow.\n\nThe schema may define form fields or [selectors](https://next.home-assistant.io/docs/blueprint/selectors/#constant-selector) that will be shown in the [config flow](https://developers.home-assistant.io/docs/config_entries_config_flow_handler). Currently, all form fields are visible in one step only.\n\nAdding a virtual entity to HA will then present a dialog with the defined form fields. Values entered by the user will\nbe available in the `self.config_entry.data` property within the entity class (this works just like in any other\nintegration with a config flow).\n\n## Examples\n\nFinally, a [complete working example](custom/components/modules/gpio.py) is built into the integration - it provides\na simple switch entity, that controls a GPIO. **It will only work if your Home Assistant host supports GPIO.**\n**Be careful when dealing with GPIOs, improper usage might break your hardware.**\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkuba2k2%2Fhassio-virtual-devices","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkuba2k2%2Fhassio-virtual-devices","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkuba2k2%2Fhassio-virtual-devices/lists"}