CLI tool to poll the Viessmann API for feature data and publish it to an MQTT broker. Supports automatic Home Assistant device discovery and bidirectional command execution via MQTT.
- Automatic Data Polling: Continuously polls Viessmann API and publishes device data to MQTT
- Home Assistant Integration: Automatic device discovery for seamless Home Assistant integration
- MQTT Commands: Bidirectional communication - send commands to your Viessmann devices via MQTT
- Multiple Device Support: Supports heating systems, gas boilers, heat pumps, fuel cells, and hybrid systems
- Multiple Installations: Handles multiple installations, gateways, and devices
- Change Detection: Only publishes data when values change, reducing MQTT traffic
- Configurable Polling: Adjustable polling interval to balance responsiveness and API usage
npm install && npm run build
V2M_USERNAME='***' \
V2M_PASSWORD='***' \
V2M_CLIENT_ID=*** \
V2M_MQTT_URI=mqtt://rpi1:1883 \
npm startThe latest tag on Docker Hub matches the main branch (stable line). Rolling builds from develop use the edge tag.
docker run -d \
-e V2M_USERNAME='***' \
-e V2M_PASSWORD='***' \
-e V2M_CLIENT_ID=*** \
-e V2M_MQTT_URI=mqtt://rpi1:1883 \
tomquist/viessmann2mqtt:latestThis repository includes a Home Assistant App for running viessmann2mqtt directly inside Home Assistant. Home Assistant calls these Apps (formerly known as add-ons).
- Add this repository in Settings → Apps → App Store → Repositories using the URL of this repo.
- Install the Viessmann2MQTT app.
- Configure the Viessmann
username,password, andclient_idin the app configuration. - The app will automatically use the Home Assistant MQTT service credentials. Advanced users can override them in YAML mode using
mqtt_uri,mqtt_username, andmqtt_password.
See viessmann2mqtt/DOCS.md for the full app configuration reference.
GitHub’s default branch is main (stable, versioned releases). Development happens on develop (rolling pre-release).
| Channel | Add-on repository URL | What you get |
|---|---|---|
| Stable (default) | https://github.com/tomquist/viessmann2mqtt or https://github.com/tomquist/viessmann2mqtt#main |
config.yaml on main (e.g. 1.1.0); pre-built images match that version. |
| Pre-release | https://github.com/tomquist/viessmann2mqtt#develop |
Latest commits on develop; version: next and the next container tag. |
How to add or switch: Settings → Apps → App Store → ⋮ → Repositories. Use the plain repo URL or #main for stable; use #develop only if you want pre-release builds.
Pre-release caveat: The store version often stays next while commits move. Supervisor may not show an “update” for every push; use Check for updates, or Rebuild / Reinstall to pick up the latest develop build.
For local app testing, use the Home Assistant devcontainer setup. This repository includes the recommended devcontainer and VS Code tasks files so you can open the repo in VS Code and run the “Start Home Assistant” task to bootstrap Supervisor and Home Assistant for local app testing.
The app can be configured using these environment variables:
V2M_USERNAME(required): Username of the Viessmann accountV2M_PASSWORD(required): Password of the Viessmann accountV2M_CLIENT_ID(required): A Viessmann API client idV2M_CLIENT_SECRET(optional): Client secret (not required when using a public API key)V2M_ACCESS_TOKEN_URI(optional): Override the OAuth token URL. Defaulthttps://iam.viessmann-climatesolutions.com/idp/v3/tokenV2M_AUTHORIZATION_URI(optional): Override the OAuth authorization URL. Defaulthttps://iam.viessmann-climatesolutions.com/idp/v3/authorizeV2M_REDIRECT_URI(optional): Set this to customize the redirect URL. Defaulthttps://localhost/redirectV2M_SCOPES(optional): Can be used to customize the scopes using a comma-separated list. DefaultIoT User,offline_accessV2M_BASE_URL(optional): Override the Viessmann API base URL. Defaulthttps://api.viessmann-climatesolutions.comV2M_POLL_INTERVAL(optional): The polling interval in seconds. Default60
V2M_MQTT_URI(required): The MQTT broker URL, e.g.mqtt://host:1883ormqtts://host:8883for TLSV2M_MQTT_USERNAME(optional): Username for MQTT authenticationV2M_MQTT_PASSWORD(optional): Password for MQTT authenticationV2M_MQTT_CLIENT_ID(optional): MQTT client identifier. Default:viessmann2mqttV2M_MQTT_TOPIC(optional): Topic prefix where data should be published. Default:viessmannV2M_MQTT_RETAIN(optional): Retain MQTT messages. Default:falseV2M_MQTT_DISCOVERY(optional): Enable Home Assistant device discovery. Default:trueV2M_MQTT_COMMANDS(optional): Enable MQTT command subscription for device control. Default:trueV2M_VERBOSE(optional): Set totruefor more detailed logs. Default:false
Device features are published to topics following this pattern:
{TOPIC}/installations/{INSTALLATION_ID}/gateways/{GATEWAY_SERIAL}/devices/{DEVICE_ID}/features/{FEATURE_PATH}
Example:
viessmann/installations/12345/gateways/ABC123/devices/0/features/heating.circuits.0.operating.programs.comfort
Each message contains:
{
"timestamp": "2024-01-01T12:00:00Z",
"properties": {
"temperature": {
"value": 21.5,
"unit": "celsius"
}
}
}When V2M_MQTT_DISCOVERY=true (default), device discovery configurations are published to:
homeassistant/device/{DEVICE_ID}/config
These configurations automatically create entities in Home Assistant for:
- Climate controls
- Sensors (temperature, pressure, etc.)
- Switches and buttons
- Number inputs for setpoints
- Select entities for modes and programs
The device identifiers match the ViCare integration format ({gateway_serial}_{device_serial}) for compatibility.
When V2M_MQTT_COMMANDS=true (default), commands can be sent to devices via MQTT:
Topic Pattern:
{TOPIC}/installations/{INSTALLATION_ID}/gateways/{GATEWAY_SERIAL}/devices/{DEVICE_ID}/features/{FEATURE_PATH}/commands/{COMMAND_NAME}/set
Example - Set Temperature:
mosquitto_pub -h mqtt-broker \
-t "viessmann/installations/12345/gateways/ABC123/devices/0/features/heating.circuits.0.operating.programs.comfort/commands/setTemperature/set" \
-m '{"temperature": 22.0}'Example - Set Mode (single parameter):
mosquitto_pub -h mqtt-broker \
-t "viessmann/installations/12345/gateways/ABC123/devices/0/features/heating.circuits.0.operating.modes.active/commands/setMode/set" \
-m "standby"Command Payload Formats:
- Single parameter commands: Can send the value directly (string/number/boolean) or as JSON object
- Multi-parameter commands: Must send JSON object with parameter names as keys
- Values are validated against command constraints (min/max, enum values, stepping)
The application automatically detects and supports:
- Heating Devices: Generic heating systems
- Gas Boilers: Vitodens, Vitocrossal, Vitopend series
- Heat Pumps: Vitocal series, VBC70, V200WO1A, CU401B
- Fuel Cells: Vitovalor, Vitocharge, Vitoblo series
- Hybrid Systems: Systems with both boiler and heat pump roles
Device types are detected based on device roles and model identifiers.
# Install dependencies
npm install
# Build
npm run build
# Run in development mode
npm run dev
# Run tests
npm test
# Run tests with UI
npm run test:ui
# Lint
npm run lint
# Fix linting issues
npm run lint:fixContributions are welcome! This project follows standard open-source contribution practices.
- Fork the repository
- Clone your fork:
git clone https://github.com/your-username/viessmann2mqtt.git - Create a branch:
git checkout -b feature/your-feature-name - Install dependencies:
npm install
- Make your changes - Write code following the existing patterns
- Run tests - Ensure all tests pass:
npm test - Check linting - Fix any linting issues:
npm run lint:fix - Test manually - Verify your changes work as expected
- Commit - Write clear, descriptive commit messages
- Push - Push to your fork:
git push origin feature/your-feature-name - Create PR - Open a pull request against the
developbranch
- Default branch is
main(what users and HA see by default). Merge releases intomainfromdevelopvia Actions → Release (workflow dispatch) with a semver (e.g.1.2.0). The workflow runsrelease.shand needs a repository secretRELEASE_TOKEN: a fine-grained personal access token with Contents: Read and write on this repository only (see GitHub docs). - CI publishes Docker Hub
latestand GHCR add-onlateston every push tomain(and again on semver tags).developpushes useedge/next. - After the first CI push to GitHub Container Registry, open the
viessmann2mqtt-addonpackage settings and set visibility to Public so Home Assistant Supervisor can pull the add-on image without authentication.
- Follow the existing code style and patterns
- Use TypeScript for type safety
- Run
npm run lint:fixbefore committing to auto-fix formatting issues - Ensure
npm run lintpasses without errors - Use meaningful variable and function names
- Add comments for complex logic
- Write tests for new features and bug fixes
- Ensure all existing tests pass:
npm test - Use the test UI for debugging:
npm run test:ui - Tests are located in
src/**/__tests__/directories - Follow the existing test patterns and use the test helpers
- Title: Use a clear, descriptive title
- Description: Explain what changes you made and why
- Testing: Describe how you tested your changes
- Breaking Changes: Clearly mark any breaking changes
- Related Issues: Reference any related issues using
#issue-number
src/app.ts- Main application entry pointsrc/api.ts- Viessmann API clientsrc/config.ts- Configuration managementsrc/commands.ts- MQTT command subscription handlersrc/publish.ts- MQTT publishersrc/devices/- Device-specific implementationsbase.ts- Base device classfactory.ts- Device factory for auto-detectiondiscovery.ts- Device discovery decoratorshomeassistant.ts- Home Assistant discovery generationheating.ts,gaz-boiler.ts,heat-pump.ts,fuel-cell.ts,hybrid.ts- Device type implementations
src/devices/__tests__/- Test files
- Create a new device class extending
Deviceinsrc/devices/ - Add discovery methods using the
@discoverdecorator - Register the device type in
DeviceFactory.createDevice() - Add tests in
src/devices/__tests__/ - Update this README's "Supported Device Types" section
When reporting issues, please include:
- Description of the problem
- Steps to reproduce
- Expected behavior
- Actual behavior
- Environment details (Node version, OS, etc.)
- Relevant logs (use
V2M_VERBOSE=truefor detailed logs)
Feel free to open an issue for questions or discussions about potential features.
MIT