I can't seem to find enough API information

Anyone know how to pass arguments through an href? is there any additional syntax to allow you to pass variables, text, or set a state when clicked?

I don’t know if this is what you are looking for, but you can trigger action by tapping the icon of the smart app.

def initialize() {
    subscribe(app, myF)
}

def myF(e) {
   // do something
}

Did you figure out how to display an HREF in a smart app? Please share!

There are two types you can display internal and external -

Internal:
href “dynamicPageName”, title:“What the Big Text Says”, description: “What the little text underneath says”

External embedded:
Same as above but with a url in it:
href url:redirectUrl, style:“embedded”, required:false, title:“Web Portal”, description:“Where on the Internet you are sending them”

I just can’t figure out how to pass any internal variables or data - can do it externally but that is silly to send variables to an external source to get them back via a mapping
 And there does not seem to be a way to set a “state” variable at the same time an internal href is clicked


Got it! use ? after page name and the rest is just like cgi

my_process?firstVar=firstVal&secondVar=secondVal

How/where did you find this information?

found it through trial and error!

Yeah, that’s the most popular method.

1 Like

Finding out that I can do an internal href has made my day. I’ve been messing around with storing different states to try and direct the “next” button to the correct page. This makes is so much easier!

Where is this new doc writer? They should just be updating a live doc.

1 Like

Took me 4 days of frustration and about 10 extra pages before I figured it out! Made it so I can do about the same in 2 pages now! Glad it helped you too!

Anyone knows the answer to this one?

I take a TCP Bulb as an input to powerMeter capability

input "power", "capability.powerMeter", title: "Which Power Meters?", multiple: false, required: false

When I call this

energy.currentValue("power")
energy.currentPower

I get “error java.lang.NumberFormatException” in the logs.