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.
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.
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.