Akıllı Ev Seti Kılavuzu

action.devices.types.COOKTOP: Set üstü ocaklarla etkileşimler, söz konusu cihazları açıp kapatmayı, başlatıp durdurmayı, zamanlayıcı ayarlamayı, pişirme modlarını ve yemek ayarlarını yapmayı ve pişirme dışı modla ilgili çeşitli ayarları düzenlemeyi içerebilir.

Bu tür, cihazın Setüstü simgesi ve bazı ilgili eş anlamlılar ile takma adları aldığını gösterir.

Cihaz özellikleri

Hizmetinizin desteklemesi gereken özellikler ve durumlar ile EXECUTE ve QUERY yanıtlarının nasıl oluşturulacağı gibi uygulama ayrıntıları için ilgili özellik belgelerine bakın.

Gerekli özellikler

Bu özellikler ve komutlar, cihazınız için geçerliyse gereklidir. Cihazınız bu özellikleri desteklemiyorsa bir QUERY veya EXECUTE yanıtına functionNotSupported hata kodunu girin. Daha fazla bilgi için Hatalar ve istisnalar bölümüne bakın.

Cihazınız için geçerliyse bu özellikler önerilir. Bununla birlikte, mevcut ürün işlevselliğinize en iyi şekilde uyması için mevcut tüm özellikleri bir arada kullanabilirsiniz.

Kalite gereksinimleri

  • Gecikme: En fazla 800 ms olmalıdır.
  • Güvenilirlik: En az %97 olmalıdır.

Örnek cihaz: Sade ocak

Bu bölümde, cihaz türüne ve yukarıdaki özelliklere göre ortak bir "Ocakbaşı"nı temsil eden örnek amaç yükleri yer alır. Uygulamanızda özellik ekler veya kaldırırsanız yanıtlarınızı bu değişiklikleri yansıtacak şekilde değiştirin.

Örnek Senkronizasyon yanıtı

İstek
{
  "requestId": "6894439706274654512",
  "inputs": [
    {
      "intent": "action.devices.SYNC"
    }
  ]
}
Yanıt
{
  "requestId": "6894439706274654512",
  "payload": {
    "agentUserId": "user123",
    "devices": [
      {
        "id": "123",
        "type": "action.devices.types.COOKTOP",
        "traits": [
          "action.devices.traits.Cook",
          "action.devices.traits.StartStop",
          "action.devices.traits.Timer",
          "action.devices.traits.OnOff"
        ],
        "name": {
          "name": "Simple cooktop"
        },
        "willReportState": true,
        "attributes": {
          "supportedCookingModes": [
            "COOK",
            "BOIL",
            "SAUTE"
          ],
          "foodPresets": [
            {
              "food_preset_name": "chicken_key",
              "supported_units": [
                "POUNDS",
                "OUNCES"
              ],
              "food_synonyms": [
                {
                  "synonym": [
                    "Chicken",
                    "Chicken breast",
                    "Chicken thigh"
                  ],
                  "lang": "en"
                }
              ]
            },
            {
              "food_preset_name": "bacon_key",
              "supported_units": [
                "POUNDS",
                "OUNCES"
              ],
              "food_synonyms": [
                {
                  "synonym": [
                    "Bacon",
                    "Bacon strips"
                  ],
                  "lang": "en"
                }
              ]
            }
          ],
          "maxTimerLimitSec": 1200,
          "pausable": true
        },
        "deviceInfo": {
          "manufacturer": "smart-home-inc",
          "model": "hs1234",
          "hwVersion": "3.2",
          "swVersion": "11.4"
        }
      }
    ]
  }
}

Örnek QUERY yanıtı

İstek
{
  "requestId": "6894439706274654514",
  "inputs": [
    {
      "intent": "action.devices.QUERY",
      "payload": {
        "devices": [
          {
            "id": "123"
          }
        ]
      }
    }
  ]
}
Yanıt
{
  "requestId": "6894439706274654514",
  "payload": {
    "devices": {
      "123": {
        "status": "SUCCESS",
        "online": true,
        "on": true,
        "isRunning": true,
        "isPaused": false,
        "timerRemainingSec": 120,
        "currentCookingMode": "COOK",
        "currentFoodPreset": "chicken_key"
      }
    }
  }
}

Örnek EXECUTE komutları

Yemek Yapma

Komut parametreleri hakkında daha ayrıntılı bilgi için action.devices.traits.Cook referansına bakın.

İstek
{
  "requestId": "6894439706274654516",
  "inputs": [
    {
      "intent": "action.devices.EXECUTE",
      "payload": {
        "commands": [
          {
            "devices": [
              {
                "id": "123"
              }
            ],
            "execution": [
              {
                "command": "action.devices.commands.Cook",
                "params": {
                  "start": true,
                  "cookingMode": "BOIL"
                }
              }
            ]
          }
        ]
      }
    }
  ]
}
Yanıt
{
  "requestId": "6894439706274654516",
  "payload": {
    "commands": [
      {
        "ids": [
          "123"
        ],
        "status": "SUCCESS",
        "states": {
          "online": true,
          "currentCookingMode": "BOIL",
          "currentFoodPreset": "NONE"
        }
      }
    ]
  }
}

StartStop

Komut parametreleri hakkında daha ayrıntılı bilgi için action.devices.traits.StartStop referansına bakın.

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

TimerStart

Komut parametreleri hakkında daha ayrıntılı bilgi için action.devices.traits.Timer referansına bakın.

İstek
{
  "requestId": "6894439706274654522",
  "inputs": [
    {
      "intent": "action.devices.EXECUTE",
      "payload": {
        "commands": [
          {
            "devices": [
              {
                "id": "123"
              }
            ],
            "execution": [
              {
                "command": "action.devices.commands.TimerStart",
                "params": {
                  "timerTimeSec": 300
                }
              }
            ]
          }
        ]
      }
    }
  ]
}
Yanıt
{
  "requestId": "6894439706274654522",
  "payload": {
    "commands": [
      {
        "ids": [
          "123"
        ],
        "status": "SUCCESS",
        "states": {
          "online": true,
          "timerRemainingSec": 300
        }
      }
    ]
  }
}

TimerAdjust

Komut parametreleri hakkında daha ayrıntılı bilgi için action.devices.traits.Timer referansına bakın.

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

TimerPause

Komut parametreleri hakkında daha ayrıntılı bilgi için action.devices.traits.Timer referansına bakın.

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

TimerResume

Komut parametreleri hakkında daha ayrıntılı bilgi için action.devices.traits.Timer referansına bakın.

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

TimerCancel

Komut parametreleri hakkında daha ayrıntılı bilgi için action.devices.traits.Timer referansına bakın.

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

OnOff

Komut parametreleri hakkında daha ayrıntılı bilgi için action.devices.traits.OnOff referansına bakın.

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

Cihaz ERRORS

Hataların ve istisnaların tam listesini inceleyin.