Guida al forno per la smart home
action.devices.types.OVEN
- L'interazione con il forno prevede la capacità di cuocere al forno o cuocere alla griglia a determinate temperature. La temperatura fisica all'interno del forno varia a seconda che il forno si scaldi, quindi anche questo potrebbe essere monitorato. Il forno ha un tempo di cottura che limita la durata della cottura.
Questo tipo indica che sul dispositivo viene visualizzata l'icona del forno e alcuni sinonimi e alias correlati.
I forni presentano una grammatica basata sui tipi peraction.devices.traits.OnOff
e action.devices.traits.TemperatureControl
:
- Se il dispositivo supporta
OnOff
, Preriscalda il forno invierà un comandoaction.devices.commands.OnOff
. - Se il dispositivo supporta
TemperatureControl
, Preriscalda il forno a 350 gradi invierà un comando per impostare il forno su quella temperatura.
Funzionalità del dispositivo
Fai riferimento alla documentazione sulle trait corrispondente per i dettagli sull'implementazione, ad esempio gli attributi e gli stati che il tuo servizio dovrebbe supportare, e come creare risposte EXECUTE e QUERY.
Trait obbligatori
Questi trait e comandi sono obbligatori, se applicabile al tuo dispositivo. Se il tuo dispositivo non supporta questi trait, inserisci il codice di errore di functionNotSupported
in una risposta QUERY o EXECUTE. Per ulteriori informazioni, consulta Errori ed eccezioni.
Trait consigliati
Queste caratteristiche sono consigliate, se applicabili al tuo dispositivo. Tuttavia, puoi combinare liberamente tutte le caratteristiche disponibili per abbinarle al meglio alle funzionalità esistenti del prodotto.
Requisiti di qualità
- Latenza: deve essere inferiore o uguale a 3000 ms.
- Affidabilità:deve essere superiore o uguale al 97%.
Esempio di dispositivo: forno semplice
Questa sezione contiene payload di intent di esempio che rappresentano un "forno" comune in base al tipo di dispositivo e ai trait indicati sopra. Se aggiungi o rimuovi i trait nell'implementazione, modifica le risposte di conseguenza per riflettere queste modifiche.
Esempio di risposta SYNC
{ "requestId": "6894439706274654512", "inputs": [ { "intent": "action.devices.SYNC" } ] }
{ "requestId": "6894439706274654512", "payload": { "agentUserId": "user123", "devices": [ { "id": "123", "type": "action.devices.types.OVEN", "traits": [ "action.devices.traits.Cook", "action.devices.traits.OnOff", "action.devices.traits.TemperatureControl", "action.devices.traits.Timer", "action.devices.traits.StartStop" ], "name": { "name": "Simple oven" }, "willReportState": true, "attributes": { "supportedCookingModes": [ "BAKE", "CONVECTION_BAKE", "ROAST" ], "maxTimerLimitSec": 3600, "temperatureRange": { "minThresholdCelsius": 65, "maxThresholdCelsius": 288 }, "temperatureUnitForUX": "F" }, "deviceInfo": { "manufacturer": "smart-home-inc", "model": "hs1234", "hwVersion": "3.2", "swVersion": "11.4" } } ] } }
Esempio di risposta QUERY
{ "requestId": "6894439706274654514", "inputs": [ { "intent": "action.devices.QUERY", "payload": { "devices": [ { "id": "123" } ] } } ] }
{ "requestId": "6894439706274654514", "payload": { "devices": { "123": { "status": "SUCCESS", "online": true, "on": true, "isRunning": true, "temperatureSetpointCelsius": 175, "currentCookingMode": "BAKE", "timerRemainingSec": -1 } } } }
Esempi di comandi EXECUTE
Cucina
Per maggiori dettagli sui parametri del comando, consulta la pagina di riferimento
action.devices.traits.Cook
.
{ "requestId": "6894439706274654516", "inputs": [ { "intent": "action.devices.EXECUTE", "payload": { "commands": [ { "devices": [ { "id": "123" } ], "execution": [ { "command": "action.devices.commands.Cook", "params": { "start": true, "cookingMode": "ROAST" } } ] } ] } } ] }
{ "requestId": "6894439706274654516", "payload": { "commands": [ { "ids": [ "123" ], "status": "SUCCESS", "states": { "online": true, "currentCookingMode": "ROAST" } } ] } }
OnOff
Per maggiori dettagli sui parametri del comando, consulta la pagina di riferimento
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 } } ] } }
ImpostaTemperatura
Per maggiori dettagli sui parametri del comando, consulta la pagina di riferimento
action.devices.traits.TemperatureControl
.
{ "requestId": "6894439706274654520", "inputs": [ { "intent": "action.devices.EXECUTE", "payload": { "commands": [ { "devices": [ { "id": "123" } ], "execution": [ { "command": "action.devices.commands.SetTemperature", "params": { "temperature": 200 } } ] } ] } } ] }
{ "requestId": "6894439706274654520", "payload": { "commands": [ { "ids": [ "123" ], "status": "SUCCESS", "states": { "online": true, "temperatureSetpointCelsius": 200, "temperatureAmbientCelsius": 100 } } ] } }
Avvio del timer
Per maggiori dettagli sui parametri del comando, consulta la pagina di riferimento
action.devices.traits.Timer
.
{ "requestId": "6894439706274654522", "inputs": [ { "intent": "action.devices.EXECUTE", "payload": { "commands": [ { "devices": [ { "id": "123" } ], "execution": [ { "command": "action.devices.commands.TimerStart", "params": { "timerTimeSec": 300 } } ] } ] } } ] }
{ "requestId": "6894439706274654522", "payload": { "commands": [ { "ids": [ "123" ], "status": "SUCCESS", "states": { "online": true, "timerRemainingSec": 300 } } ] } }
Regolazione timer
Per maggiori dettagli sui parametri del comando, consulta la pagina di riferimento
action.devices.traits.Timer
.
{ "requestId": "6894439706274654524", "inputs": [ { "intent": "action.devices.EXECUTE", "payload": { "commands": [ { "devices": [ { "id": "123" } ], "execution": [ { "command": "action.devices.commands.TimerAdjust", "params": { "timerTimeSec": -10 } } ] } ] } } ] }
{ "requestId": "6894439706274654524", "payload": { "commands": [ { "ids": [ "123" ], "status": "SUCCESS", "states": { "online": true, "timerRemainingSec": 290 } } ] } }
Pausa timer
Per maggiori dettagli sui parametri del comando, consulta la pagina di riferimento
action.devices.traits.Timer
.
{ "requestId": "6894439706274654526", "inputs": [ { "intent": "action.devices.EXECUTE", "payload": { "commands": [ { "devices": [ { "id": "123" } ], "execution": [ { "command": "action.devices.commands.TimerPause" } ] } ] } } ] }
{ "requestId": "6894439706274654526", "payload": { "commands": [ { "ids": [ "123" ], "status": "SUCCESS", "states": { "online": true, "timerRemainingSec": 300, "timerPaused": true } } ] } }
Riprendi timer
Per maggiori dettagli sui parametri del comando, consulta la pagina di riferimento
action.devices.traits.Timer
.
{ "requestId": "6894439706274654528", "inputs": [ { "intent": "action.devices.EXECUTE", "payload": { "commands": [ { "devices": [ { "id": "123" } ], "execution": [ { "command": "action.devices.commands.TimerResume" } ] } ] } } ] }
{ "requestId": "6894439706274654528", "payload": { "commands": [ { "ids": [ "123" ], "status": "SUCCESS", "states": { "online": true, "timerRemainingSec": 300, "timerPaused": false } } ] } }
Annulla timer
Per maggiori dettagli sui parametri del comando, consulta la pagina di riferimento
action.devices.traits.Timer
.
{ "requestId": "6894439706274654530", "inputs": [ { "intent": "action.devices.EXECUTE", "payload": { "commands": [ { "devices": [ { "id": "123" } ], "execution": [ { "command": "action.devices.commands.TimerCancel" } ] } ] } } ] }
{ "requestId": "6894439706274654530", "payload": { "commands": [ { "ids": [ "123" ], "status": "SUCCESS", "states": { "online": true, "timerRemainingSec": -1 } } ] } }
StartStop
Per maggiori dettagli sui parametri del comando, consulta la pagina di riferimento
action.devices.traits.StartStop
.
{ "requestId": "6894439706274654532", "inputs": [ { "intent": "action.devices.EXECUTE", "payload": { "commands": [ { "devices": [ { "id": "123" } ], "execution": [ { "command": "action.devices.commands.StartStop", "params": { "start": true } } ] } ] } } ] }
{ "requestId": "6894439706274654532", "payload": { "commands": [ { "ids": [ "123" ], "status": "SUCCESS", "states": { "online": true, "isRunning": true } } ] } }