Virtual Meter Home Assistant Add-on Repository

December 25, 2025 · View on GitHub

Python Version OpenSSF Scorecard report codecov CodeQL Dependabot Updates SonarCloud Analysis MegaLinter

This repository hosts the Virtual Meter Home Assistant add-on (virtual-meter/). The add-on provides a Shelly Pro 3EM (Gen2) emulator so that Hoymiles 1920 AC battery owners can control battery charge and discharge based on grid consumption data.

Add repository on my Home Assistant

Layout

.
├── tests/                          # Unit tests
├── virtual-meter/                  # Add-on root
│   ├── app/                        # Add-on application code
│   │   ├── assembler.py            # Payload assembly from provider data
│   │   ├── cache.py                # In-memory payload cache
│   │   ├── config.py               # Settings loader
│   │   ├── consumer.py             # Polling client
│   │   ├── identity.py             # Device ID/MAC helpers
│   │   ├── main.py                 # Entry point
│   │   ├── mdns.py                 # mDNS/zeroconf broadcaster
│   │   ├── payload_templates.py    # Static payload templates
│   │   ├── provider.py             # JSON-RPC server
│   │   └── serializer.py           # JSON codec helpers
│   ├── translations/               # Localized strings for the HA UI
│   ├── build.yaml                  # Base image pin per architecture
│   ├── CHANGELOG.md                # User-facing release notes rendered in HA
│   ├── config.yaml                 # Supervisor metadata & schema
│   ├── Dockerfile                  # Add-on Dockerfile
│   ├── DOCS.md                     # Documentation tab content
│   ├── icon.png / logo.png         # Store badges/icons
│   ├── README.md                   # Add-on specific developer notes
│   ├── requirements.txt            # Add-on runtime dependencies
│   └── run.sh                      # Entry script
├── README.md                       # This file
└── repository.yaml                 # Supervisor store metadata for this repo

Contributing

  1. Fork/clone this repository.
  2. Update repository.yaml with your GitHub URL if you plan to publish under a different namespace.
  3. Push changes to main.
  4. (Optional) Add the repository URL to Settings → Add-ons → Repositories inside Home Assistant for local testing.

For full configuration, upgrade, and troubleshooting guidance refer to virtual-meter/DOCS.md.

CI / QA

  • dependency-review.yml: dependency change auditing on PRs.
  • megalinter.yml: linting + SBOM generation on PRs and main.
  • scorecard.yml: OpenSSF Scorecard analysis on main.
  • tests.yml: unit test execution on PRs and main.
  • dependabot.yml and renovate.json: automated dependency updates.