Trying to display a Carriage Return inside a Hubitat Dashboard

I guess another question would be are two tiles an option?

Using multiple tiles is possible but it seems wasteful to me. I currently make use of the Tile Master Driver to bring together various weather data. Temperature (in/out) Humidity, pressure, wind, etc. If I had the ability of using a linefeed then I could make a lot of that info more formated just using one tile instead of creating a lot of global variables and and taking up a lot of space with individual tiles. I am looking for a native Hubitat solution but it seems a simple linefeed is preventing that path.

use html and put a <br> in the text ?

1 Like

I want to be able to format a tile that I can specify spacing and lines. It seems I can't control the amount of space between characters, nor controlling lines. The tile appears to be stripping out all formatting and I don't know why. I can store a formatted string, I just can't display it using Habitat's dashboard.

I can do that and I can see it in the variable but as soon as you try to display it on a tile, that format is stripped.

OK - if it's stripped then you could use my MQTT text display driver ?
It doesn't need MQTT so dont worry about that

You will have to write the variable value to the text attribute via forceText() or setText() depending on if you want suffix and prefix included

https://raw.githubusercontent.com/xAPPO/MQTT/beta3/MQTT%20Text%20beta%203e%20(test)

I'll take a look. Thanks.

https://raw.githubusercontent.com/xAPPO/MQTT/beta3/MQTT%20Text%20beta%203e%20(test)

That looks familiar in that I tried your driver in the past and it works in that it properly displays in the driver (as you have displayed), but when I set a Hubitat dashboard tile to display that text attribute, all the formatting, ie. < b r > gets stripped from displaying on the tile.

I guess what I am trying to say is I can put all the formatting I want in a variable/attribute but it's the Hubitat dashboard that's causing the issue.

Oh - let me try that - maybe it's changed...

image

image

It's been awhile so I may be confused so I need to go back. I also exclusively use webCoRE so it also has to be able to work with the driver. I can't remember now. I just thought there maybe there was something I was overlooking.

Give it a try and let me know - you should write your variable to my device using forceText() or setText() command depending on whether you want the optional suffix and prefix tags included.
Updating the text attribute directly may work too

Am I looking at the right place here?

The link is above but yes..

1 Like

Hot Damn! Your the man. It works and I can control it inside webCoRE so this is good enough. I know I tried your driver but if must have been awhile ago and could't update it in webCoRE. Can't remember, but it does the trick now. Thanks much.

1 Like

Great ! You can include any html in there e.g. font size, style or color, and you can do the same in the (optional) prefix and suffix to say append °F to a number. There is the Hubitat enforced length limit to the html though

Maybe I should rename it html display device tile and it would be more obvious what it does and useful to all

2 Likes

I also see that using "prefix" and "suffix" I have two text buckets. Nice!

1 Like

I've been successful using < b r > (and some similar table formatting) within strings saved in driver attributes. Normal driver code and a normal "attribute" dashboard tile. However, that didn't work with hub variables using a "variable string" tile. There must be a difference in the tile templates.

ETA: < b r > (without the added spaces) works when posting here also.

1 Like

New to HE (and not much of a programmer/coder) but added the MQTT Text and am struggling to figure out how to read Hub Variables in the text string. Feel like I'm missing something simple. Looking forward to how this can improve my dashboards!

A bit late to the party on this question, but it's one worth asking (again):
What is the most straightforward way to include carriage returns inside String hub variables such that they get displayed properly on Hubitat Dashboards?

Before posting my currently test workflow, let me stipulate that I'm trying my best to achieve a multi-line output without resorting to 3rd party apps (MQTT, HTML Template, etc.) or other work-arounds.

When I define Local Variables in RM, each containing a String/Char followed by a hard return (ENTER), and concatenating them together...

...Rule Machine has no problem accepting/displaying the result, as expected:

When I then pass (via SetVariable) that exact String value over to a Hub Variable, the <CR>s seem to be preserved just fine:

BUT, looking inside its corresponding Variable Connector, it appears that the <CR>s have been filtered, thus lost:
he_varcon_cr

SO that when I then include the VC into a Dashboard and add it to my layout with an Attribute > Variable template, here's what I see, all on one line:

I know it's possible for dashboard alchemists to work some format-preserving sorcery, but is there no clear(er) in-house path from A to B to C that allows multi-line text displays?