TMachado
(Tiago Machado)
January 19, 2021, 5:17pm
1
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
Andremain
(Andreas Christodoulou)
January 19, 2021, 5:33pm
2
You need to use generate a device presentation jason file for that using the smartthings API
TMachado
(Tiago Machado)
January 19, 2021, 5:37pm
3
Can you please point to on how do I do that?
TMachado
(Tiago Machado)
January 19, 2021, 5:47pm
4
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 ?
Andremain
(Andreas Christodoulou)
January 19, 2021, 5:52pm
5
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.
Hello everyone,
My name is Andreas and despite not being a developer, i am desperately trying to get the old Evohome integration to work with Smartthings. I have forked the old integration on github and made an up to date as i can version which (kinda) works.
https://github.com/andremain/EvohomeSmartthingsNew
The integration is broken into 2 parts (for some reason), the app and the dht. I can use the app to generate a device handler, but the only thing i can do using the device hander, is to set the temperature. I know it works as i login to evohome’s app and can see that the thermostat has been set.
While the state is permanently set to heating for some reason and the mode cannot be changed, it is not my priority at this point to fix these.
My primary issue is that the temperature di…
nayelyz
(SmartThings Developer Support)
January 19, 2021, 6:16pm
6
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:
Download the latest release (Releases · SmartThingsCommunity/smartthings-cli · GitHub )
Create a Personal Access Token, preferably selecting all the scopes (Samsung account )
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 )
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
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:
Generate the default configuration using the command:
smartthings presentation:device-config:generate dth-id --dth -j -o=devConfigPres.json
Edit the devConfigPres.json
file. There, you need to leave only the relativeHumidityMeasurement
capability in the Dashboard View.
Create the device configuration with the command:
smartthings presentation:device-config:create -i devConfigPres.json
Add the properties vid
and mnmn
in your DTH definition. Example:
definition (name: "dthName", vid:"xxxx-xxxx-xxxx", mnmn: "SmartThingsCommunity", //...) {
//...
}
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")
Overview
At SmartThings we want to provide tooling to allow developers to get their device integrations working in the SmartThings app. These changes will allow an integrator to move from using custom commands and attributes to custom capabilities.
DTH Migration For Custom Capabilities
In order to follow along with the example set forth in this guide, you will want to have the CLI set up, so make sure that you take this step first.
You can download the CLI here from the releases tab and read more about it in the README .
It is also recommended that you familiarize yourself with the concepts:
Custom Capabilities
Capability Presentations
Walkthrough
We are going to walk through a simple example of updating our Device Type Handler (DTH) so that devices installed with the DTH will be …