Customize device details in ST app

Continuing the discussion from Post Requests for Edge Drivers Here (community-created):

How could I customize an edge driver? For example, a thermostat in ST app might display the coolsetpoint, heatsetpoint, current temp with 1 decimal place (70.2 degrees) BUT I would like to change the temp displays to NO decimal place (70 degrees). What would be the easiest way to do that?

Probably, you will need to create your own presentation and capability.
It doesn’t worth it just because of a float value.

1 Like

Hi, @mgrove99

As @w35l3y mentioned, you might have to consider using a custom capability and define its attribute as an integer type.
For the stock capabilities of coolingSetpoint and heatingSetpoint for example, you cannot hide the extra decimal but you can do the following:

  1. Round the value in your integration. For example, if you get the value 70.2, you can round it to be 70.0
  2. Modify the range and steps allowed for the capability so the user won’t be able to enter a value with decimals. This can be done through the device configuration. For example, this configuration:
{
  "component": "main",
  "capability": "thermostatCoolingSetpoint",
  "version": 1,
  "values": [
    {
      "key": "coolingSetpoint.value",
      "range": [
          0,
          40
      ],
      "step": 1
    }
  ],
  "patch": []
}

Will modify the behavior of the capability as shown in this video:

1 Like