@@ -78,21 +78,75 @@ The integration supports two configuration methods:
7878
7979#### Method 1: Auto-Discovery (Recommended)
8080
81- Use the built-in auto-discovery to find and configure devices automatically:
81+ Use the built-in auto-discovery to find and configure devices automatically.
82+
83+ ** Important:** Auto-discovery is activated via Home Assistant services, NOT via YAML configuration.
84+
85+ ** Step 1: Prepare Configuration File**
86+
87+ Create an empty or basic ` /config/myhome.yaml ` file:
88+
89+ ``` yaml
90+ # MyHOME Configuration
91+ # Add your gateway configurations here
92+ # (discovered devices will be automatically added)
93+ ```
94+
95+ ** Step 2: Start Discovery**
96+
97+ Use Home Assistant ** Developer Tools → Services** to call:
8298
8399``` yaml
84- # Start discovery via Home Assistant service
85100service : myhome.start_discovery
86101data :
87- gateway : " 00:03:50:XX:XX:XX" # Optional: specify gateway MAC
102+ gateway : " 00:03:50:XX:XX:XX" # Your gateway MAC address
103+ ` ` `
104+
105+ **OR** create an automation to start discovery:
106+
107+ ` ` ` yaml
108+ automation :
109+ - alias : " Start MyHOME Discovery"
110+ trigger :
111+ platform : homeassistant
112+ event : start
113+ action :
114+ service : myhome.start_discovery
115+ data :
116+ gateway : " 00:03:50:XX:XX:XX"
88117` ` `
89118
90119**Discovery Process:**
91- 1. Call the ` myhome.start_discovery` service
92- 2. The integration scans for devices automatically
93- 3. Found devices appear in the **Devices & Services** page
94- 4. Click **"Configure"** on discovered devices to add them
95- 5. Adjust suggested configurations as needed
120+ 1. Call the ` myhome.start_discovery` service with your gateway MAC
121+ 2. The integration sends discovery commands to scan for devices (`*#1*0##`, `*#2*0##`, etc.)
122+ 3. Device responses come back as events and are processed by the discovery service
123+ 4. Discovered devices are automatically added to `/config/myhome.yaml`
124+ 5. The integration reloads and new entities appear in Home Assistant
125+ 6. Check logs for discovery progress and any issues
126+
127+ **Common Discovery Issues:**
128+
129+ ❌ **Wrong** : Putting service calls in YAML config:
130+ ` ` ` yaml
131+ # DON'T DO THIS - This goes in myhome.yaml config file
132+ service: myhome.start_discovery
133+ data:
134+ mac: '00:03:50:XX:XX:XX'
135+ ` ` `
136+
137+ ✅ **Correct** : Call service through Home Assistant:
138+ ` ` ` yaml
139+ # Use Developer Tools → Services or automation
140+ service: myhome.start_discovery
141+ data:
142+ gateway: '00:03:50:XX:XX:XX'
143+ ` ` `
144+
145+ **Discovery Warning Messages:**
146+ - ` "Could not send message *#18*0##"` - Energy management subsystem not available
147+ - ` "Could not send message *#9*0##"` - Auxiliary subsystem not available
148+ - These warnings are **normal** if your gateway doesn't support these subsystems
149+ - Discovery will still find devices from supported subsystems (lighting, automation, etc.)
96150
97151# ### Method 2: Manual Configuration (YAML)
98152
@@ -323,10 +377,55 @@ automation:
323377
324378# ### Device Discovery Issues
325379
326- 1. **Start discovery manually** : Use the `myhome.start_discovery` service
327- 2. **Check OpenWebNet addresses** : Verify device WHERE addresses are correct
328- 3. **Monitor gateway communication** : Enable debug logging
329- 4. **Restart integration** : Reload the integration from Devices & Services
380+ **"Discovery not active" in logs:**
381+ - Ensure you're calling the service correctly : ` service: myhome.start_discovery` with `gateway: "MAC_ADDRESS"`
382+ - Don't put service calls in the YAML config file - use Developer Tools → Services
383+ - Check that the gateway MAC address is correct
384+ - Verify the service call shows `discovery_active : True` in debug logs
385+
386+ **No devices found during discovery:**
387+ 1. **Enable debug logging** to see discovery messages :
388+ ` ` ` yaml
389+ logger:
390+ logs:
391+ custom_components.myhome.discovery: debug
392+ custom_components.myhome.gateway: debug
393+ custom_components.myhome.config_flow_discovery: debug
394+ ` ` `
395+ 2. **Check discovery status** - Look for logs like :
396+ - ` "Starting MyHOME device discovery on gateway..."`
397+ - `"Sending discovery command 1/6 : *#1*0##"`
398+ - `"Discovery message received : *1*8*11##"`
399+ - `"Discovered new device : MyHOME Bus Dimmer 11 at WHERE=11"`
400+ - ` "Starting device configuration suggestion for MyHOME Bus Dimmer 11"`
401+ - ` "Starting config file write process for device MyHOME Bus Dimmer 11"`
402+ - ` "Successfully added device MyHOME Bus Dimmer 11 to configuration file"`
403+ 3. **Verify device responses** - Look for incoming messages after discovery commands
404+ 4. **Check gateway communication** - Ensure devices are responding to status requests
405+ 5. **Manual device test** - Try controlling devices through other MyHOME apps first
406+
407+ **Incorrect device type detection:**
408+ - **Dimmer vs Switch**: Discovery determines device type based on status responses
409+ - Devices reporting dimming levels (WHAT=2-10, excluding 8) are detected as dimmers
410+ - Devices reporting only ON/OFF states (WHAT=0,1,8) are detected as switches
411+ - If a dimmer is incorrectly detected as a switch, manually edit the config and set `dimmable : true`
412+ - **Special states**: WHAT=8 often indicates "temporized ON" or other special states, not dimming capability
413+
414+ **Devices discovered but not added:**
415+ 1. **Check `/config/myhome.yaml`** - devices should be automatically added
416+ 2. **Verify file permissions** - ensure Home Assistant can write to the config file
417+ 3. **Monitor config file writing** - Look for debug logs like :
418+ - ` "Starting config file write process for device..."`
419+ - ` "Reading existing config file..."`
420+ - ` "Writing updated config to file..."`
421+ - ` "Config file write completed successfully"`
422+ - `"Config file size after write : XXX bytes"`
423+ 4. **Check for config write errors** - Look for error logs like :
424+ - ` "Error writing to config file"`
425+ - ` "Failed to add device to config file"`
426+ - ` "Error in config file write process"`
427+ 5. **Monitor integration reload** - check logs for config reload errors
428+ 6. **Restart integration** manually if auto-reload fails
330429
331430# ### Configuration Issues
332431
0 commit comments