دليل أحواض الاستحمام الذكية
action.devices.types.BATHTUB - يمكن ملء أحواض الاستحمام وتفريغها، وربما إلى مستويات معيّنة إذا كان حوض الاستحمام يتيح ذلك.
يشير هذا النوع إلى أنّ الجهاز يحصل على رمز حوض الاستحمام وبعض المرادفات والأسماء المستعارة ذات الصلة.
إمكانيات الجهاز
راجِع مستندات السمة ذات الصلة للاطّلاع على تفاصيل التنفيذ، مثل السمات والحالات التي يجب أن تدعمها خدمتك، وكيفية إنشاء ردود EXECUTE وQUERY.
السمات المقترَحة
يُنصح باستخدام هذه السمات إذا كانت تنطبق على جهازك. ومع ذلك، يمكنك المزج بين جميع السمات المتاحة ومطابقتها مع بعضها البعض لتحقيق أفضل تطابق مع وظائف منتجك الحالية.
مثال على جهاز: حوض استحمام بسيط
يحتوي هذا القسم على أمثلة على حمولات الأهداف التي تمثّل "حوض استحمام" شائعًا استنادًا إلى نوع الجهاز وسماته المذكورة أعلاه. في حال إضافة سمات أو إزالتها في عملية التنفيذ، عدِّل الردود وفقًا لذلك لعكس هذه التغييرات.
نموذج استجابة SYNC
{
"requestId": "6894439706274654512",
"inputs": [
{
"intent": "action.devices.SYNC"
}
]
}{ "requestId": "6894439706274654512", "payload": { "agentUserId": "user123", "devices": [ { "id": "123", "type": "action.devices.types.BATHTUB", "traits": [ "action.devices.traits.Fill", "action.devices.traits.TemperatureControl", "action.devices.traits.OnOff", "action.devices.traits.StartStop" ], "name": { "name": "Simple bathtub" }, "willReportState": true, "attributes": { "availableFillLevels": { "levels": [ { "level_name": "half_key", "level_values": [ { "level_synonym": [ "Half", "Halfway", "One half" ], "lang": "en" } ] } ], "ordered": false }, "temperatureRange": { "minThresholdCelsius": 25, "maxThresholdCelsius": 100 }, "temperatureUnitForUX": "F" }, "deviceInfo": { "manufacturer": "smart-home-inc", "model": "hs1234", "hwVersion": "3.2", "swVersion": "11.4" } } ] } }
نموذج ردّ QUERY
{ "requestId": "6894439706274654514", "inputs": [ { "intent": "action.devices.QUERY", "payload": { "devices": [ { "id": "123" } ] } } ] }
{ "requestId": "6894439706274654514", "payload": { "devices": { "123": { "status": "SUCCESS", "online": true, "on": false, "currentFillLevel": "half_key", "isFilled": true, "temperatureSetpointCelsius": 30, "isRunning": true, "isPaused": false } } } }
أمثلة على أوامر EXECUTE
التعبئة
للحصول على تفاصيل إضافية حول مَعلمات الأمر، يُرجى الاطّلاع على مرجع
action.devices.traits.Fill.
{ "requestId": "6894439706274654516", "inputs": [ { "intent": "action.devices.EXECUTE", "payload": { "commands": [ { "devices": [ { "id": "123" } ], "execution": [ { "command": "action.devices.commands.Fill", "params": { "fill": true, "fillLevel": "half_key" } } ] } ] } } ] }
{ "requestId": "6894439706274654516", "payload": { "commands": [ { "ids": [ "123" ], "status": "PENDING", "states": { "online": true, "on": true, "currentFillLevel": "half_key" } } ] } }
SetTemperature
للحصول على تفاصيل إضافية حول مَعلمات الأمر، يُرجى الاطّلاع على مرجع
action.devices.traits.TemperatureControl.
{ "requestId": "6894439706274654520", "inputs": [ { "intent": "action.devices.EXECUTE", "payload": { "commands": [ { "devices": [ { "id": "123" } ], "execution": [ { "command": "action.devices.commands.SetTemperature", "params": { "temperature": 40 } } ] } ] } } ] }
{ "requestId": "6894439706274654520", "payload": { "commands": [ { "ids": [ "123" ], "status": "SUCCESS", "states": { "online": true, "temperatureSetpointCelsius": 40 } } ] } }
OnOff
للحصول على تفاصيل إضافية حول مَعلمات الأمر، يُرجى الاطّلاع على مرجع
action.devices.traits.OnOff.
{ "requestId": "6894439706274654518", "inputs": [ { "intent": "action.devices.EXECUTE", "payload": { "commands": [ { "devices": [ { "id": "123" } ], "execution": [ { "command": "action.devices.commands.OnOff", "params": { "on": true } } ] } ] } } ] }
{ "requestId": "6894439706274654518", "payload": { "commands": [ { "ids": [ "123" ], "status": "SUCCESS", "states": { "online": true, "on": true } } ] } }
StartStop
للحصول على تفاصيل إضافية حول مَعلمات الأمر، يُرجى الاطّلاع على مرجع
action.devices.traits.StartStop.
{ "requestId": "6894439706274654522", "inputs": [ { "intent": "action.devices.EXECUTE", "payload": { "commands": [ { "devices": [ { "id": "123" } ], "execution": [ { "command": "action.devices.commands.StartStop", "params": { "start": true } } ] } ] } } ] }
{ "requestId": "6894439706274654522", "payload": { "commands": [ { "ids": [ "123" ], "status": "PENDING", "states": { "online": true, "isRunning": true, "isPaused": false } } ] } }
PauseUnpause
للحصول على تفاصيل إضافية حول مَعلمات الأمر، يُرجى الاطّلاع على مرجع
action.devices.traits.StartStop.
{ "requestId": "6894439706274654524", "inputs": [ { "intent": "action.devices.EXECUTE", "payload": { "commands": [ { "devices": [ { "id": "123" } ], "execution": [ { "command": "action.devices.commands.PauseUnpause", "params": { "pause": true } } ] } ] } } ] }
{ "requestId": "6894439706274654524", "payload": { "commands": [ { "ids": [ "123" ], "status": "PENDING", "states": { "online": true, "isRunning": false, "isPaused": true } } ] } }