מדריך לתרמוסטט לבית חכם

‫action.devices.types.THERMOSTAT – תרמוסטטים הם מכשירים לניהול טמפרטורה, עם נקודות הגדרה ומצבים. כך הם נבדלים ממחממים וממזגנים, שיכול להיות שיש להם רק מצבים והגדרות (לדוגמה, גבוה/נמוך) ולא טמפרטורת יעד.

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

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

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

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

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

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

פקודות של תרמוסטט משורשרות לעיתים קרובות בכוונות EXECUTE. משתמש שאומר *Set the heat to 72* (הגדר את החימום ל-72) ייצור פקודת מצב ואחריה הגדרת טמפרטורה.

דוגמה למכשיר: תרמוסטט פשוט

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

דוגמה לתגובת סנכרון

בקשה
{
  "requestId": "6894439706274654512",
  "inputs": [
    {
      "intent": "action.devices.SYNC"
    }
  ]
}
תשובה
{
  "requestId": "6894439706274654512",
  "payload": {
    "agentUserId": "user123",
    "devices": [
      {
        "id": "123",
        "type": "action.devices.types.THERMOSTAT",
        "traits": [
          "action.devices.traits.TemperatureSetting"
        ],
        "name": {
          "name": "Simple thermostat"
        },
        "willReportState": true,
        "attributes": {
          "availableThermostatModes": [
            "off",
            "heat",
            "cool",
            "heatcool",
            "on"
          ],
          "thermostatTemperatureRange": {
            "minThresholdCelsius": 15,
            "maxThresholdCelsius": 30
          },
          "thermostatTemperatureUnit": "F"
        },
        "deviceInfo": {
          "manufacturer": "smart-home-inc",
          "model": "hs1234",
          "hwVersion": "3.2",
          "swVersion": "11.4"
        }
      }
    ]
  }
}

דוגמה לתשובה של שאילתה

בקשה
{
  "requestId": "6894439706274654514",
  "inputs": [
    {
      "intent": "action.devices.QUERY",
      "payload": {
        "devices": [
          {
            "id": "123"
          }
        ]
      }
    }
  ]
}
תשובה
{
  "requestId": "6894439706274654514",
  "payload": {
    "devices": {
      "123": {
        "status": "SUCCESS",
        "online": true,
        "thermostatMode": "cool",
        "thermostatTemperatureSetpoint": 23,
        "thermostatTemperatureAmbient": 25.1,
        "thermostatHumidityAmbient": 45.3
      }
    }
  }
}

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

ThermostatTemperatureSetpoint

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

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

ThermostatTemperatureSetRange

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

בקשה
{
  "requestId": "6894439706274654518",
  "inputs": [
    {
      "intent": "action.devices.EXECUTE",
      "payload": {
        "commands": [
          {
            "devices": [
              {
                "id": "123"
              }
            ],
            "execution": [
              {
                "command": "action.devices.commands.ThermostatTemperatureSetRange",
                "params": {
                  "thermostatTemperatureSetpointHigh": 26,
                  "thermostatTemperatureSetpointLow": 22
                }
              }
            ]
          }
        ]
      }
    }
  ]
}
תשובה
{
  "requestId": "6894439706274654518",
  "payload": {
    "commands": [
      {
        "ids": [
          "123"
        ],
        "status": "SUCCESS",
        "states": {
          "online": true,
          "thermostatMode": "heatcool",
          "thermostatTemperatureSetpointHigh": 26,
          "thermostatTemperatureSetpointLow": 22,
          "thermostatTemperatureAmbient": 25.1
        }
      }
    ]
  }
}

ThermostatSetMode

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

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

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

רשימה מלאה של שגיאות וחריגים
  • ‫inHeatOrCool – הפקודות Heat/Cool/Range נכשלו כי המכשיר נמצא במצב חימום או קירור מפורש.
  • ‫inHeatCool – הפקודות 'חימום' או 'קירור' נכשלו כי המכשיר נמצא במצב חימום או קירור.
  • ‫lockedToRange – המכשיר נעול לטווח טמפרטורות או למצב מסוים, ואי אפשר לבצע את השינוי המבוקש.
  • ‫rangeTooClose - נקודות הטמפרטורה בטווח החימום והקירור קרובות מדי זו לזו.