Supertile Label Bug

I checked that out. When I selected the decimal check box it switched to 5.0. I’m still looking for 05 to be displayed.

Things and Variables have implicit conversion as part of the design. The leading zeros in a value for a Thing attribute or a Variable will be ‘dropped’ if the rest of the value can be implicitly converted to a number. If a value is not implicitly convertible to a number, it will stay as the raw string value.

Okay so that makes all sense but that doesn’t solve my problem of trying to find out how to have a 05 displayed.

Can you clarify your broader use case? It looks like you’re trying to display something in a clock style format.

That’s is correct I am building a flip clock Supertile. So displaying 07:09 is going to be a bit of a challenge if I can’t have a leading 0

Can you provide a bit more context? What does the 07:09 indicate?

It would 07:00 → 7:00am.

Since I’m using a 24hr time. I prefer to us the 07 as we referred to it in the military as in 0700 hours (zero seven hundred)

@josh so other than having to resort to using a img to represent the numbers starting with 0. Is there a work around you might know or might this be addressed in a update?

It’s still not clear to me what the use-case is. I understand that 07 indicates the 07:00 hour and this whole thing is in the context of a clock. When I asked for more context, I was trying to get clarification on what the broader use-case is so I could better understand what you’re trying to accomplish to see if there are other approaches I could suggest.

Well I don’t know exactly another use case, I know your trying to understand or find a reason to justify a change. However to me if I select string as my variable type it shouldn’t be converted to a number. It should be whatever I assigned to that variable. I’m not fluent in many programing languages but the ones I am a string is a string regardless of what the content is.

I’m sorry but it’s frustrating to assign a string variable to 0123456789 and it deciding for me that I can not have 0 starting in a string.

To me my understanding of a string is a sequence of characters.

Sorry to hear that you’re feeling frustrated. :grimacing:

I’m just trying to get more details on what you are building. I understand it’s a clock, but what I don’t understand is why or what for? What time does the clock represent? Why are you setting that clock? Why break it out into separate hours and minutes rather than a “hh:mm” format - is that purely presentation or is it part of the actual logic used in a rule or somewhere else?

In other words, can you share more details about what the project is?

My goal here isn’t to determine why or why-not to make a change… I was trying to determine what other approaches I might be able to suggest to help you accomplish your goal.

The main reason why I used a separate hour and minutes variable is for better placement on top of the background. Using something like “02 45” doesn’t allow me to get the font size I’m hoping for and the spacing between the hour and the minutes. The main reason why I’m making the clock is so it fits better within my dashboard theme.

1 Like

I’ve pushed an update to beta to drop the implicit conversion from Text Variables in Super Tiles.

If I understand correctly, it sounds like you’re trying to recreate a ticking clock - are you updating the variables every minute?

It sounds like a feature request to allow custom formats in the ‘Date/Time’ Super Tile item would help you accomplish your goal?

Yes it’s a fully functioning clock it a take off of the old HTC sense flip clock.

And the variable updates? :point_up_2:

Yes, it does. I use a rule. That updates the variables. I can see having a custom date / time option would be helpful.

Thanks for the clarification. Having a native custom date/time format would probably be the ‘best’ solution here and I would suggest casting a vote and perhaps bumping the feature request with a reply.

In lieu of a custom date/time format, using a Custom Tile would likely be the next best option. And for someone with the requisite skills, I would even consider it a better solution - especially if you really want deep control over the customizations.

:bulb: I put together an International Clock Custom Tile that would serve as a good starting point for this. Based on our other discussions in the community, it sounds like you’ve got a pretty good grip on CSS, so I suspect you could tweak things to meet your needs.

Since we don’t have an official ‘loop’ functionality in the Rule Engine as of the time this post was written, I would hazard a guess that you’re using one of the approaches popular in the community to simulate a loop effect. I would note that these approaches are usually fine for short loop sequences, but they are ripe for error over the long-term and are not something we officially support. One of the above solutions would be a much better fit for this type of thing and would be much more efficient.

1 Like

Yes, the loop does have it’s draw backs, however I have it setup also with a time trigger to help reset the clock to help keep it on time. I will look at the custom tile link you provided and see if I can figure it out.

I just pushed this to beta. :slight_smile:

1 Like

I see that our conversation might have inspired you to knock out another feature request. :smiley: