Google Home应用中自定义模式Trait无法显示问题求助
Let’s walk through the most likely issues with your device configuration that’s preventing the suction modes from showing up in the Google Home app.
1. Incorrect Mode Identifier Field
The biggest red flag in your sync intent response is the use of "name": "suction" for your mode object. Google’s Modes trait requires using the "type" field instead of "name" to uniquely identify each mode category. This is a mandatory field that Google Home uses to recognize and display the mode options.
Fix:
Replace "name": "suction" with "type": "suction" in your availableModes array. Here’s the corrected snippet for your attributes:
"attributes": { "availableModes": [ { "type": "suction", "name_values": [ { "name_synonym": ["suction"], "lang": "en" } ], "settings": [ { "setting_name": "Storm", "setting_values": [ { "setting_synonym": ["Storm"], "lang": "en" } ] }, { "setting_name": "Gust", "setting_values": [ { "setting_synonym": ["Gust"], "lang": "en" } ] }, { "setting_name": "Breeze", "setting_values": [ { "setting_synonym": ["Breeze"], "lang": "en" } ] }, { "setting_name": "Eco", "setting_values": [ { "setting_synonym": ["Eco"], "lang": "en" } ] } ], "ordered": false } ] }
2. Ensure State Reporting Includes Current Mode
Since you’ve set "willReportState": true, Google Home expects your device to regularly report its current mode state. If the state payload doesn’t include the currentModeSettings field, the app might hide the mode controls entirely.
Make sure your state reports include a structure like this:
"payload": { "devices": { "states": { "device--92ada020-074a-11ed": { "on": true, "currentModeSettings": [ { "type": "suction", "setting": "Eco" } ] } } } }
3. Re-sync Your Device After Changes
After updating your sync intent and state reporting, you’ll need to trigger a re-sync of your device in the Google Home app. The easiest way to do this is:
- Open the Google Home app
- Go to your device’s settings
- Tap "Remove device" to unlink it
- Re-add the device using your integration
4. Double-Check Trait Compatibility
Your device uses the VACUUM type along with StartStop and Modes traits—this combination is fully supported by Google Home, so compatibility isn’t the issue here. Just confirming this to rule it out.
Once you make these changes, your suction modes should appear in the Google Home app’s device controls.
内容的提问来源于stack exchange,提问作者JN_newbie

