How can I get text on two lines in a tile?

I tried the following
standardTile(“batteryReset”, “device.batteryStatus”, inactiveLabel: false, decoration: “flat”) {
state “default”, label: ‘Battery\nReset’, action: “batteryReset”
}

And I get this

standardTile(“batteryReset”, “device.batteryStatus”, inactiveLabel: false, decoration: “flat”) {
state “default”, label: ‘Battery Reset’, action: “batteryReset”
}
Looks like this

“/n” ?, does that work?

Well, ummm… sort of…did you see my screen shot ? :smile:

Is this screenshot immediately after updating? Did you go back out and back in and double check it? I’ve noticed when I make ui type changes it doesn’t look right until I exit that device and go back in

No, exited app entirely and made sure it was closed. Launched and navigated into the page.
If I can find a reset icon I could just use that :smile:
But would still like to know how to write the text on two lines.

Try putting it in double quotes instead of single

:wink: @Ron

If that didn’t work try this… Hehehe!

http://www.w3schools.com/tags/tag_br.asp

@Ron, try this:

standardTile("batteryReset", "device.batteryStatus", inactiveLabel: false, decoration: "flat") { state "default", label:"Battery\nReset", action:"batteryReset" }

or just for fun:

standardTile("batteryReset", "device.batteryStatus", inactiveLabel: false, decoration: "flat") { state "default", label:'Battery\nReset', action:"batteryReset", icon:"st.secondary.refresh-icon" }

nope, sorry missed it in there…

I don’t see what you changed.

Nope, same result

Nope, you get a really tiny (quotes added for this post so it doesn’t break line :smile:
Battery’
'Reset

What the hell, man! :wink: /n/r

And darn! We are all in IT! :slight_smile:

1 Like

No, can we stop guessing now :slight_smile: (killed my battery on my phone trying these)

I can use the refresh icon and just say “Battery” but I already have a “refresh” which acquires current status and I don’t want to have the same icon twice, too confusing.

Yes, but SmartThings takes a very special class of IT. You must work with zero documentation and nothing should EVER work as you might expect.

Figured it out! You are on Android! :slight_smile: It works on IOS!

Of course it works on IOS !

Yes Android

2 Likes

@smart @Ron, chalk up another Andriod/iOS different with ST. I’m on Android as well.

Sorry @Ron I couldn’t help. I’ll look through more of my code to see if I can find an example.

1 Like

I copied and pasted your code and dropped it in the device type I’m working on now and here’s how it looks for me (on a galaxy s5)

Crazy, HTC One M7 Android 5.0.2
Some kind of phone specific issue ?

I notice yours still pushes the text to the bottom when you have newline.

anybody got an icon of a battery :smile:

Maybe try without the decoration:flat?

Here’s another device with it centered:

//Timer & Output (No Parent Element)
	valueTile("output", "device.output_percent") {
        state "default", label:'Output %\n ${currentValue}'
    }
    valueTile("timer", "device.timercurr") {
        state "default", label:'Timer\n ${currentValue}'
    }

@Ron, Try one more thing? I’m sure this is the code you need:

valueTile("batteryReset", "device.batteryStatus", inactiveLabel: false, decoration: "flat") { state "default", label: 'Battery\nReset', action: "batteryReset" }

Looks like this: (different text I tested with)

Without decoration: “flat” :