Smart-Home-Fritteuse – Leitfaden

action.devices.types.FRYER: Interaktionen mit Friteusen können das Starten und Stoppen, das Einstellen eines Timers, das Anpassen von Kochmodi oder Lebensmittelvoreinstellungen oder das Anpassen verschiedener anderer Einstellungen umfassen.

Dieser Typ gibt an, dass das Gerät das Friteusensymbol und einige zugehörige Synonyme und Aliasse erhält.

Gerätefunktionen

In der entsprechenden Dokumentation zu Merkmalen finden Sie Implementierungsdetails wie Attribute und Status, die Ihr Dienst unterstützen sollte, sowie Informationen zum Erstellen von EXECUTE- und QUERY-Antworten.

Erforderliche Merkmale

Diese Merkmale und Befehle sind erforderlich, sofern sie für Ihr Gerät gelten. Wenn Ihr Gerät diese Eigenschaften nicht unterstützt, geben Sie den Fehlercode functionNotSupported in einer QUERY- oder EXECUTE-Antwort ein. Weitere Informationen finden Sie unter Fehler und Ausnahmen.

Diese Eigenschaften werden empfohlen, sofern sie für Ihr Gerät gelten. Sie können jedoch alle verfügbaren Merkmale kombinieren, um sie bestmöglich an Ihre vorhandenen Produktfunktionen anzupassen.

Qualitätsanforderungen

  • Latenz:darf maximal 3.000 ms betragen.
  • Zuverlässigkeit:muss mindestens 97% betragen.

Beispielgerät: Einfache Fritteuse

Dieser Abschnitt enthält Beispiel-Intent-Nutzlasten für einen gängigen „Friteuse“ basierend auf dem Gerätetyp und den oben genannten Merkmalen. Wenn Sie in Ihrer Implementierung Merkmale hinzufügen oder entfernen, ändern Sie Ihre Antworten entsprechend, um diese Änderungen widerzuspiegeln.

Beispiel für eine SYNC-Antwort

Anfrage
{
  "requestId": "6894439706274654512",
  "inputs": [
    {
      "intent": "action.devices.SYNC"
    }
  ]
}
Antwort
{
  "requestId": "6894439706274654512",
  "payload": {
    "agentUserId": "user123",
    "devices": [
      {
        "id": "123",
        "type": "action.devices.types.FRYER",
        "traits": [
          "action.devices.traits.Cook",
          "action.devices.traits.StartStop",
          "action.devices.traits.Timer",
          "action.devices.traits.OnOff"
        ],
        "name": {
          "name": "Simple fryer"
        },
        "willReportState": true,
        "attributes": {
          "supportedCookingModes": [
            "FRY"
          ],
          "foodPresets": [
            {
              "food_preset_name": "french_fries_key",
              "supported_units": [
                "POUNDS",
                "OUNCES"
              ],
              "food_synonyms": [
                {
                  "synonym": [
                    "French fries",
                    "Fries"
                  ],
                  "lang": "en"
                }
              ]
            },
            {
              "food_preset_name": "hash_browns_key",
              "supported_units": [
                "CUPS",
                "OUNCES"
              ],
              "food_synonyms": [
                {
                  "synonym": [
                    "Hash browns",
                    "Hash potatoes"
                  ],
                  "lang": "en"
                }
              ]
            }
          ],
          "maxTimerLimitSec": 1200,
          "pausable": true
        },
        "deviceInfo": {
          "manufacturer": "smart-home-inc",
          "model": "hs1234",
          "hwVersion": "3.2",
          "swVersion": "11.4"
        }
      }
    ]
  }
}

Beispiel für eine QUERY-Antwort

Anfrage
{
  "requestId": "6894439706274654514",
  "inputs": [
    {
      "intent": "action.devices.QUERY",
      "payload": {
        "devices": [
          {
            "id": "123"
          }
        ]
      }
    }
  ]
}
Antwort
{
  "requestId": "6894439706274654514",
  "payload": {
    "devices": {
      "123": {
        "status": "SUCCESS",
        "online": true,
        "on": true,
        "isRunning": true,
        "isPaused": false,
        "timerRemainingSec": 120,
        "currentCookingMode": "FRY",
        "currentFoodPreset": "NONE"
      }
    }
  }
}

Beispielbefehle für EXECUTE

Kochen

Weitere Informationen zu den Befehlsparametern finden Sie in der action.devices.traits.Cook-Referenz.

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

StartStop

Weitere Informationen zu den Befehlsparametern finden Sie in der action.devices.traits.StartStop-Referenz.

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

TimerStart

Weitere Informationen zu den Befehlsparametern finden Sie in der action.devices.traits.Timer-Referenz.

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

TimerAdjust

Weitere Informationen zu den Befehlsparametern finden Sie in der action.devices.traits.Timer-Referenz.

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

TimerPause

Weitere Informationen zu den Befehlsparametern finden Sie in der action.devices.traits.Timer-Referenz.

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

TimerResume

Weitere Informationen zu den Befehlsparametern finden Sie in der action.devices.traits.Timer-Referenz.

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

TimerCancel

Weitere Informationen zu den Befehlsparametern finden Sie in der action.devices.traits.Timer-Referenz.

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

OnOff

Weitere Informationen zu den Befehlsparametern finden Sie in der action.devices.traits.OnOff-Referenz.

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

GERÄTEFEHLER

Eine vollständige Liste der Fehler und Ausnahmen