Have you checked the temperature scale of your location?
Make a GET request to: https://api.smartthings.com/v1/locations/locationId
If it’s “C” and you want to change it to “F”, send a PUT request to the same endpoint with the following payload
Hi @ygerlovin, the behavior is expected. If we had the option we would probably go back in time and only allow a single unit for capabilities and handle units only at the presentation layer. The alternative we considered to transforming select units would be to require drivers to be aware of the location temperature scale but this is something we believed would represent a poor separation of concerns and would result in a greater number of defects across the ecosystem.
If you really want to report temperature in another unit than what is used for the location, this could be done via a custom capability for your driver.
I was trying to create a custom capability, by basically copying temperatureMeasurement presentation, but my capability doesn’t show historical data button.
I was looking at presentation of Power, Energy and Temperature capabilities.
All of them allow not only see the current value, but also the historical data, but I can’t figure out what in presentation tells the platform to collect and/or show it.
Also, voltage measurement shows the color bar. It would be really cool to reuse it for temperature.
Could you please clarify how this could be done?
I’m not sure I completely understand.
Doesn’t capability presentation define how the capability looks in the App?
Or you mean there are hidden additional presentations elements for stock capabilities, that are not accessable for custom presentations?
What I basically need is to inherit the stock capability and just override units handling
Yes, those special options are not available to add to the custom capability presentation, there’s no property that we could include in the presentation to make the historical button visible.
Also, for example, the battery has a slider display type, but it changes color based on the battery level. This is considered as custom UI for the capabilities as well.
Our team is working to provide a better experience using custom capabilities, when features like this become available, they are included in the announcements and newsletter so, stay tuned on that.
In the meantime, I’ll share your feedback to the corresponding team.
@nayelyz is there also a way to change this in the ST app?
In the moment I’ve edited it in the groovy UI.
In my case the device temperature sensor can be switched between F and C and for testing this will be interesting. But in most cases this will not cause any problems, because most ST users have the locale set correctly.
No, the scale used by the ST app cannot be modified using a driver action based on the device preferences.
It depends on the scale selected for the location:
You can change the scale sent by the device but the app will convert that value automatically. It should be saved as it is in the API status.
However, capabilities like thermostatCoolingSetpoint and thermostatHeatingSetpoint will show the unit sent in the event, it means it won’t be converted (There’s already a report about that).