0

I cannot understand how to write a response like following situation.

Precondition

  • AC_UNIT supports TEMPERATURE_SETTING traits.
  • AC_UNIT's availableThermostatMode is "off,on,heat,cool"
  • AC_UNIT's current mode is cool.

When I do a "Set the heat to {temperature}", google send like a following message.

How to write a response when ThermostatSetMode command succeeds and ThermostatTemperatureSetPoint failed?

Am I not able to write a response which contains each commands result?

{
  "inputs": [
    {
      "intent": "action.devices.EXECUTE",
      "payload": {
        "commands": [
          {
            "devices": [
              {
                "id": "device id"
              }
            ],
            "execution": [
              {
                "command": "action.devices.commands.ThermostatSetMode",
                "params": {
                  "thermostatMode": "heat"
                }
              },
              {
                "command": "action.devices.commands.ThermostatTemperatureSetpoint",
                "params": {
                  "thermostatTemperatureSetpoint": 32 // this is out of range value.
                }
              }
            ]
          }
        ]
      }
    }
  ],
  "requestId": "requestId"
}

Thanks.

sh_rh
  • 3
  • 1

1 Answers1

0

There's not a way to specify the response on a per-command basis, just on the device level. In this case, your best bet would be to return an error in the response with valueOutOfRange which will alert the user.

Nick Felker
  • 11,536
  • 1
  • 21
  • 35