简体   繁体   中英

google smart home actions for thermostat about temperature unit

I am developing smart home action for thermostat, some questions as below:

1.For TemperatureSetting device trait, some informations as below link: https://developers.google.com/assistant/smarthome/traits/temperaturesetting

=>Note 2: Temperatures can be set in Fahrenheit by the user, but all temperature values in commands and states are in Celsius

It makes me confused, user can set temperature in Fahrenheit, but device state command and states are in Celsius?

2.How to implement this? is that means when user set temperature in Fahrenheit, I must transfer the unit to Celsius in google function?

3.How about report device state, if user use voice command set temperature in Fahrenheit, but device state report temperature in Celsius, user will hear temperature in Celsius, it seems not make sense.

Thank you.

BR, Jack

What this means is that, from a technical point-of-view, all units should be in Celsius.

If someone says, "Set the temperature to 70", the actual temperature definitely depends on what units they're using. This may be set by individual preference or locale. However that is not important to your smart home service. You'll always get the temperature in Celsius (21 C). You don't need to perform the conversion yourself.

So when you report the state of your thermostat, it should also be in Celsius regardless of user preference. The Google Assistant will perform the necessary conversions to provide a good user experience.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM