Tile not showing

I wrote a custom Thermostat device handler, How come the battery tile does not display?

metadata {
	definition (name: "Fitzstat New", namespace: "smartthings", author: "SmartThings", mnmn: "SmartThings", vid: "generic-thermostat-1") {
		capability "Actuator"
		capability "Temperature Measurement"
		capability "Thermostat"
		capability "Thermostat Mode"
		capability "Thermostat Fan Mode"
		capability "Thermostat Cooling Setpoint"
		capability "Thermostat Heating Setpoint"
		capability "Thermostat Operating State"
		capability "Configuration"
		capability "Battery"
		capability "Power Source"
		capability "Health Check"
		capability "Refresh"
		capability "Sensor"
        capability "Relative Humidity Measurement"
		capability "Configuration"

		fingerprint profileId: "0104", inClusters: "0000,0001,0003,0004,0005,0020,0201,0202,0204,0B05", outClusters: "000A, 0019", manufacturer: "LUX", model: "KONOZ", deviceJoinName: "LUX Thermostat" //LUX KONOz Thermostat
		fingerprint profileId: "0104", inClusters: "0000,0003,0020,0201,0202,0405", outClusters: "0019, 0402", manufacturer: "Umbrela", model: "Thermostat", deviceJoinName: "Umbrela Thermostat" //Umbrela UTee
		fingerprint manufacturer: "Danfoss", model: "eTRV0100", deviceJoinName: "Danfoss Thermostat", vid: "SmartThings-smartthings-Danfoss_Ally_Radiator_Thermostat" //Danfoss Ally Radiator thermostat, Raw Description	01 0104 0301 01 08 0000 0001 0003 000A 0020 0201 0204 0B05 02 0000 0019
		fingerprint manufacturer: "D5X84YU", model: "eT093WRO", deviceJoinName: "POPP Thermostat", vid: "SmartThings-smartthings-Danfoss_Ally_Radiator_Thermostat" //POPP Smart Thermostat POPE701721, Raw Description	01 0104 0301 01 08 0000 0001 0003 000A 0020 0201 0204 0B05 02 0000 0019

	tiles(scale: 2) {
		multiAttributeTile(name:"thermostatMulti", type:"thermostat", width:6, height:4, canChangeIcon: true) {
			tileAttribute("device.temperature", key: "PRIMARY_CONTROL") {
				attributeState("temperature", label:'${currentValue}°', icon: "st.alarm.temperature.normal",
					backgroundColors: [
						// Celsius
						[value: 0, color: "#153591"],
						[value: 7, color: "#1e9cbb"],
						[value: 15, color: "#90d2a7"],
						[value: 23, color: "#44b621"],
						[value: 28, color: "#f1d801"],
						[value: 35, color: "#d04e00"],
						[value: 37, color: "#bc2323"],
						// Fahrenheit
						[value: 40, color: "#153591"],
						[value: 44, color: "#1e9cbb"],
						[value: 69, color: "#90d2a7"],
						[value: 68, color: "#44b621"],
						[value: 84, color: "#f1d801"],
						[value: 95, color: "#d04e00"],
						[value: 96, color: "#bc2323"]
            tileAttribute("device.battery", key: "SECONDARY_CONTROL") {
				attributeState("battery", label:'${currentValue}%', unit:"%", defaultState: true)
            tileAttribute("device.humidity", key: "SECONDARY_CONTROL") {
				attributeState("humidity", label:'${currentValue}%', unit:"%", defaultState: true)

			tileAttribute("device.thermostatOperatingState", key: "OPERATING_STATE") {
				attributeState("idle", backgroundColor: "#cccccc")
				attributeState("heating", backgroundColor: "#E86D13")
				attributeState("cooling", backgroundColor: "#00A0DC")
                attributeState("auto", backgroundColor: "#00A0DC")

Hi, @RyanFitz!
It’s great having you back here in the SmartThings Community :smiley:

It is because the “vid” you’re using (generic-thermostat-1) doesn’t include “battery”; this value defines which capabilities will be displayed in the app, it doesn’t matter if you included other capabilities, they will be usable only in the background but never shown.
What you can do is avoid using any VID so one is generated automatically. (remove the properties vid and mnmn from the metadata)

Note: Remember you need to create a new DTH because its configuration is cached once you install a device using it. This way, it will take the latest metadata you defined.
You can only copy the whole DTH > paste it > change the name to avoid any conflicts > comment the fingerprints in the original one to avoid the device being paired to it

Other things to consider:

  1. Remember that DTH (Groovy-based device handlers) are part of the legacy platform (take a look at this announcement).
  2. Avoid using deprecated capabilities like “thermostat”, it was divided into separate capabilities (the ones below it in your DTH).

Thanks that worked and I got my custom capability working, that cache is ridiculous tho, had to delete and re-create my device handle everytime I changed something!!!

1 Like

It is mostly for changes in the device presentation. For example, if you changed the VID because you added more capabilities to it.
If you change the code in the functions and self-publish it again, it should be using the new code there.