Panduan Alat Panggang Smart Home

action.devices.types.GRILL - Interaksi dengan pemanggang dapat termasuk mengaktifkan dan menonaktifkannya, memulai dan menghentikan, menyetel timer, menyesuaikan mode memasak dan preset makanan, serta menyesuaikan berbagai setelan mode tidak memasak.

Jenis ini menunjukkan bahwa perangkat mendapatkan ikon Grill serta beberapa sinonim dan alias yang terkait.

Kemampuan perangkat

Lihat dokumentasi fitur yang sesuai untuk detail penerapan, seperti atribut dan status yang harus didukung layanan Anda, serta cara membuat respons EXECUTE dan QUERY.

Trait yang diperlukan

Sifat dan perintah ini diperlukan, jika berlaku untuk perangkat Anda. Jika perangkat tidak mendukung fitur ini, masukkan kode error functionNotSupported dalam respons QUERY atau EXECUTE. Lihat Error dan pengecualian untuk info selengkapnya.

Trait ini direkomendasikan, jika sesuai untuk perangkat Anda. Namun, Anda bebas memadupadankan semua karakteristik yang tersedia agar cocok dengan fungsi produk yang ada.

Persyaratan kualitas

  • Latensi: harus kurang dari atau sama dengan 3000 md.
  • Keandalan: harus lebih dari atau sama dengan 97%.

Contoh perangkat: Pemanggang simpel

Bagian ini berisi contoh payload intent yang merepresentasikan "Grill" umum berdasarkan jenis dan karakteristik perangkat di atas. Jika Anda menambahkan atau menghapus trait dalam implementasi Anda, ubah respons tersebut agar mencerminkan perubahan tersebut.

Contoh respons SYNC

Permintaan
{
  "requestId": "6894439706274654512",
  "inputs": [
    {
      "intent": "action.devices.SYNC"
    }
  ]
}
Respons
{
  "requestId": "6894439706274654512",
  "payload": {
    "agentUserId": "user123",
    "devices": [
      {
        "id": "123",
        "type": "action.devices.types.GRILL",
        "traits": [
          "action.devices.traits.Cook",
          "action.devices.traits.OnOff",
          "action.devices.traits.Timer",
          "action.devices.traits.StartStop"
        ],
        "name": {
          "name": "Simple grill"
        },
        "willReportState": true,
        "attributes": {
          "supportedCookingModes": [
            "COOK",
            "GRILL"
          ],
          "foodPresets": [
            {
              "food_preset_name": "chicken_key",
              "supported_units": [
                "POUNDS",
                "OUNCES"
              ],
              "food_synonyms": [
                {
                  "synonym": [
                    "Chicken",
                    "Chicken breast",
                    "Chicken thigh"
                  ],
                  "lang": "en"
                }
              ]
            },
            {
              "food_preset_name": "hamburger_key",
              "supported_units": [
                "POUNDS",
                "OUNCES"
              ],
              "food_synonyms": [
                {
                  "synonym": [
                    "Hamburger",
                    "Burger",
                    "Burger patty"
                  ],
                  "lang": "en"
                }
              ]
            }
          ],
          "maxTimerLimitSec": 1200,
          "pausable": true
        },
        "deviceInfo": {
          "manufacturer": "smart-home-inc",
          "model": "hs1234",
          "hwVersion": "3.2",
          "swVersion": "11.4"
        }
      }
    ]
  }
}

Contoh respons QUERY

Permintaan
{
  "requestId": "6894439706274654514",
  "inputs": [
    {
      "intent": "action.devices.QUERY",
      "payload": {
        "devices": [
          {
            "id": "123"
          }
        ]
      }
    }
  ]
}
Respons
{
  "requestId": "6894439706274654514",
  "payload": {
    "devices": {
      "123": {
        "status": "SUCCESS",
        "online": true,
        "on": true,
        "isRunning": true,
        "isPaused": false,
        "timerRemainingSec": 120,
        "currentCookingMode": "GRILL",
        "currentFoodPreset": "chicken_key"
      }
    }
  }
}

Contoh perintah EXECUTE

Inspirasi Memasak

Untuk detail tambahan tentang parameter perintah, lihat referensi action.devices.traits.Cook.

Permintaan
{
  "requestId": "6894439706274654516",
  "inputs": [
    {
      "intent": "action.devices.EXECUTE",
      "payload": {
        "commands": [
          {
            "devices": [
              {
                "id": "123"
              }
            ],
            "execution": [
              {
                "command": "action.devices.commands.Cook",
                "params": {
                  "start": false,
                  "cookingMode": "GRILL"
                }
              }
            ]
          }
        ]
      }
    }
  ]
}
Respons
{
  "requestId": "6894439706274654516",
  "payload": {
    "commands": [
      {
        "ids": [
          "123"
        ],
        "status": "SUCCESS",
        "states": {
          "online": true,
          "currentCookingMode": "NONE",
          "currentFoodPreset": "NONE"
        }
      }
    ]
  }
}

OnOff

Untuk detail tambahan tentang parameter perintah, lihat referensi action.devices.traits.OnOff.

Permintaan
{
  "requestId": "6894439706274654532",
  "inputs": [
    {
      "intent": "action.devices.EXECUTE",
      "payload": {
        "commands": [
          {
            "devices": [
              {
                "id": "123"
              }
            ],
            "execution": [
              {
                "command": "action.devices.commands.OnOff",
                "params": {
                  "on": true
                }
              }
            ]
          }
        ]
      }
    }
  ]
}
Respons
{
  "requestId": "6894439706274654532",
  "payload": {
    "commands": [
      {
        "ids": [
          "123"
        ],
        "status": "SUCCESS",
        "states": {
          "online": true,
          "on": true
        }
      }
    ]
  }
}

TimerStart

Untuk detail tambahan tentang parameter perintah, lihat referensi action.devices.traits.Timer.

Permintaan
{
  "requestId": "6894439706274654522",
  "inputs": [
    {
      "intent": "action.devices.EXECUTE",
      "payload": {
        "commands": [
          {
            "devices": [
              {
                "id": "123"
              }
            ],
            "execution": [
              {
                "command": "action.devices.commands.TimerStart",
                "params": {
                  "timerTimeSec": 120
                }
              }
            ]
          }
        ]
      }
    }
  ]
}
Respons
{
  "requestId": "6894439706274654522",
  "payload": {
    "commands": [
      {
        "ids": [
          "123"
        ],
        "status": "SUCCESS",
        "states": {
          "online": true,
          "timerRemainingSec": 120
        }
      }
    ]
  }
}

TimerAdjust

Untuk detail tambahan tentang parameter perintah, lihat referensi action.devices.traits.Timer.

Permintaan
{
  "requestId": "6894439706274654524",
  "inputs": [
    {
      "intent": "action.devices.EXECUTE",
      "payload": {
        "commands": [
          {
            "devices": [
              {
                "id": "123"
              }
            ],
            "execution": [
              {
                "command": "action.devices.commands.TimerAdjust",
                "params": {
                  "timerTimeSec": -10
                }
              }
            ]
          }
        ]
      }
    }
  ]
}
Respons
{
  "requestId": "6894439706274654524",
  "payload": {
    "commands": [
      {
        "ids": [
          "123"
        ],
        "status": "SUCCESS",
        "states": {
          "online": true,
          "timerRemainingSec": 110
        }
      }
    ]
  }
}

TimerPause

Untuk detail tambahan tentang parameter perintah, lihat referensi action.devices.traits.Timer.

Permintaan
{
  "requestId": "6894439706274654526",
  "inputs": [
    {
      "intent": "action.devices.EXECUTE",
      "payload": {
        "commands": [
          {
            "devices": [
              {
                "id": "123"
              }
            ],
            "execution": [
              {
                "command": "action.devices.commands.TimerPause"
              }
            ]
          }
        ]
      }
    }
  ]
}
Respons
{
  "requestId": "6894439706274654526",
  "payload": {
    "commands": [
      {
        "ids": [
          "123"
        ],
        "status": "SUCCESS",
        "states": {
          "online": true,
          "timerRemainingSec": 120,
          "timerPaused": true
        }
      }
    ]
  }
}

TimerResume

Untuk detail tambahan tentang parameter perintah, lihat referensi action.devices.traits.Timer.

Permintaan
{
  "requestId": "6894439706274654528",
  "inputs": [
    {
      "intent": "action.devices.EXECUTE",
      "payload": {
        "commands": [
          {
            "devices": [
              {
                "id": "123"
              }
            ],
            "execution": [
              {
                "command": "action.devices.commands.TimerResume"
              }
            ]
          }
        ]
      }
    }
  ]
}
Respons
{
  "requestId": "6894439706274654528",
  "payload": {
    "commands": [
      {
        "ids": [
          "123"
        ],
        "status": "SUCCESS",
        "states": {
          "online": true,
          "timerRemainingSec": 120,
          "timerPaused": false
        }
      }
    ]
  }
}

TimerCancel

Untuk detail tambahan tentang parameter perintah, lihat referensi action.devices.traits.Timer.

Permintaan
{
  "requestId": "6894439706274654530",
  "inputs": [
    {
      "intent": "action.devices.EXECUTE",
      "payload": {
        "commands": [
          {
            "devices": [
              {
                "id": "123"
              }
            ],
            "execution": [
              {
                "command": "action.devices.commands.TimerCancel"
              }
            ]
          }
        ]
      }
    }
  ]
}
Respons
{
  "requestId": "6894439706274654530",
  "payload": {
    "commands": [
      {
        "ids": [
          "123"
        ],
        "status": "SUCCESS",
        "states": {
          "online": true,
          "timerRemainingSec": -1
        }
      }
    ]
  }
}

StartStop

Untuk detail tambahan tentang parameter perintah, lihat referensi action.devices.traits.StartStop.

Permintaan
{
  "requestId": "6894439706274654518",
  "inputs": [
    {
      "intent": "action.devices.EXECUTE",
      "payload": {
        "commands": [
          {
            "devices": [
              {
                "id": "123"
              }
            ],
            "execution": [
              {
                "command": "action.devices.commands.StartStop",
                "params": {
                  "start": true
                }
              }
            ]
          }
        ]
      }
    }
  ]
}
Respons
{
  "requestId": "6894439706274654518",
  "payload": {
    "commands": [
      {
        "ids": [
          "123"
        ],
        "status": "SUCCESS",
        "states": {
          "online": true,
          "isRunning": true,
          "isPaused": false
        }
      }
    ]
  }
}

KESALAHAN Perangkat

Lihat daftar lengkap error dan pengecualian.