Akıllı Ev Evcil Hayvan Mama Kabı Kılavuzu

action.devices.types.PETFEEDER - Evcil hayvan yemlikleriyle etkileşimde bulunmak, çeşitli miktarlarda ve ön ayarlarda evcil hayvan yemi veya su verme gibi işlemleri içerebilir.

Bu tür, cihazın Evcil Hayvan Besleme Makinesi simgesini ve bazı ilgili eş anlamlı kelimeleri ve diğer 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 dokümanına bakın.

Gerekli özellikler

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

Bu özellikler, cihazınız için geçerliyse önerilir. Ancak tüm özellikleri, mevcut ürün işlevlerinize en uygun şekilde dilediğiniz gibi birleştirip kullanabilirsiniz.

Örnek cihaz: Basit evcil hayvan mama kabı

Bu bölümde, yukarıdaki cihaz türüne ve özelliklerine göre yaygın bir "Evcil Hayvan Besleyici" temsil eden örnek amaçlı yükler yer almaktadır. Uygulamanıza özellik ekler veya kaldırırsanız yanıtlarınızı bu değişiklikleri yansıtacak şekilde düzenleyin.

Örnek SYNC yanıtı

İstek
{
  "requestId": "6894439706274654512",
  "inputs": [
    {
      "intent": "action.devices.SYNC"
    }
  ]
}
Yanıt
{
  "requestId": "6894439706274654512",
  "payload": {
    "agentUserId": "user123",
    "devices": [
      {
        "id": "123",
        "type": "action.devices.types.PETFEEDER",
        "traits": [
          "action.devices.traits.Dispense",
          "action.devices.traits.StartStop"
        ],
        "name": {
          "name": "Simple pet feeder"
        },
        "willReportState": true,
        "attributes": {
          "supportedDispenseItems": [
            {
              "item_name": "cat_food_key",
              "item_name_synonyms": [
                {
                  "lang": "en",
                  "synonyms": [
                    "Cat food",
                    "Kibble"
                  ]
                }
              ],
              "supported_units": [
                "OUNCES",
                "CUPS"
              ],
              "default_portion": {
                "amount": 1,
                "unit": "CUPS"
              }
            }
          ],
          "supportedDispensePresets": [
            {
              "preset_name": "cat_meal_key",
              "preset_name_synonyms": [
                {
                  "lang": "en",
                  "synonyms": [
                    "Normal meal",
                    "Dinner"
                  ]
                }
              ]
            }
          ]
        },
        "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,
        "dispenseItems": [
          {
            "itemName": "cat_food_key",
            "amountRemaining": {
              "amount": 6,
              "unit": "CUPS"
            },
            "amountLastDispensed": {
              "amount": 2.5,
              "unit": "CUPS"
            },
            "isCurrentlyDispensing": false
          }
        ],
        "isRunning": true,
        "isPaused": false
      }
    }
  }
}

Örnek EXECUTE komutları

Dağıtma

Komut parametreleri hakkında daha fazla bilgi için action.devices.traits.Dispense referansını inceleyin.

İstek
{
  "requestId": "6894439706274654516",
  "inputs": [
    {
      "intent": "action.devices.EXECUTE",
      "payload": {
        "commands": [
          {
            "devices": [
              {
                "id": "123"
              }
            ],
            "execution": [
              {
                "command": "action.devices.commands.Dispense",
                "params": {
                  "amount": 1,
                  "unit": "CUPS",
                  "item": "cat_food_key"
                }
              }
            ]
          }
        ]
      }
    }
  ]
}
Yanıt
{
  "requestId": "6894439706274654516",
  "payload": {
    "commands": [
      {
        "ids": [
          "123"
        ],
        "status": "PENDING",
        "states": {
          "online": true,
          "dispenseItems": [
            {
              "itemName": "cat_food_key",
              "amountRemaining": {
                "amount": 5,
                "unit": "CUPS"
              },
              "amountLastDispensed": {
                "amount": 1,
                "unit": "CUPS"
              },
              "isCurrentlyDispensing": true
            }
          ]
        }
      }
    ]
  }
}

StartStop

Komut parametreleri hakkında daha fazla bilgi için action.devices.traits.StartStop referansını inceleyin.

İ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": "PENDING",
        "states": {
          "online": true,
          "isRunning": true,
          "isPaused": false
        }
      }
    ]
  }
}

PauseUnpause

Komut parametreleri hakkında daha fazla bilgi için action.devices.traits.StartStop referansını inceleyin.

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

Cihaz HATALARI

Hatalar ve istisnalar listesinin tamamını inceleyin.