מדריך למצנני אוויר לבית חכם

action.devices.types.AIRCOOLER – מקררי אוויר הם מכשירים שמאפשרים קירור של הטמפרטורה ובקרה על הלחות. המכשירים האלה בדרך כלל קלים יותר וניידים יותר ממזגנים, ויש להם מיכל מים מצורף. יכול להיות שמקררי אוויר לא תומכים בחימום או בהגדרת טמפרטורות מדויקות. אינטראקציות עם מקררי אוויר עשויות לכלול שינוי של מהירות המאוורר והגדרת הלחות.

הסוג הזה מציין שהמכשיר יקבל את הסמל של מקרר האוויר וגם כמה שמות נרדפים וכינויים קשורים.

יכולות המכשיר

פרטי ההטמעה, כמו המאפיינים והמצבים שהשירות צריך לתמוך בהם, והאופן שבו יוצרים תגובות EXECUTE ו-QUERY, מפורטים במסמכי העזרה של המאפיינים המתאימים.

מאפיינים נדרשים

המאפיינים והפקודות האלה נדרשים, אם הם רלוונטיים למכשיר שלכם. אם המכשיר לא תומך במאפיינים האלה, מזינים את קוד השגיאה functionNotSupported בתגובה של QUERY או EXECUTE. מידע נוסף זמין במאמר שגיאות וחריגות.

דרישות איכות

  • זמן אחזור: חייב להיות קטן מ-1000ms או שווה לו.
  • אמינות: הערך חייב להיות שווה ל-97% או גדול ממנו.

דוגמה למכשיר: מקרר אוויר פשוט

בקטע הזה מפורטות דוגמאות של נתוני עומס שימושי (payload) של כוונה שמייצגים מכשיר נפוץ מסוג 'מקרר אוויר', על סמך סוג המכשיר והמאפיינים שצוינו למעלה. אם מוסיפים או מסירים מאפיינים בהטמעה, צריך לשנות את התשובות בהתאם כדי לשקף את השינויים האלה.

דוגמה לתגובת SYNC

בקשה
{
  "requestId": "6894439706274654512",
  "inputs": [
    {
      "intent": "action.devices.SYNC"
    }
  ]
}
תשובה
{
  "requestId": "6894439706274654512",
  "payload": {
    "agentUserId": "user123",
    "devices": [
      {
        "id": "123",
        "type": "action.devices.types.AIRCOOLER",
        "traits": [
          "action.devices.traits.FanSpeed",
          "action.devices.traits.HumiditySetting",
          "action.devices.traits.OnOff",
          "action.devices.traits.TemperatureSetting"
        ],
        "name": {
          "name": "Simple air cooler"
        },
        "willReportState": true,
        "attributes": {
          "humiditySetpointRange": {
            "minPercent": 0,
            "maxPercent": 50
          },
          "availableFanSpeeds": {
            "speeds": [
              {
                "speed_name": "off_key",
                "speed_values": [
                  {
                    "speed_synonym": [
                      "Off",
                      "0"
                    ],
                    "lang": "en"
                  }
                ]
              },
              {
                "speed_name": "low_key",
                "speed_values": [
                  {
                    "speed_synonym": [
                      "Low",
                      "1"
                    ],
                    "lang": "en"
                  }
                ]
              },
              {
                "speed_name": "medium_key",
                "speed_values": [
                  {
                    "speed_synonym": [
                      "Medium",
                      "2"
                    ],
                    "lang": "en"
                  }
                ]
              },
              {
                "speed_name": "high_key",
                "speed_values": [
                  {
                    "speed_synonym": [
                      "High",
                      "3"
                    ],
                    "lang": "en"
                  }
                ]
              }
            ],
            "ordered": true
          },
          "availableThermostatModes": [
            "off",
            "cool",
            "on",
            "fan-only",
            "eco"
          ],
          "thermostatTemperatureUnit": "C"
        },
        "deviceInfo": {
          "manufacturer": "smart-home-inc",
          "model": "hs1234",
          "hwVersion": "3.2",
          "swVersion": "11.4"
        }
      }
    ]
  }
}

דוגמה לתשובה של QUERY

בקשה
{
  "requestId": "6894439706274654514",
  "inputs": [
    {
      "intent": "action.devices.QUERY",
      "payload": {
        "devices": [
          {
            "id": "123"
          }
        ]
      }
    }
  ]
}
תשובה
{
  "requestId": "6894439706274654514",
  "payload": {
    "devices": {
      "123": {
        "status": "SUCCESS",
        "online": true,
        "on": true,
        "currentFanSpeedSetting": "low_key",
        "thermostatMode": "cool",
        "thermostatTemperatureAmbient": 25,
        "thermostatTemperatureSetpoint": 20,
        "humiditySetpointPercent": 15,
        "humidityAmbientPercent": 10
      }
    }
  }
}

דוגמאות לפקודות EXECUTE

SetFanSpeed

פרטים נוספים על הפרמטרים של הפקודה זמינים במאמר העזרה של action.devices.traits.FanSpeed.

בקשה
{
  "requestId": "6894439706274654518",
  "inputs": [
    {
      "intent": "action.devices.EXECUTE",
      "payload": {
        "commands": [
          {
            "devices": [
              {
                "id": "123"
              }
            ],
            "execution": [
              {
                "command": "action.devices.commands.SetFanSpeed",
                "params": {
                  "fanSpeed": "high_key"
                }
              }
            ]
          }
        ]
      }
    }
  ]
}
תשובה
{
  "requestId": "6894439706274654518",
  "payload": {
    "commands": [
      {
        "ids": [
          "123"
        ],
        "status": "SUCCESS",
        "states": {
          "online": true,
          "currentFanSpeedSetting": "high_key"
        }
      }
    ]
  }
}

SetHumidity

פרטים נוספים על הפרמטרים של הפקודה זמינים במאמר העזרה של action.devices.traits.HumiditySetting.

בקשה
{
  "requestId": "6894439706274654520",
  "inputs": [
    {
      "intent": "action.devices.EXECUTE",
      "payload": {
        "commands": [
          {
            "devices": [
              {
                "id": "123"
              }
            ],
            "execution": [
              {
                "command": "action.devices.commands.SetHumidity",
                "params": {
                  "humidity": 20
                }
              }
            ]
          }
        ]
      }
    }
  ]
}
תשובה
{
  "requestId": "6894439706274654520",
  "payload": {
    "commands": [
      {
        "ids": [
          "123"
        ],
        "status": "SUCCESS",
        "states": {
          "online": true,
          "humiditySetpointPercent": 20,
          "humidityAmbientPercent": 10
        }
      }
    ]
  }
}

OnOff

פרטים נוספים על הפרמטרים של הפקודה זמינים במאמר העזרה של action.devices.traits.OnOff.

בקשה
{
  "requestId": "6894439706274654516",
  "inputs": [
    {
      "intent": "action.devices.EXECUTE",
      "payload": {
        "commands": [
          {
            "devices": [
              {
                "id": "123"
              }
            ],
            "execution": [
              {
                "command": "action.devices.commands.OnOff",
                "params": {
                  "on": true
                }
              }
            ]
          }
        ]
      }
    }
  ]
}
תשובה
{
  "requestId": "6894439706274654516",
  "payload": {
    "commands": [
      {
        "ids": [
          "123"
        ],
        "status": "SUCCESS",
        "states": {
          "online": true,
          "on": true
        }
      }
    ]
  }
}

ThermostatTemperatureSetpoint

פרטים נוספים על הפרמטרים של הפקודה זמינים במאמר העזרה של action.devices.traits.TemperatureSetting.

בקשה
{
  "requestId": "6894439706274654522",
  "inputs": [
    {
      "intent": "action.devices.EXECUTE",
      "payload": {
        "commands": [
          {
            "devices": [
              {
                "id": "123"
              }
            ],
            "execution": [
              {
                "command": "action.devices.commands.ThermostatTemperatureSetpoint",
                "params": {
                  "thermostatTemperatureSetpoint": 22
                }
              }
            ]
          }
        ]
      }
    }
  ]
}
תשובה
{
  "requestId": "6894439706274654522",
  "payload": {
    "commands": [
      {
        "ids": [
          "123"
        ],
        "status": "SUCCESS",
        "states": {
          "online": true,
          "thermostatMode": "cool",
          "thermostatTemperatureSetpoint": 22,
          "thermostatTemperatureAmbient": 25.1
        }
      }
    ]
  }
}

ThermostatSetMode

פרטים נוספים על הפרמטרים של הפקודה זמינים במאמר העזרה של action.devices.traits.TemperatureSetting.

בקשה
{
  "requestId": "6894439706274654524",
  "inputs": [
    {
      "intent": "action.devices.EXECUTE",
      "payload": {
        "commands": [
          {
            "devices": [
              {
                "id": "123"
              }
            ],
            "execution": [
              {
                "command": "action.devices.commands.ThermostatSetMode",
                "params": {
                  "thermostatMode": "cool"
                }
              }
            ]
          }
        ]
      }
    }
  ]
}
תשובה
{
  "requestId": "6894439706274654524",
  "payload": {
    "commands": [
      {
        "ids": [
          "123"
        ],
        "status": "SUCCESS",
        "states": {
          "online": true,
          "thermostatMode": "cool",
          "thermostatTemperatureSetpoint": 22,
          "thermostatTemperatureAmbient": 25.1
        }
      }
    ]
  }
}

שגיאות במכשיר

הרשימה המלאה של השגיאות והחריגות