a week ago
I currently have a refrigerator that supports separately setting the temperature for the fridge compartment, freezer compartment, and variable compartment. From the documentation, I see that the `TemperatureControl` trait can be used for temperature control, but it only allows single temperature control. My refrigerator requires separate temperature control for three compartments. Could you please advise on what I should do? Is there anyone who can provide suggestions for the corresponding SYNC response?
Answered! Go to the Recommended Answer.
Wednesday
To implement separate temperature control for your refrigerator's three compartments (Fridge, Freezer, Variable Zone) while ensuring Google Home App (GHA) UI visibility and simplified certification, the recommended approach is to model the single physical appliance as three separate devices in your SYNC response.
Your final SYNC response will contain an array of three device objects, ensuring each compartment appears as an independent, controllable temperature device in the user's Google Home interface.
For example:
{
"requestId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"payload": {
"agentUserId": "user-id-123",
"devices": [
{
"id": "fridge_compartment_123",
"type": "action.devices.types.REFRIGERATOR",
"traits": ["action.devices.traits.TemperatureControl"],
"name": { "defaultNames": ["Fridge"], "name": "Kitchen Refrigerator" },
"willReportState": true,
"attributes": {
"temperatureUnitForControl": "C",
"temperatureRange": { "minThreshold": 1, "maxThreshold": 7 }
}
},
{
"id": "freezer_compartment_123",
"type": "action.devices.types.FREEZER",
"traits": ["action.devices.traits.TemperatureControl"],
"name": { "defaultNames": ["Freezer"], "name": "Kitchen Freezer" },
"willReportState": true,
"attributes": {
"temperatureUnitForControl": "C",
"temperatureRange": { "minThreshold": -25, "maxThreshold": -15 }
}
},
{
"id": "variable_zone_123",
"type": "action.devices.types.REFRIGERATOR",
"traits": ["action.devices.traits.TemperatureControl"],
"name": { "defaultNames": ["Custom Zone"], "name": "Variable Zone" },
"willReportState": true,
"attributes": {
"temperatureUnitForControl": "C",
"temperatureRange": { "minThreshold": -5, "maxThreshold": 5 }
}
}
]
}
}
Wednesday
To implement separate temperature control for your refrigerator's three compartments (Fridge, Freezer, Variable Zone) while ensuring Google Home App (GHA) UI visibility and simplified certification, the recommended approach is to model the single physical appliance as three separate devices in your SYNC response.
Your final SYNC response will contain an array of three device objects, ensuring each compartment appears as an independent, controllable temperature device in the user's Google Home interface.
For example:
{
"requestId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"payload": {
"agentUserId": "user-id-123",
"devices": [
{
"id": "fridge_compartment_123",
"type": "action.devices.types.REFRIGERATOR",
"traits": ["action.devices.traits.TemperatureControl"],
"name": { "defaultNames": ["Fridge"], "name": "Kitchen Refrigerator" },
"willReportState": true,
"attributes": {
"temperatureUnitForControl": "C",
"temperatureRange": { "minThreshold": 1, "maxThreshold": 7 }
}
},
{
"id": "freezer_compartment_123",
"type": "action.devices.types.FREEZER",
"traits": ["action.devices.traits.TemperatureControl"],
"name": { "defaultNames": ["Freezer"], "name": "Kitchen Freezer" },
"willReportState": true,
"attributes": {
"temperatureUnitForControl": "C",
"temperatureRange": { "minThreshold": -25, "maxThreshold": -15 }
}
},
{
"id": "variable_zone_123",
"type": "action.devices.types.REFRIGERATOR",
"traits": ["action.devices.traits.TemperatureControl"],
"name": { "defaultNames": ["Custom Zone"], "name": "Variable Zone" },
"willReportState": true,
"attributes": {
"temperatureUnitForControl": "C",
"temperatureRange": { "minThreshold": -5, "maxThreshold": 5 }
}
}
]
}
}