🚀 Virtual v0.10.0-alpha.5 — Modular Hardware Ecosystem Configurations & Examples Reorganization
⚠️ Alpha Release & Community Testing Notice
Virtual v0.10 is an active alpha pre-release.
If you encounter any bugs, 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).
🌟 What's New in v0.10.0-alpha.5
1. Home Assistant Energy Dashboard Support (Sensor state_class)
VirtualSensornow automatically assigns appropriatestate_classattributes required by Home Assistant's native Energy Dashboard and long-term statistics:class: energyandclass: gas: automatically declarestate_class: total_increasing.class: power,temperature,humidity,voltage,battery, etc.: automatically declarestate_class: measurement.- Supports manual
state_class:overrides in YAML.
- Added
Sol-Ark Battery Energy InandSol-Ark Battery Energy Outsensors to complete Home Assistant's Energy Dashboard battery tracking. - Added
linked_powerconfiguration option tosensor.py:- Virtual energy sensors now automatically integrate companion power sensors into cumulative
kWhwithout requiring Riemann sum helpers in Home Assistant. - Added companion energy sensors to all sockets in
virtual-sonoff.yaml,virtual-climate.yaml(HVAC energy), andvirtual-examples.yaml(Water Heater energy).
- Virtual energy sensors now automatically integrate companion power sensors into cumulative
- Added
deadbandhysteresis (default 0.4°C) toThermalHvacSimulationto run authentic heating and cooling cycles and eliminate rapid 10-second short-cycling. - Added
battery_strategyoption (backupvsself_consumption):- In
backupmode (default), the battery is held at 100% float charge for emergencies while grid power is healthy. Deficits pull from cheap grid power. - When grid voltage drops (<= 25 V), the inverter automatically enters island mode, powering the home from solar and battery.
- In
- Added reactive grid voltage tracking (
grid_voltage_sensor) allowing seamless blackout testing using standardvirtual.set.
2. Inverter Baseload Tracking & Battery Polarity
- Base Load Power & Energy Sensors: The Sol-Ark simulation now exposes
base_load_power_sensorandbase_load_energy_sensor, allowing you to add baseline home draw to Individual Devices and eliminate "unaccounted for energy" on the Energy tab. - Simulation State Persistence: The simulation engines now restore their exact battery State of Charge, cumulative energy meters (
kWh), and gas consumption (m³) across Home Assistant restarts, ensuring seamless continuity on Energy Dashboard charts without resetting counters to zero. - Battery Power Polarity Fix: Corrected single-sensor battery polarity in
solar_inverter.pyto match Home Assistant's standard convention (negative = charging,positive = discharging), ensuring charging power is properly shown entering the battery.
3. Modular Hardware Ecosystem Configurations (examples/)
Added ready-to-import virtual device configuration files partitioned by simulated hardware brand:
examples/virtual-sonoff.yaml(6 devices):- 5 power-monitoring smart sockets: TV (with dynamic jitter), Audio Amplifier, Chest Freezer (15m/45m cyclic compressor), Washing Machine, and Heat Pump Tumble Dryer.
- Master Bedroom 3-speed ceiling fan controller & on/off light kit.
examples/virtual-hue.yaml(6 devices):- Dimmable warm white bulbs for bedrooms and closet.
- Multi-colored ambiance lights for front porch and back deck (supporting HS color, Kelvin color temp, and dynamic effects).
examples/virtual-zwave.yaml(25 standalone devices):- Motorized Schlage deadbolt with battery reporting and 2s transit delay.
- 5 Standalone door contact sensors (front, back, garage, shed, basement).
- 8 In-wall light switches.
- 11 PIR motion sensors with auto-clearing
off_delay: 20countdown timers.
4. Dedicated Climate & Multi-Platform Example Files
examples/virtual-climate.yaml:- Dedicated configuration file containing the closed-loop thermal HVAC system (Thermostat + Indoor Temp + Outdoor Weather Sync + Power Meter) and a standalone basic thermostat.
examples/virtual-examples.yaml:- Renamed from
virtual-umbrella.yamland streamlined to showcase diverse multi-platform devices (Security Alarm Panel, Action Button, Dropdown Select, Text Input, Media Player Speaker, Camera with HLS Streaming, TV Power Socket, and Gated Driveway Security Camera).
- Renamed from