I have pinned it to ST temp/humidity sensor, the new one. As soon as I remove it, it works.
Aeon multi is working…
What are the steps to install this in the mobile app (iOS)?
Under Smart Setup> More> I can’t find it anywhere.
Any help would be greatly appreciated.
PS - it might just save my marriage ; )
I was noticing that the weather info does not get updated unless I go refresh that device tile. What do you think about sending a device refresh to the weather device prior to page render?
Hey Christopher, if it isn’t showing up in ‘MyApps’ on your phone, you probably still need to publish it. Just log in to the IDE on a computer, go to the app, and in the upper right you’ll see a button to publish, just select ‘To Me’ and it should show up!
Ask away, no one will judge you!
If the URL contains the OAuth secret key, it will give you access, yes. It takes a certain degree of trust. The dashboard will have access only to devices you choose. You can always uninstall the app to revoke all access or uncheck certain devices.
Another option is to use the URL without the access token. It will prompt you to login using your ST credentials. I don’t know how the long the session will last though.
@smart
Hm, I can’t figure out what’s causing this error. Are you sure you are using the latest and greatest version of my code?
There is a method to round humidity and temperature to the nearest whole number. Could you confirm that your code actually has this method? If it does, what’s the error message in the log?
Any input that I tried to emulate worked for me (null, “null”, “”, integer, decimal, text).
def roundNumber(num, unit) {
if (num == null || num == "") return "n/a"
if (!"$num".isNumber()) return num
else {
try {
return Math.round("$num".toDouble()) + (unit ?: "")
} catch (e) {return num}
}
}
@vitamincm
I will write a detailed step-by-step tutorial on installing smart apps. I will post it in a couple of hours.
@wackware
I will add the logic to refresh the tile automatically. In time, I will probably remove dependency on the Smart Weather Tile and write my own, more comprehensive one.
Can you post the link to your final code one last time? Will really appreciate that.
The current weather tile allows users to input their weather station of choice from weather underground instead of relying on zip code. For those of us who have our own weather stations uploading to weather underground this means we get really close/accurate data. If you write your own it would be great if you could keep this functionality in there.
Top of this thread. Don’t believe the link is any different:
https://github.com/625alex/SmartThings/blob/master/apps/ActiON-3.0.groovy
Alex got spotlighted! Way to go! http://blog.smartthings.com/news/roundups/meet-smartthings-developer-alex-malikov/
still getting the error…
{“error”:true,“type”:“java.lang.NumberFormatException”,“message”:“An unexpected error occurred.”}
BTW, you may want to get the extra comma out from the end of the line on 287. Some version of IE browser may take it as an extra element in the array.
Also, for some reason my simulator is not working… Can you try this while testing
basically, pass the humidity with the %sign to the roundNumber function.
roundNumber(“40%”, “%”)
For some reason if the ST temp/humidity sensor is sending 40% as humidity rather than just the number 40, do you think the call itself will fail.
Ha, I got the these results, but no errors. Interesting!?
I guess this is back to the drawing board…
roundNumber(“40%”, “%”)
roundNumber(“40.0%”, “%”)
roundNumber(".40", “%”)
roundNumber(".4", “%”)
roundNumber(".4%", “%”)
6db53303-4817-4a48-b94c-17450cd319ae 12:38:55 PM: debug ffff 2.4%
6db53303-4817-4a48-b94c-17450cd319ae 12:38:55 PM: debug ffff 20%
6db53303-4817-4a48-b94c-17450cd319ae 12:38:55 PM: debug ffff 20%
6db53303-4817-4a48-b94c-17450cd319ae 12:38:55 PM: debug ffff 240.0%
6db53303-4817-4a48-b94c-17450cd319ae 12:38:55 PM: debug ffff 140%
This is fair. I will see if it’s possible to augment it instead of overriding…
Disclaimer: I may be way off though…
Some scenarios to test:
Scenario 1:
humidity: humidity?.collect{[type: “humidity”, id: it.id, name: it.displayName, status: roundNumber(‘40%’, “%”)]}?.sort{it.name}
Scenario 2:
humidity: humidity?.collect{[type: “humidity”, id: it.id, name: it.displayName, status: roundNumber(40, “%”)]}?.sort{it.name}
Scenario 3: //Cannot run this in Simulator as it wont allow it
humidity: humidity?.collect{[type: “humidity”, id: it.id, name: it.displayName, status: roundNumber(40%, “%”)]}?.sort{it.name}
I think the humidity is being returned by the device as 40% during runtime (Scenario 3) and is failing meaning it.currentValue is 40% and is not being interpreted as “40%” or 40 or “40”.
humidity: humidity?.collect{[type: “humidity”, id: it.id, name: it.displayName, status: roundNumber(it.currentValue(‘humidity’), “%”)]}?.sort{it.name}
]
Hey, I finally figured it out. I created a new “My App” and pasted in this code. Then I could find the app on my iOS app.
After that it was pretty easy to get everything going.
@vitamincm, @smart and all
I created a repository just for this project.
It contains the most recent code as well as readme file that outlines the installation process. Check it out.
-
Read my edit. Is it possible that the ST device is returning 40% at runtime and not being interpreted as “40”, “40%”, or 40.? I put a log.debug in roundNumber function and it is never shown in the log/console. So, looks like it is not even stepping into the function. I may be totally wild guessing here.
-
Regarding the extra comma at the end on line 287. The stupid older JavaScript parsers on some browsers thought there was an extra element and it caused me a big heartache in one of my projects using ExtJs (JavaScript framework);