Dear developers,
Yesterday I got my new Samsung fridge and I am trying to understand how to interface with it. I found the Core SDK for Javascript and that seems to work just fine. However, the documentation is a bit minimal, for example on how to execute a commands on Devices.
So for example, I am able to read the temperature of the cooler by running this:
client.devices.getCapabilityStatus(UUID,’cooler','temperatureMeasurement').then(reply => {
console.log(reply);
})
Which gives this awesome output:
{
temperature: { value: 4, unit: 'C', timestamp: '2022-09-23T06:42:23.201Z' }
}
But now I am trying to set the temperature. Where I am supposed to find out how to format the command? What I found it this, which does not apply to coolers, but does give a hint on formatting:
Here seems to be some documentation on the thermostatCoolingSetpoint
But I can’t seem to get it right. Here’s what I have now:
var command =
{
"component": "cooler",
"capability": "thermostatCoolingSetpoint",
"command": "setCoolingSetpoint",
"arguments":
{
"value": 6,
"unit": "C"
}
};
client.devices.executeCommand(UUID,command).then(reply => {
console.log(reply);
})
It generates an error
(node:9898) UnhandledPromiseRejectionWarning: Error: Request failed with status code 422: {"requestId":"A55ABAA6-2C56-474D-8341-458915BEAD63","error":{"code":"ConstraintViolationError","message":"The request is malformed.","details":[{"code":"BodyMalformedError","target":"commands.arguments","message":"The request body is malformed and cannot be processed by server.","details":[]}]}}
So apparently I am not talking in the right language. Can someone help me plz?