I am interested in having a SmartApp that displays activity/sensor information about specific devices.
For example,
Temperatures from all sensors
Activity for all window sensors in one page
Can this functionality be achieved by a SmartApp?
Use case example: I have a few ST Multi sensors; and Aeon motion sensors all of which report temperature, and I would like to see the temperatures from all sensors in one single page.
Thanks
SmartApps don’t display data. They just control actions. If you’re looking to see that information outside of the mobile app, you can make a SmartApp to send that data to other services.
I don’t think there is a reasonable way to do what you’re suggesting within the application.
Thanks @Dianoga, I suspected as much but was not certain.
My original thought was that this could be implemented in the preferences page of the SmartApp.
Say, two sections in the preferences, first where you select your sensors, and the second where this
information (activity/sensor info) is displayed. What are the roadblocks to this approach?
Separately, if ST opens up Dashboard Apps, such SmartApps will be great to have IMHO.
Can this be implemented in one single page (either with hardcoded device names instead of having to choose them from a list)?
Any chance you can provide me with some sample code (I am still learning the ropes, and will take me some time to come up with it myself) (I should be able to start with some sample code though).
While I am at this, one more question - can tiles be used inside the preferences page of a SmartApp?
Here is my first draft, two pages in preferences - first page to select sensors, and second page to list all the readings. Any pointers to make the second preferences page prettier?
(Like how can I make text bold/colorful/rich with temperature tiles/icons etc?)
Also, once the temperature sensors are chosen, any way to skip to the second page?
I can’t speak to prettiness, but to skip the first page, you could put some login in there to check if devices have been picked. If so, return the second page instead of the first. I think that would work…
Added the dynamic page handling to skip the first page if sensors are already defined.
Only drawback is I need to uninstall the app and reinstall for any new sensors.
Have a temperature snapshot here, and a battery charge snapshot here.
Anyone knows how to render dynamically generated html content within a section in the preferences?
@Dianoga
I tried the following (based on your code above) under preferences{}, but I am neither seeing the HTML render, nor seeing sections added after the html section:
section ("HERE")
{
def rawHTML = """
<!DOCTYPE html>
<html>
<head>
<title>Connection Test</title>
</head>
<body>
<p>Just a test</p>
</body>
</html>
"""
render contentType: 'text/html', data: rawHTML
}
section("This section is invisible/missing")
{
paragraph "Where is this section!"
}