Device without on/off

Hello everyone… I am trying to edit one Device Type I found… At the Thing menu in the app I would like to show my Device line but I do not want to make its state changable… Simply without ON or OFF box:

But I need to keep primary button inside Device:

Is it even possible?

Here is my code:

	tiles (scale: 2){      
		multiAttributeTile(name:"switch", type: "generic", width: 6, height: 4, canChangeIcon: true){
			tileAttribute ("device.switch", key: "PRIMARY_CONTROL") {
				attributeState "on", label:'${name}', action:"switch.off", backgroundColor:"#00a0dc", icon: "st.switches.switch.on", nextState:"turningOff"
				attributeState "off", label:'${name}', action:"switch.on", backgroundColor:"#ffffff", icon: "st.switches.switch.off", nextState:"turningOn"
				attributeState "turningOn", label:'${name}', action:"switch.off", backgroundColor:"#00a0dc", icon: "st.switches.switch.off", nextState:"turningOff"
				attributeState "turningOff", label:'${name}', action:"switch.on", backgroundColor:"#ffffff", icon: "st.switches.switch.on", nextState:"turningOn"
			}
        }

Yep it’s possible…

with the code you have quoted…

You could remove the ‘action: "switch.off’, ’ from the attributeState.

I’m pretty sure this is how I did one once

2 Likes

I usually do that with my custom dth

1 Like

Thanks guys for reply, but it is not working :frowning: When I remove action part, button will disapear… But main button inside device is also inactive and non-clickable… It seems that button in main window and button inside Device are linked together…

Yes you would need to duplicate the tiles, one which has button actions and one without. Then display the one without button actions as the main tile which will display in your things list. This will make your details screen less tidy though, so maybe have a play and see if you think it is worth it…