裝置映射三:特殊設備
整理 Stable 2.0.55 的媒體、模式、警報、事件、用水設備、家電、吸塵器、割草機與動作型實體,特別分清「按一下就結束」和「會維持狀態」的 Matter 呈現。
特殊設備最容易出現「建立成功但不能用」
這一組 domain 跨越完全不同的語意:media_player 有音量與播放,select 有選項,valve 有開關狀態,event 只有事件,script 則是觸發動作。Matter 沒有一對一 device type 時,Matter Hub 會選最接近的 Mode Select、Generic Switch、On/Off Plug-in Unit 或 Robotic Vacuum Cleaner。
因此你不能只看 Controller 出現一個磁磚就判定完整支援。磁磚是否持續維持 on、是否只能按一下、off 是否真的呼叫 HA action、Controller 是否能顯示 Mode Select,以及設備是否需要 Server Mode,都是不同問題。
doorbell 與 water_heater_management 是 Stable 內實驗性類型;其餘 manifest 項目 maturity 為 stable。Controller 支援多數依類型而異,且 SmartThings 多為 manifest unknown,不能省略這一層。警報、警笛、閥門、熱水與自走設備會造成真實環境動作。先以唯讀狀態與低風險命令確認,再決定是否暴露給語音或多人家庭;Matter Hub 不是安全聯鎖或人身監護系統。
本章 17 個 HomeAssistantDomain
Stable 2.0.55 的完整 HomeAssistantDomain 共 27 個;第 9 章涵蓋 7 個,第 10 章涵蓋 3 個,本章涵蓋餘下 17 個,合計不遺漏 rare domain。
| domain | 預設路徑 | 主要語意 |
|---|---|---|
media_player | speaker;TV 自動走 basic_video_player | 電源/靜音、音量、來源、播放暫停依 supported features。 |
valve | water_valve;亦可 on_off_plugin_unit | 持續開/關與 transitioning。 |
water_heater | 預設 thermostat;可手動 override 為 water_heater 或 water_heater_management | 預設是加熱 Thermostat;後者是 Matter 1.4 Water Heater,加入 Boost/CancelBoost。 |
select | mode_select | 持續選項;可 workaround 成 on/off 兩個選項。 |
input_select | mode_select | HA helper 的持續選項。 |
alarm_control_panel | mode_select;可 on_off_plugin_unit fallback | 解除與支援的布防模式。 |
event | generic_switch;可 doorbell | 無持續狀態的事件與單/多擊。 |
siren | on_off_plugin_unit | 持續 on/off,會實際啟停警笛。 |
vacuum | robot_vacuum_cleaner | 運行、操作狀態、清潔模式、服務區域與電池。 |
lawn_mower | robotic_lawn_mower | 以 Robotic Vacuum Cleaner 類型相容呈現。 |
automation | on_off_switch | 瞬時 trigger,不是啟用/停用 automation。 |
button | generic_switch | 瞬時 button.press。 |
input_button | generic_switch | 瞬時 helper press。 |
input_boolean | on_off_plugin_unit、on_off_switch、mounted_on_off_control | 真正持續的布林狀態。 |
remote | 一般 On/Off endpoint | 持續呼叫 remote.turn_on/turn_off。 |
scene | on_off_switch | 瞬時 activate,只支援 turn on。 |
script | on_off_switch | 瞬時 script.turn_on,不把腳本執行中當持續 on。 |
domainToDefaultMatterTypes 是 picker 候選矩陣,不是所有 domain 最終 endpoint 的逐字名稱。例如 automation、scene、script 的候選寫 on_off_switch,legacy 實作採 On/Off Plug-in Unit device 基底並保持瞬時 off 語意。文件應描述可觀察行為,不把型別候選與底層 class 混為同一層。
媒體播放器、speaker、valve、pump 與熱水
media_player 若 device_class 為 TV,自動使用 basic_video_player;明確 override speaker 可繞過 TV 偵測。Speaker 只有同時支援 TURN_ON 與 TURN_OFF 時才以電源控制 OnOff,否則有 mute 能力時以靜音代替;VOLUME_SET 加入 0–254 相容音量控制,SELECT_SOURCE 加入輸入來源,PLAY 或 PAUSE 加入播放控制。
| override | 支援快照 | 選用界線 |
|---|---|---|
speaker | Google、Aqara yes;Apple、Alexa no。 | 適合音訊播放器;不保證 Controller 顯示所有輸入或播放按鈕。 |
basic_video_player | Aqara yes;Apple、Google、Alexa no。 | TV/視訊設備;固定 source note 指此環境只有 Aqara Home 呈現。 |
water_valve | Aqara yes;Apple、Google、Alexa no。 | HA valve 的 open、opening、closing、closed 對應持續閥門狀態。 |
pump | Google、Aqara yes;Apple、Alexa no。 | 可由 switch override 成泵;須確認 off 真能安全停止。 |
water_heater | Aqara yes;Apple、Google no;Alexa unknown。 | 一般熱水器模式與溫控。 |
water_heater_management | Apple、Google no;Alexa、Aqara unknown。 | Stable 內實驗性 Matter 1.4 類型,帶 Boost/CancelBoost,主流 Controller 尚不呈現。 |
Valve 可依電池屬性或 batteryEntity 加入 Power Source;open/close 分別呼叫 HA valve action,opening/closing 呈現 Transitioning。Pump 從 switch override 而來時仍需以來源整合的 turn_on/turn_off 行為為準。熱水器的 boost 涉及能源與燙傷風險,不應只用 Controller 是否顯示按鈕判斷安全。
select、alarm、event、doorbell 與 siren
select 與 input_select 會把非空 options 建成 Mode Select,大小寫不敏感地找到目前選項;沒有選項則不建立 endpoint。固定矩陣對 mode_select 是 Apple、Google、Alexa no、Aqara unknown。若 Controller 無法呈現,可設 selectExposeAsSwitch 並明確指定 selectSwitchOnOption 與 selectSwitchOffOption,把兩個選項折成持續 On/Off;超過兩個模式就不適合此 workaround。
alarm_control_panel 沒有專用 Matter security panel type,因此用 Mode Select 保留 Disarmed、Armed Home、Away、Night、Vacation、Custom 等 HA 支援位元。轉換中的 arming、pending、triggered 不對應固定模式。對不支援 Mode Select 的平台,可使用 On/Off fallback:on 依 Away、Home、Night 優先序布防,off 解除。這會丟失多模式,而且實際整合若需要額外驗證,Controller 命令可能失敗。
event 預設 Generic Switch,會從 event_types 名稱偵測 double/triple/multi press;generic_switch 固定矩陣為 Apple partial、Google no、Alexa yes、Aqara unknown。override doorbell 是 Stable 內 experimental Matter 1.4 類型,Apple、Google、Alexa、Aqara 都是 no;source note 只有 SmartThings 目前呈現,其他平台至多 fallback plain Switch。它不是 Camera Plugin,也不會提供影像。
siren 是持續狀態,on/off 會呼叫 siren.turn_on/siren.turn_off,不要與瞬時事件混淆。警笛測試可能擾民或造成恐慌;先在 HA 確認靜音測試能力,若沒有就只核對 endpoint,不遠端啟動。
dishwasher、vacuum、lawn_mower 與 Service Area
dishwasher 是 switch 可選的 Matter override,maturity stable,但 Apple、Google 為 no,Alexa、Aqara unknown;固定 source note 指家電類平台支援很薄。把任意開關標成洗碗機不會新增行程、門鎖或完成時間,只會改 device type。
vacuum 建立 Robotic Vacuum Cleaner,包含 operational state、run mode、Power Source、Service Area 與永遠存在的 clean mode。OnOff 不屬於標準 RVC device type,預設不加入,因為非 conformant endpoint 會讓 Alexa 拒絕;只有 vacuumOnOff feature flag 明確啟用時加入。robot_vacuum_cleaner 在 Apple、Google、Alexa、Aqara 都為 yes,但 Apple 語音與 Alexa discovery 適合使用第 12 章 Server Mode。
Service Area 可來自 cleanAreaRooms、customServiceAreas、解析到的房間或 roomEntities;沒有任何房間時仍建立預設單一區域。vacuumIncludeUnnamedRooms 控制是否納入無名房;vacuumRoomSwitches 可為不會渲染陣列命令的平台建立每區瞬時 switch。cleaningModeEntity、suctionLevelEntity、mopIntensityEntity 等關聯選項決定清潔模式,不該用名稱相近就自動假設正確。
lawn_mower 沒有原生 Matter mower type,v2.0.55 以 Robotic Vacuum Cleaner 表示,並使用割草機 run/operational state;robotic_lawn_mower 固定矩陣為 Apple、Alexa yes,Google、Aqara unknown,且 UI 會像掃地機器人。只有存在電池屬性或 mapping 時才加 Power Source。
| 類型 | 最佳用途 | 不可誤解 |
|---|---|---|
dishwasher | 明確的洗碗機 switch | 不是完整 appliance program model。 |
robot_vacuum_cleaner | 吸塵、拖地、房間清潔 | Bridge 模式和 Server Mode 的 Controller fit 不同。 |
robotic_lawn_mower | 割草機 domain 的相容映射 | 目前仍以 RVC 類型出現,不是專用 mower type。 |
momentary、auto-reset 與 disableMomentaryFlip
持續狀態(persistent)會一直反映設備目前值,例如 input_boolean、remote、siren、valve、select。on 與 off 通常各有 HA action,Controller 改變後應等來源狀態回報。
瞬時動作(momentary)只有「觸發」:automation 呼叫 trigger,scene 與 script 只接受 turn on,button 與 input_button 只 press。它們正常保持 off;收到 on 時動作一次,Controller 不應把它視為持續運轉。
| domain | on 動作 | off/reset 行為 |
|---|---|---|
automation | automation.trigger | 沒有 turn off;顯示回到 off,不等於停用 automation。 |
scene | scene.turn_on | 沒有 turn off;scene 永遠呈現 off。 |
script | script.turn_on | 沒有 turn off;不追蹤腳本是否仍在執行。 |
button | button.press | 永遠回報 off,從不設為 true;timer/reset 路徑是 no-op。 |
input_button | input_button.press | 沒有真正 off action。 |
input_boolean | turn_on | turn_off;這是持續狀態,不 auto-reset。 |
remote | remote.turn_on | remote.turn_off;持續狀態。 |
script、scene、automation 與 input_button 的 momentary 行為會樂觀回報 on,再約一秒回 off,避免 Controller 看起來卡住;button 不同,永遠回報 off,從不設為 true。部分 Echo 裝置會因未請求的 on→off report pair 卡住;entity mapping 的 disableMomentaryFlip 對前四者可實質略過翻轉,但對 button 只略過原本就不改狀態的 timer。底層 HA action 仍會觸發。這是特定 Controller workaround,不是把瞬時動作改成 persistent,也不應全域盲開。
映射特殊設備的最小流程
分類為狀態、模式或動作
先在 HA 確認實體是 persistent state、Mode Select 還是 momentary action。用
script.example_action等 placeholder 記錄,避免把 live 環境資料帶入文件。查看 Devices 的預設映射
在 Matter Hub 的 Devices 搜尋目標,核對 domain 與自動類型;media player 要額外看 device_class 與 supported features,vacuum 要看房間與模式屬性。
對照目標 Controller
Mode Select、speaker、TV、valve、water heater 與 appliance 支援差異很大。先查矩陣,再決定是否需要 fallback 或 Server Mode。
一次只調一個 mapping
必要時設定 speaker、pump、water valve 或 select-as-switch;momentary 只有確認 Echo 卡住時才啟用
disableMomentaryFlip。儲存前記下原值。先做唯讀或低風險驗證
比較模式、音量、區域與狀態;按鈕用無危險的測試動作。警笛、熱水、泵、閥門、吸塵器與割草機要有人在場並保留停止方式。
確認 Controller 命令與 HA 回報
persistent 類型測 on 與 off;momentary 只測一次 on 並確認 action 僅觸發一次。失敗時回復 mapping,不先 reset Fabric。
特殊設備卡關與返回點
Mode Select 完全不出現
Apple、Google、Alexa 對固定矩陣皆為 no。只有兩個明確選項時可用 select-as-switch;多選項應保留在 HA,不要犧牲語意硬折成開關。
script/scene/automation/input_button 在 Controller 卡在 on
先確認 action 是否只觸發一次及稍後是否回 off。若是特定 Echo 對 on→off report 卡住,再針對該 entity 啟用
disableMomentaryFlip。一般button永遠回報 off,不應以翻轉排錯。automation 的 off 沒有停用自動化
這是預期行為:此映射是 momentary trigger,不是 automation enable switch。若要持續啟停,應在 HA 建立明確、安全的 input_boolean 流程。
TV 或 speaker 只顯示部分控制
核對 TURN_ON/OFF、VOLUME_MUTE、VOLUME_SET、SELECT_SOURCE、PLAY、PAUSE feature bits,再查 Controller 是否顯示該 cluster。override 不會新增來源設備未提供的能力。
Alexa 拒絕 vacuum
確認沒有不必要的
vacuumOnOff,因 OnOff 不屬於 RVC spec;再考慮以第 12 章 Server Mode 建立專用節點,避免和其他不支援類型混在同 Bridge。割草機顯示成掃地機器人
這是 v2.0.55 的相容設計,因 Matter 尚無 mower type。若名稱與遠端啟動風險不可接受,就不要暴露給該 Controller,保留 HA 操作。
常見問題
automation endpoint 可以控制啟用/停用嗎?
automation.trigger,off 沒有 action。這是瞬時觸發器。disableMomentaryFlip 會讓瞬時 action 不執行嗎?
doorbell 是否包含影像與雙向語音?
vacuum 一定要 Server Mode 嗎?
為什麼 siren 不使用 momentary?
Stable 2.0.55 固定來源
- 完整 HomeAssistantDomain enum
- 特殊 override、momentary 設定與 Controller 矩陣
- 所有 legacy domain endpoint 實作
- RVC、Service Area、Clean Mode 與 OnOff 限制
- Mode Select 與 switch fallback
- Pinned Add-on mirror
以上皆固定至指定 commit。實驗性 doorbell/water heater management 與 Controller support 已分開陳述,不把 Stable channel 誤寫成全面正式支援。