cancel
Showing results for 
Search instead for 
Did you mean: 

Google Smart Home For Refrigerator

keda
Community Member

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?

1 Recommended Answer

arm_dpe
Solutions Expert
Solutions Expert

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.

Implementation strategy.

  1. 3 Separate Devices: Define a distinct device object in your SYNC payload for each compartment.
  2. Specific Device Types:
    • Fridge: action.devices.types.REFRIGERATOR
    • Freezer: action.devices.types.FREEZER
    • Variable Zone: action.devices.types.REFRIGERATOR
  3. Single Trait: Use the simple action.devices.traits.TemperatureControl trait for all three devices. This trait manages only one temperature setpoint per device.
  4. Distinct Naming: Assign clear, unique names (e.g., "Kitchen Refrigerator," "Kitchen Freezer," "Variable Zone") so the user can easily distinguish them in the GHA UI and through voice commands.
  5. Defined Ranges: Use the temperatureRange attribute for each device to specify the appropriate operating limits (e.g., -25°C to -15°C for the freezer).

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:

JSON
 
{
  "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 }
        }
      }
    ]
  }
}

View Recommended Answer in original post

1 REPLY 1

arm_dpe
Solutions Expert
Solutions Expert

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.

Implementation strategy.

  1. 3 Separate Devices: Define a distinct device object in your SYNC payload for each compartment.
  2. Specific Device Types:
    • Fridge: action.devices.types.REFRIGERATOR
    • Freezer: action.devices.types.FREEZER
    • Variable Zone: action.devices.types.REFRIGERATOR
  3. Single Trait: Use the simple action.devices.traits.TemperatureControl trait for all three devices. This trait manages only one temperature setpoint per device.
  4. Distinct Naming: Assign clear, unique names (e.g., "Kitchen Refrigerator," "Kitchen Freezer," "Variable Zone") so the user can easily distinguish them in the GHA UI and through voice commands.
  5. Defined Ranges: Use the temperatureRange attribute for each device to specify the appropriate operating limits (e.g., -25°C to -15°C for the freezer).

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:

JSON
 
{
  "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 }
        }
      }
    ]
  }
}