Virtual Device to show a numerical value

I am trying to find a way to create a virtual device that will just show a numerical value. I plan to use webcore to change the value based on readings from other devices like an energy monitor.

I can do the webcore but can’t find a virtual device that will allow me to set a numerical value to it.

Any ideas

I use a simulated dimmer. That only has 0-100% so that may not work for you. Another thought is to use a simulated temperature sensor.

1 Like

Yes, I use the simulated temperature sensor and then I can set the value as high as I need. Although I’d hate to be in a room with a temperature of 200 degrees :grin:

Didn’t know you had that. That’s a great way. Thanks.

1 Like

@anon36505037 @tgauchat - Does this work with ActionTiles to show text in a tile (I think no because it’s not a SmartThings defined type?)?

Both the simulated thermostat and the value tiles are both great solutions. Thanks.

What I want to do is have the numerical value displayed as a currency e.g. $2.34.
At the moment the value I am getting is a number with lots of decimal places after it.
So is there a way to change is to a currency value?

Not yet… But it’s a popular Feature Request.

A door type DTH shows in AT as OPENING, OPEN, CLOSING, CLOSED. Maybe one could modify a DTH to use something like that. Might look a little funky, but get by until something else comes along.

I have a garage door DTH that I modified some for my own use. Here is a partial part of it. I would think you could just change the sendEvent values to just about anything. then call the routine from a smartapp or some such. Maybe it wouldn’t work. I haven’t tried it so don’t know for sure.

def open() {
if (state.doorstat == null) {state.doorstat = 0}
log.debug "Door Stat is $state.doorstat"
switch(state.doorstat) {
state.doorstat = 1
sendEvent(name: “door”, value: “opening”)
sendEvent(name: “contact”, value: “opening”)

state.doorstat = 2

log.debug "Open Called"


def close() {
if (state.doorstat == null) {state.doorstat = 2}
log.debug "Door Stat is $state.doorstat"
switch(state.doorstat) {
state.doorstat = 3
sendEvent(name: “door”, value: “closing”)
sendEvent(name: “contact”, value: “closing”)

Ok, I just tried it. AT showed what I put in. So it will work. Like I said, not very elegant, but could get one by.

Robin, could you not take your value tile DTH, add in the door capability which could then be used to show the value in AT. Just a thought.

1 Like

Managed to get a string variable in webcore that includes a currency unit but when this is sent to value tiles it only includes the numerical value not the currency unit.
Any ideas?

Also - how to round to 2 decimal places:
“£” + round(([Electricity Monitor : energy]-energyday)*0.135, 2)

Please add your Votes :+1: to the relevant Topic(s) in the ActionTiles Feedback Forum…

Here’s a couple I found offhand:

We’re open to evolving :slight_smile:. … And that’s why Votes are still accepted and encouraged for “On Hold” Topics (but not on "Declined’ Topics), BTW.

We’ve been generally reluctant to “hack” the consistency of Tile design and Device Type (Capability) paradigm, however, which is why we would hesitate to purposefully put in functionality that would let a Garage Door be used to display … a currency amount.

There’s obvious a “right way” for us to provide Tile Type(s) that can display custom Attributes; we can even put aside the implementation of custom Commands indefinitely, since Attributes alone are valuable. I really have to leave it up to @625alex to absorb the customer feature requests along with their sample use cases and even their implementation ideas, so he can work it into the development cycle in whatever way he feels is efficient and cost effective.

That’s why we do encourage contributory discussion in the Feature Request Topics. It gets our design gears turning.

1 Like

We are aware of this AT limitation and the (vocal, but limited) demand for this feature. There are several things we could try short term, but proper implementation is not straight forward.

I wish ST had Value capability, so that there would be no need to hijack other capabilities.

1 Like

Thanks guys, this works perfectly now using value tiles: