HVAC_TEMPERATURE_VALUE_SUGGESTION
What it is
Suggested values for setting HVAC temperature.
Implement the property to help applications understand the closest supported temperature value in Celsius or Fahrenheit.
floatValues[0] = the requested value that an application wants to set a temperature to.
floatValues[1] = the unit for floatValues[0]. It should be one of
{VehicleUnit.CELSIUS, VehicleUnit.FAHRENHEIT}.
floatValues[2] = the value OEMs suggested in CELSIUS. This value is not included
in the request.
floatValues[3] = the value OEMs suggested in FAHRENHEIT. This value is not included
in the request.An application calls set(VehiclePropValue propValue) with the requested value and unit for the value. OEMs need to return the suggested values in floatValues[2] and floatValues[3] by onPropertyEvent() callbacks. The suggested values must conform to the values that can be derived from the HVAC_TEMPERATURE_SET configArray. In other words, the suggested values and the table of values from the configArray should be the same. It is recommended for the OEM to add custom logic in their VHAL implementation in order to avoid making requests to the HVAC ECU.
The logic can be as follows: For converting the temperature from celsius to fahrenheit use the following: // Given tempC and the configArray float minTempC = configArray[0] / 10.0; float temperatureIncrementCelsius = configArray[2] / 10.0; float minTempF = configArray[3] / 10.0; float temperatureIncrementFahrenheit = configArray[5] / 10.0; // Round to the closest increment int numIncrements = round((tempC - minTempC) / temperatureIncrementCelsius); tempF = temperatureIncrementFahrenheit * numIncrements + minTempF;
For example, when a user uses the voice assistant to set HVAC temperature to 66.2 in Fahrenheit. First, an application will set this property with the value [66.2, (float)VehicleUnit.FAHRENHEIT,0,0]. If OEMs suggest to set 19.0 in Celsius or 66.5 in Fahrenheit for user's request, then VHAL must generate a callback with property value [66.2, (float)VehicleUnit.FAHRENHEIT, 19.0, 66.5]. After the voice assistant gets the callback, it will inform the user and set HVAC temperature to the suggested value.
Another example, an application receives 21 Celsius as the current temperature value by querying HVC_TEMPERATURE_SET. But the application wants to know what value is displayed on the car's UI in Fahrenheit. For this, the application sets the property to [21, (float)VehicleUnit.CELSIUS, 0, 0]. If the suggested value by the OEM for 21 Celsius is 70 Fahrenheit, then VHAL must generate a callback with property value [21, (float)VehicleUnit.CELSIUS, 21.0, 70.0]. In this case, the application can know that the value is 70.0 Fahrenheit in the car’s UI.
How the ID is built
A property ID is a 32-bit value packing four fields. Reading 0x11610515 apart:
| Field | Mask | Value | Means |
|---|---|---|---|
| Group | 0xf0000000 | 0x10000000 | SYSTEM |
| Area | 0x0f000000 | 0x01000000 | GLOBAL |
| Type | 0x00ff0000 | 0x00610000 | FLOAT_VEC |
| Ordinal | 0x0000ffff | 0x00000515 | 0x515 |
Reading it from an app
CarPropertyManager mgr = (CarPropertyManager)
car.getCarManager(Car.PROPERTY_SERVICE);
CarPropertyValue<Float> value =
mgr.getProperty(VehiclePropertyIds.HVAC_TEMPERATURE_VALUE_SUGGESTION, 0);This property can be read and written, though an OEM may implement it as read-only. It fires a callback whenever the value changes.

