My thermostat reporting the capability of thermostatMode. The current code was sending the capability of thermostat.
I was not sure if this was a global bug with all thermostats or specific to my device, so I chose to just duplicate the switch and pass the matching value for the capability.
Supporting topic/capability thermostat and thermostatMode
Output from the smartthings cli.
`Capabilities:
┌───┬─────────────────────────────┐
│ 1 │ switch │
│ 2 │ temperatureMeasurement │
│ 3 │ thermostatCoolingSetpoint │
│ 4 │ healthCheck │
│ 5 │ relativeHumidityMeasurement │
│ 6 │ thermostatMode │
│ 7 │ refresh │
└───┴─────────────────────────────┘
? Enter capability index or id 6
Error from previous code. When trying to inject a change to the device. topic = thermostatMode payload = {"value":"dryair"}
`qs:
body:
component: main
capability: thermostat
command: setThermostatMode
arguments:
dryair
19 Jun 20:21:05 - [error] [smartthings-node-thermostat:Mr cool(thermostatMode)] Error updating device
19 Jun 20:21:05 - [error] [smartthings-node-thermostat:Mr cool(thermostatMode)] StatusCodeError: 422 - {"requestId":"[redacted]","error":{"code":"ConstraintViolationError","message":"The request is malformed.","detai
ls":[{"code":"NotValidValue","target":"commands[0].capability","message":"thermostat is not a valid value.","details":[]}`
My thermostat reporting the capability of thermostatMode. The current code was sending the capability of thermostat. I was not sure if this was a global bug with all thermostats or specific to my device, so I chose to just duplicate the switch and pass the matching value for the capability. Supporting topic/capability thermostat and thermostatMode
Output from the smartthings cli. `Capabilities: ┌───┬─────────────────────────────┐ │ 1 │ switch │ │ 2 │ temperatureMeasurement │ │ 3 │ thermostatCoolingSetpoint │ │ 4 │ healthCheck │ │ 5 │ relativeHumidityMeasurement │ │ 6 │ thermostatMode │ │ 7 │ refresh │ └───┴─────────────────────────────┘ ? Enter capability index or id 6
Commands: ┌───┬───────────────────────────────────────────────────────────────────────┐ │ 1 │ heat() │ │ 2 │ auto() │ │ 3 │ setThermostatMode(mode<enum {asleep, auto, autowitheco, autowithreset │ │ │ autochangeover, autochangeoveractive, autocool, autoheat │ │ │ auxheatonly, auxiliaryemergencyheat, away, cool, custom │ │ │ dayoff, dryair, eco, emergency heat, emergencyheat │ │ │ emergencyheatactive, energysavecool, energysaveheat, fanonly │ │ │ frostguard, furnace, heat, heatingoff, home, in, manual │ │ │ moistair, off, out, resume, rush hour, rushhour, schedule │ │ │ southernaway}>) │ │ 4 │ cool() │ │ 5 │ emergencyHeat() │ │ 6 │ off() │ └───┴───────────────────────────────────────────────────────────────────────┘`
Error from previous code. When trying to inject a change to the device. topic = thermostatMode payload = {"value":"dryair"}
`qs:
body:
component: main
capability: thermostat
command: setThermostatMode
arguments:
19 Jun 20:21:05 - [error] [smartthings-node-thermostat:Mr cool(thermostatMode)] Error updating device
19 Jun 20:21:05 - [error] [smartthings-node-thermostat:Mr cool(thermostatMode)] StatusCodeError: 422 - {"requestId":"[redacted]","error":{"code":"ConstraintViolationError","message":"The request is malformed.","detai ls":[{"code":"NotValidValue","target":"commands[0].capability","message":"thermostat is not a valid value.","details":[]}`