I have tried with several ways to update a virtual temperature sensor
Have created a device with DTH “Temperature Sensor” or “Temperature Measurement Capability” or “simulated Temperature Sensor” - and all of them I could not update.
Not via CLI command and not via MQTT
Switches are working fine, read temperature value from real sensors is also working.
You created a device using another DTH (device type) using the IDE tool.
Then you edited the device and selected the Temperature sensor DTH but the view wasn’t updated in the app.
It could happen that the previous configuration of your device was cached in the app (to reduce the refreshing time, make sure you have enabled the developer mode in the ST app)
Verify your device configuration by getting the device list from the SmartThings API:
A device uses a presentationID also known as VID that defines how the capabilities are displayed.
As the Temperature Sensor is an internal DTH, it uses the presentation SmartThings-smartthings-Temperature_Sensor.
@nayelyz I have tried different DTH - from templates and your listed.
Have added a command for updating
(used sendEvent(name:“temperature”, value: temp, unit: unitString()) for this)
got the right lines in log.
But I must correct my question…
I had an issue before in code - then later have only checked the label at the tile and was waiting for updates. Today have seen that value will be updated in element (see it in events and history) and in second level tile (after open the main tile) - but level will not be changed in main tile - here is all the time a like “checking” (not sure because I have German version with “Wird überprüft…”)
I have now about 8 different virtual temperature elements with different versions of DTH - and only at TWO of them the label will be changed after value updating. On one sensor I see the battery value instead of temperature on second the temperature (without updating battery).
So something is not right with the DTH in the tile section, I think so.
Can you tell me how to build a DTH with an updating temperature (or humidity) value at main tile and an additional battery value in second level? Something I do wrong, I feel it…
Sure, no problem.
For those devices that should show the temperature on the dashboard view (main tile), you need to make sure they send the unit in all the temperature events. This is because, in the dashboard, the value shown is the concatenated values of {{temperature.value}} {{temperature.unit}}. The accepted units are “F”, “C” and “K”.
You can create a custom device presentation to change which capabilities are displayed in each view. If the VID property is not included, capabilities are displayed according to the default presentation assigned to the device.
To start working on this, you should install the SmartThings CLI, in the post below, you’ll find the steps for the installation and the device presentation creation.
As a reference, this post has more details about the Views. The tiles config in the DTH is no longer used.
I’m using as sample the “Xiaomi Temperature Humidity Sensor” DTH - here is no vid included.
Using other DTH without vid it will not work in most cases as described.
I do not see any system here - when it is working and why…
I already have used cli, but because of ready DTH templates I thought it could be used, but many seems to be useless because of such problems.
A main question for me is - how we can give “ready made” custom DTH to normal customers for integration? If I use cli for create individual vid - will it work for other users?
Can you share your DTH, please? I’d like to see its configuration (since you made some modifications to the child-temperature-sensor DTH) and the VID you generated. It can be through a private repository, my Github user is nayelyzarazua-bluetrail
Yes, the generated VID is not available only from your account. If other users install your DTH, it will use that VID without problems.
It’s also DTH related, in that case, you need to create a new DTH with the same config but a different name.
No, the values of “F”, “C”, and “K” are compared in the alternatives of the capability (Key > the current attribute value, is replaced by the text in Value). If you send a different value for the unit, the “checking…” message will show again.
Oh, sorry for the confusion. I just meant that you can make a REST request to the API to get the Device list, for example, using Postman, this would be the request:
I thought about custom capabilities.
Could it be possible to define a label like "{{temperature.value}} {{temperature.unit}} / {{humidity.value}} {{humidity.unit}}"
for combined sensors - if make a combined capability tempHum as sample?
BTW: my DTH are working stable now - seems the °C was final the problem in some codes…
Will mark it as solution if stable until tomorrow THANKS!
No, the label is defined in each capability presentation, if you include the attribute of another capability, it won’t work.
If you want to show two capabilities values in the dashboard, you can use the “group” property in your custom capability presentation. There’s an example in this post:
You’re right, it doesn’t work in the capability presentation label. You can copy the Temperature and Humidity capabilities configuration into a custom capability (each) and add the “group” property. For example: