How to define main tile in new app

Hi All,

I’m new to the Device Handlers world, as a first experiment I want to modify a device handler for a sensor I have:

https://raw.githubusercontent.com/fison67/mi_connector/master/devicetypes/fison67/xiaomi-sensor-ht.src/xiaomi-sensor-ht.groovy

To display humidity instead of temperature as a main tile. I read some documentation and editing the main() woud work, but it’s not sorting any result after removing and adding back the device.

What am I doing wrong ?

note that both the humidity and the temperature are already received.

Thanks

You need to use generate a device presentation jason file for that using the smartthings API

Can you please point to on how do I do that?

But the thing is, both the temperature and the humidity are already received. I just need to display one on the main screen instead of the other.

do i still need to do as you say ?

Here you can use my try for updating the evohome integration. @nayelyz is great help. Maybe she could help you out.

Also you can only display one capability on the dashboard at this phase.

Thanks @Andremain. Currently, the tiles configuration in the DTH is not taken into consideration, that’s why you need to create a device configuration as Andreas said.
To do so, you need to set up the SmartThings CLI as follows:

  1. Download the latest release (Releases · SmartThingsCommunity/smartthings-cli · GitHub)
  2. Create a Personal Access Token, preferably selecting all the scopes (Samsung account)
  3. Depending on your PC OS, you need to create the “@smartthings/cli” folder at the location indicated on the configuration page (https://github.com/SmartThingsCommunity/smartthings-cli/blob/master/packages/cli/doc/configuration.md)
  4. Once you have the folder, you need to add there the “config.yaml” with your Personal Access Token created previously, it should have the correct indentation as the sample below:
default:
          token: xxxx-xxx-xxxx
  1. To verify the configuration, use the command smartthings devices. It should retrieve the devices list, if you receive an authentication error, check the config.yaml file or add the --token flag, for example, smartthings devices --token=PAT

After that, you can create your device configuration, the steps are:

  1. Generate the default configuration using the command:
smartthings presentation:device-config:generate dth-id --dth -j -o=devConfigPres.json
  1. Edit the devConfigPres.json file. There, you need to leave only the relativeHumidityMeasurementcapability in the Dashboard View.
  2. Create the device configuration with the command:
smartthings presentation:device-config:create -i devConfigPres.json
  1. Add the properties vid and mnmn in your DTH definition. Example:
definition (name: "dthName", vid:"xxxx-xxxx-xxxx", mnmn: "SmartThingsCommunity", //...) {
    //...    
}
  1. Then, save and publish it again. If changes are not effective, you need to re-add the device.

For more info, check this document or the post below (section " Generate / Post Device Configuration")