How to... reproduce this feature

My logs have an oddity I'd like to exploit. When displaying a long list that includes Mode Manager, the upper section which lists the active devices shows 'Mode Manager - Morning' . While the statement it's making is actually wrong (the current mode is Day) how can I append values to my device name dynamically? is that possible?

And curiously, why does it say Morning when it's current value (and in the log entries below it) is Day? Here's a screenshot:
image
and a longer shot which includes the last value change -

@sburke781 heya - beat me to it. Yea. last value of that app is what shows in the past entries below it. No other changes have occurred.

1 Like

I can only assume that was the value (mode) at the time of the logs being captured.... Is it the device or the app?

I'm pretty sure that will be under the control of the app developer, Hubitat dev's in this case.

I'm not really concerned that the value isn't reflective of current as much as 'how' did they do that! might be useful to put device states or app states in the log screen header to simplify review without using dashboard. thinking outloud I guess.

Check out the code for the Hubitat Package Manager app, which appends “Updates Available” to the app name after the nightly check.

1 Like
device.setLabel(String label)
4 Likes

You could be right, it may be useful, but certainly at the moment the dev would need to do it. You could definitely update a device name, with something like a custom command added to a driver, or have the driver update it at key points in the code

Actually, @thebearmay makes me think now you could do it with a separate app.

Pretty much that same command, just substitute a device handler from an associated device.

input "qryDevice", "capability.actuator, capability.switch, capability.motionSensor", title: "Devices of Interest:", multiple: true, required: true, submitOnChange: true
....
qryDevice.each{
   it.setLabel("Some new label")
}
3 Likes

cool!

For devices you also have

device.getName()
device.setName(String name)

Okay - thats just totally awesome ... even supports HTML in the string.... dynamic colors! woot!!!
image

Note that if you're doing this for drivers you expect others to use, consider having an option to disable. I could see where I might find it annoying. :slight_smile: (And if it's used with Alexa or other voice control, even more so because the display name also affects what is used there. The display name is the device label, if present, otherwise the device name.)

As far as I can think of, with built-in code, Hubitat only does this with apps. Apps also have labels, and the idea is the same. The consequences are generally less impactful there, but in either case, there's nothing special about this "extra" text -- it's part of the label, formatted with HTML/CSS to make it look prettier, but not an underlying platform feature. And you've seen how to do it above. Just wanted to point this out for more information, :smiley:

3 Likes

Valuable thoughts Mr. @bertabcd1234.

In my case, I dont let alexa touch specific devices - only groups. (I occassionally have groups of 1) so no interference there. But what IS amazing is my dashboard name html wrappable!
Further - with judicious use of the .hidden value ... so many things are possible!

1 Like

wow. works like a champ !
image

2 Likes