🚀 Virtual v0.10.0-alpha.1 — Visual Device Editor & Core Architecture Modernization
⚠️ Alpha Release & Community Testing Notice
Virtual v0.10 is a major modernization featuring a dedicated web-based Visual Device Editor, native Home Assistant entity models, and non-blocking asynchronous state storage.
This is an active alpha pre-release — please expect evolving features, edge cases, and ongoing polish.
Community testing and feedback are essential! If you encounter any bugs, state restoration regressions, or configuration issues, please open a GitHub issue with your configuration snippet and debug logs.
(Legacy v0.9 documentation is archived in README_v9.md).
🌟 Highlights
1. Interactive Web-Based Visual Device Editor
Configure your virtual devices with an intuitive visual tree interface instead of editing raw YAML files:
- Hosted Cloud Builder: Live on Google App Engine at https://virtual-dot-twrecked-tools.nn.r.appspot.com.
- One-Click Sync via Home Assistant: In Home Assistant, click Configure on any Virtual group to launch the editor with your existing devices preloaded. Click Save & Return, and the editor automatically updates your file on disk and reloads the integration via an authenticated webhook.
- Preset Device Templates ("Quick Adds"): One-click generation of common multi-entity devices:
- Motion Sensor (
binary_sensor+ batterysensor) - Contact Sensor (
binary_sensor+ batterysensor) - Dimmable & RGB Color Lights
- Ceiling Fan (speed count, direction, oscillation)
- Window Blind & Water Valve (timed durations and tick intervals)
- Smart Power Outlet (
switch+ power & energysensors) - Weather Station (temperature, humidity, atmospheric pressure)
- Motion Sensor (
- Collapsible Device Cards: Expand or collapse individual devices, or use the Collapse All / Expand All action when managing large configuration files.
- Local & Offline Friendly:
- Local LAN Mode: Run the editor locally using
python main.pyin thevirtual-device-editor/folder with zero data leaving your local network. - Manual Copy-Paste Fallback: No webhooks or network access required—edit visually, click Copy or Download, and paste into your
/config/virtual.yaml.
- Local LAN Mode: Run the editor locally using
2. Core Entity Architecture & Bug Squashing
- Native Platform Inheritance:
VirtualNumberrefactored to inherit from(VirtualEntity, NumberEntity), using native properties (_attr_native_value,_attr_native_min_value,_attr_native_max_value) and purely asynchronous state updates, eliminating threadpool worker overhead.VirtualSensorrefactored to inherit from(VirtualEntity, SensorEntity)using native properties (_attr_native_value,_attr_native_unit_of_measurement).
- Fixed Lock Freezing: Fixed a bug where configuring a
locking_timeleft locks permanently stuck in a locking/unlocking transition due to a coroutine callback error. Added timer cleanup on entity removal. - Fixed Lock
async_openCrash: Resolved anAttributeErrorinlock.open. - Immediate State Writing: Added missing
async_write_ha_state()calls acrosslight,switch,fan, andnumberservice actions. - Fixed Service Registration Lookup: Replaced dictionary
hasattrchecks across platforms with proper key lookups, preventing duplicate service registrations. - Cleaned Entity Attributes: Removed redundant duplication of native Home Assistant properties (
device_class,unit_of_measurement,brightness,color_mode, etc.) intoextra_state_attributes.
3. Non-Blocking Storage & Asynchronous Core
- Home Assistant Store for Trackers: Replaced hardcoded storage file paths and synchronous blocking file writes in event listeners with Home Assistant's managed non-blocking
Storehelper andasync_delay_save. - Zero Unmanaged Dependencies: Replaced
aiofileswith standard UTF-8 file operations running safely in the threadpool executor viahass.async_add_executor_job. - Eliminated Global Tracker State: Removed mutable module-level
global tracker_statesin favor of scoped state. - Removed Startup Delays: Eliminated arbitrary
asyncio.sleep(1)delay during integration setup. - Resolved Tracker Deprecation Warning: Replaced deprecated
location_nameproperty override onVirtualDeviceTrackerwith standard@property def state.
4. Global Units & Future HA Standards
- Centralized Device Class Units: Unified unit mappings under
DEVICE_CLASS_UNITSusing Home Assistant's global unit constants (UnitOfTemperature.CELSIUS,UnitOfDensity,UnitOfRatio). - Temperature Unit Auto-Healing: Replaced hardcoded
"C"defaults withUnitOfTemperature.CELSIUS('°C'). Added automatic normalization so that any existing configuration or restored state with"C","c", or"°C"automatically upgrades to'°C'without triggering Home Assistant warnings. - HACS & Manifest Modernization:
- Added
"render_readme": truetohacs.jsonso modern HACS displays the full documentation directly in the HACS interface. - Added
"integration_type": "helper"tomanifest.json. - Added full Python 3.12 type annotations (
from __future__ import annotations). - Eliminated all wildcard imports (
from .const import *).
- Added
🛠️ Testing Checklist for Alpha Testers
- State Restoration: Verify that entities (lights, fans, covers, sensors, numbers, switches) maintain their values across a Home Assistant restart with
persistent: true. - Visual Device Editor: Test opening the editor via Settings -> Devices & Services -> Virtual -> Configure, adding a device or template, and verifying that clicking Save & Return updates your YAML file and reloads the devices automatically.
- Manual Fallback: Test building devices in the editor, clicking Copy, pasting into
/config/virtual.yaml, and reloading via Developer Tools -> YAML -> Reload Virtual Components. - Lock & Cover Timers: Test virtual covers and locks configured with duration/timing transitions to confirm smooth operation.