Modernized MyHOME Custom Component for Home Assistant
This is a completely modernized, async-native fork of the original integration, specifically hardened for legacy MH200 hardware and modern Home Assistant (2025+).
-
Fully Dynamic Auto-Discovery (No more YAML!): The integration has been completely disentangled from file-system based
myhome.yamlstatic configurations. Devices are now registered and configured natively through the Home Assistant UI Device Registry. The integration actively queries the OpenWebNet bus to discover all entities out of the box. Native support for complex F422 Cross-Bus Routing (e.g. addresses like18#4#02) is also completely handled automatically! -
Native Audio System Support (WHO=16): Full native support for Bticino/MyHome Audio Matrices, compatible with both legacy baseband and Sound System 2.0 stereo hardware. Exposes native
media_playerentities for all audio zones with bidirectional state tracking.- Turn On/Off, Source Selection & Volume: Full support for
turn_on,turn_off,select_source,volume_set,volume_up, andvolume_down. Source selection correctly addresses stereo amplifier zones (11xβ14x). - Absolute Volume Tracking: Full support for dimension messages (
*#16*where*#1*vol##), normalizing the 0β31 hardware scale automatically. - Software Mute Emulation: Since OpenWebNet lacks a native audio Mute function, this integration fully emulates local muting, keeping physical volume levels accurately cached.
- Turn On/Off, Source Selection & Volume: Full support for
-
π΅ Dynamic Proxy β Stream Music to Your BTicino Zones: The BTicino audio matrix (F441, S0105A) is a hardware-only analog switch β it cannot decode IP-based audio streams on its own. This integration bridges that gap with a Dynamic Proxy that lets you stream from Music Assistant, Spotify Connect, or any HA-compatible media source to your wired BTicino zones.
How it works (automatically):
- You configure one or more decoders (network media players physically connected to the matrix source inputs) via the Options UI.
- When Music Assistant or Spotify sends
play_mediato a BTicino zone, the proxy claims an idle decoder, wakes it, routes the matrix to the correct source input, and forwards the stream. - Playback state (title, artist, album art) is mirrored back from the decoder to the zone entity in real time.
- When the zone is turned off, the decoder is released back to the pool for other zones.
Compatible decoders: Any HA-integrated
media_playerentity with network streaming capability:- squeezelite / piCorePlayer β Free, runs on any Raspberry Pi with a DAC HAT (e.g. HiFiBerry DAC+). Discovered automatically by Music Assistant.
- Cambridge Audio (CXN, etc.) β High-end network streamer with HA integration. Works with
internet_radiocontent type since HA 2024.11. - WiiM Mini / Pro β Budget-friendly network streamer with AirPlay and HA support.
- Any DLNA, Chromecast, or AirPlay-capable device exposed as a
media_playerin HA.
Key features:
Feature Description Thread-safe pool asyncio.Lock-protectedDecoderPoolprevents race conditions when multiple zones compete for the same decoderUp to 4 simultaneous streams One decoder per physical source input (F441 has 4 inputs) Gain staging (anti-hiss) Per-decoder pre_gainoffset keeps the analog signal level high and the amplifier gain low, reducing bus noiseBackward compatible If no decoders are configured, the entity behaves exactly as before β PLAY_MEDIAis not advertisedAuto-reload Changing decoder config in Options UI rebuilds the pool without restarting HA -
Auto-Detect Dimmable Lights: Dimmers are automatically recognized from the OpenWebNet protocol. When the gateway sends a brightness level or brightness preset event, the light entity is promoted from simple on/off to full brightness control with transition support. No manual configuration needed β the integration learns from the bus traffic. A
customize.yamlfallback is still supported for manual overrides. -
Smart Gateway Configuration: The custom setup flow first attempts to auto-discover the gateway's MAC address and model by fetching the UPnP device descriptor directly from known BTicino ports (
http://<IP>:49153/description.xml). If the gateway does not support UPnP (e.g., older MH200 models), a manual fallback step is presented instead. This eliminates the need to manually look up the MAC address for most modern gateways (F454, MH202, MH201). -
MH200 & Stability Hardening: Resolved the fatal "Listener Death" bugs prevalent in the original library.
- Strict 120-second active watchdogs drop permanently hung TCP sockets efficiently.
- Exponential Backoff routines (
2s -> 60s) guard against embedded gateway DDoS on power restoration. - Polling queries (
SCAN_INTERVAL) drastically reduced by default for passive sensors. - Native integration caching (
ConfigEntryNotReady) entirely eliminates the infamous "Restart required on first installation" crash loop.
-
Robust Entity Migration & Registry Integrity: The integration includes self-healing logic for entity IDs. On startup, it automatically detects and corrects orphaned or mis-named entities from previous installations, reverting entity IDs back to the standard
light.light_XX/cover.cover_XXformat. Legacycustomize.yamlfriendly names are transparently absorbed and applied without requiring any manual re-configuration.
You can install this integration as a Custom Repository via HACS!
- Go to HACS -> Integrations -> Click the three dots (top right) -> Custom repositories
- Add this repository URL and select
Integrationas the category. - Restart Home Assistant.
Important: Do not use configuration.yaml for this integration. The legacy myhome.yaml approach has been completely disabled in favor of modern UI-driven architecture.
- Go to Settings -> Devices & Services -> Add Integration.
- Search for
MyHOME. - The component will automatically search your local network via SSDP for compatible BTicino gateways (e.g., MH200, F454, MyHomeServer1).
- If no gateways are found automatically, select "Custom" and enter your gateway's IP address and port. The integration will try to auto-detect the MAC address and model via UPnP. If that fails (e.g., on legacy MH200 gateways), a manual entry form is presented.
- Enter your gateway's OpenWebNet password when prompted.
Once connected, the integration strictly uses Auto-Discovery to find your Lights, Switches, Covers, and Audio Zones.
Simply use your physical wall switches to interact with your house. Home Assistant will capture the physical bus events, dynamically generate the devices in your dashboard (naming them by their hardware address, e.g., Light 18, Cover 18#4#02), and store them permanently!
To assign human-readable names (like "Kitchen Lights"):
- The Modern Way: Click on the generated Entity in the Home Assistant UI (
Settings -> Devices), click the gear icon, and rename it natively. - The Power-User Way: Use Home Assistant's native customize.yaml feature to bulk-rename entities without touching the underlying integration logic.
Audio zones are automatically discovered as media_player entities when any sound system traffic is detected on the bus. The supported features include:
| Feature | Method |
|---|---|
| Turn On/Off | Standard HA media player controls |
| Volume Up/Down | Step-based volume adjustment |
| Volume Slider | Absolute volume set (0β31 β normalized 0.0β1.0) |
| Source Selection | MH200 Startup Scenario (fixed routing β see below) |
| Mute | Software-emulated (caches volume, sets to 0, restores on unmute) |
Important: The original MH200 gateway (firmware β€ 2.1.0) cannot switch F441M matrix sources hiss-free via IP. All WHO=16 compound routing commands (
*16*3*1XY##) sent through the IP gateway produce audible analog relay transients because the gateway's SCS frame translation lacks the A5 analog isolation preamble that native bus devices (wall panels) include. Additionally, the MH200 does not support CEN/CEN+ virtual triggering over IP (WHO=15 and WHO=25 are NACK'd).
Solution: All zones are permanently routed to the Aux input (Source 2 β e.g. Cambridge CXN) via a power-on startup scenario programmed into the MH200 using the TiMH200 software. Streaming is handled entirely by the network decoder (Spotify Connect / Music Assistant), so no matrix routing change is ever needed at runtime.
The async_select_source method in media_player.py is intentionally a no-op that logs an informational message.
-
Open Configurator TiMH200 (Windows XP SP3 compatibility mode, Run as Administrator).
-
Create a new Scenario of type "All'accensione" (Power-On / Startup).
-
For each amplifier zone, add a sound system action:
- Action: Stereo ON (
WHAT=3) - Address: Compound
1<source><zone_digit>(e.g.121= Source 2, Zone 1)
- Action: Stereo ON (
-
The compound address table for Source 2 (Aux) β all 8 F441M outputs:
Amplifier Zone Zone Digit Compound Address Command 14 4 124 *16*3*124##17 7 127 *16*3*127##18 8 128 *16*3*128##21 (Bureau) 1 121 *16*3*121##22 2 122 *16*3*122##23 3 123 *16*3*123##35 5 125 *16*3*125##36 6 126 *16*3*126## -
Upload via Serial (COM1) to the MH200.
TiMH200 Upload Bug: On Windows 10/11, right-click
TiMH200.exeβ Properties β Compatibility β Windows XP (Service Pack 3) + Run as Administrator.
To restore full IP-based source switching (hiss-free CEN+ triggering), upgrade to an MH200N, F454, or F459 gateway. These support WHO=25 CEN+ virtual triggering over IP with proper SCS frame generation.
For manual OWN commands (e.g., via the myhome.send_message service), refer to the OpenWebNet specification for WHO=16.
To stream from Music Assistant, Spotify Connect, or other services to your BTicino audio zones, you need at least one decoder β a network media player physically connected to one of the matrix source inputs via RCA or 3.5mm.
- A BTicino audio matrix (F441, S0105A, or similar) with at least one free source input
- A network-capable media player wired to that input, integrated into Home Assistant as a
media_playerentity
-
Go to Settings β Devices & Services β MyHOME β Configure.
-
Scroll to the Decoder section.
-
For each connected decoder, fill in:
- Entity: The
media_playerentity ID of the decoder (e.g.media_player.cambridge_audio_cxn) - Source: The BTicino source input number (1β4) the decoder is physically wired to
- Pre-gain: A volume offset percentage (0β50) to optimise the analog signal-to-noise ratio. Recommended values:
0for decoders with fixed line-level output (e.g. Cambridge Audio with Pre-Amp OFF)15β20for software-level decoders (e.g. squeezelite on a HiFiBerry DAC)- Higher values for particularly noisy setups β start at
30and reduce if the decoder clips
- Entity: The
-
Click Submit. The decoder pool is rebuilt immediately without restarting HA.
The BTicino 2-wire bus introduces inherent analog noise. The pre_gain setting drives the decoder volume proportionally higher than the zone volume (decoder_vol = zone_vol + pre_gain/100, capped at 1.0), keeping the analog signal level high while reducing the amplifier's noise floor amplification. The result is cleaner audio at lower listening volumes.
The underlying OpenWebNet (OWNd) package has been exclusively vendored natively into this component (custom_components/myhome/ownd), allowing complete downstream control over exact OpenWebNet protocol implementations to maximize reliability.
| Gateway | UPnP Auto-Discovery | Notes |
|---|---|---|
| F454 | β | Full UPnP support (port 49153) |
| MH202 / MH201 | β | Full UPnP support |
| MH200 | β | Manual MAC entry required; no UPnP descriptor |
| MyHomeServer1 | β | Should work via SSDP |
| Audio Matrix | Decoder Support | Source Inputs |
|---|---|---|
| F441 / F441M | β | 4 stereo inputs |
| S0105A | β | 4 stereo inputs |
| E46ADCN (amplifier) | β | Receives from matrix |
ββββββββββββββββββββ βββββββββββββββββ ββββββββββββββββββββ
β Music Assistant β β DecoderPool β β F441M Matrix β
β / Spotify / MA ββββββΆβ (asyncio) ββββββΆβ (hardware) β
β β β β β β
β play_media() β β claim() β β select_source() β
β β β release() β β β
ββββββββββββββββββββ β gain_stage() β β IN1 βββΆ Zone 3 β
βββββββββββββββββ β IN2 βββΆ Zone 4 β
β² β IN3 βββΆ Zone 5 β
β β IN4 βββΆ Zone 6 β
βββββββ΄βββββββ ββββββββββββββββββββ
β Decoders β
β β
β Cambridge βββββ RCA ββββΆ IN1
β squeezelite βββββ RCA ββββΆ IN2
βββββββββββββββ
(For legacy OpenWebNet implementation documentation, refer to the original bticino open specs).