SmartSense Multi + Graph


(Jesse S) #1

I was putzing around in the developer environment this morning and saw a device type that caught my eye – “SmartSense Multi + Graph.” This immediately got my attention since I’m currently using GroveStream to log and graph various activity, but would love something directly built into the ST environment.

After looking through the device code, it seems the graphing capabilities are rooted in a tile definition called chartTile() … But last I checked, this definitely isn’t in the official documentation…! In fact, to quote the documentation, it says “There are three types of tiles that you can use within your device handler.” For reference, I think there are actually four listed in the documentation: standardTile(), controlTile(), valueTile(), and carouselTile(). Definitely no chartTile() though.

I installed the device from the “Developer -> My Devices -> + New Device” menu just to see what it looked like, but couldn’t find a way to get data from actual devices. :confused:

Anyone have any experience or insights on this? A native graphing capability to view various data types would be pretty slick…


(Patrick Stuart [@pstuart]) #2

Lol, asked same question a year ago. It only worked on iOS. Was told something better was coming.

Guess we wait.


(Jesse S) #3

Dang. Thought I did a thorough search through the forums, but must’ve missed your post. Oh well…


(Patrick Stuart [@pstuart]) #4

No problems. A lot has been promised, very little delivered… Yet. There are some great 3rd party logging apps out there that can work with 3rd party clients.

The limit here at ST is data is only available for last 7 days. So you are limited to what can be stored as well. 3rd party logging has no such limits.


(Jesse S) #5

Definitely – in the category of great 3rd party development, GroveStreams is up there.

As a work-around, it’d be nice to have a device type that simply displayed a web page. By pointing the URL to a 3rd party dashboard, then clicking on the item in the Things menu, you could pull up whatever data was logged/stored/displayed in the dash. I started playing with the Dropcam device type to see if I could point a carouselTile() to an external URL – just a jpg as a stepping stone to a full dashboard – but didn’t have any luck.

I did see in the documentation that SmartApps can point preference pages to external URLs, but this implementation of a dash requires significant navigation to get to the interesting data. Besides, it wouldn’t be listed as Thing…

Custom icon backgrounds is another possibility I explored, but I don’t see how to get these dynamically updated…


(Patrick Stuart [@pstuart]) #6

Yeah, only way to bring in html into ST right now is in SmartApps in the setup area.

If it’s just an image you want to bring in the the imageTile will work.

Maybe someday we’ll get native html tile but I’m not holding my breath. hub v2 needs to get out first.


(Geko) #7

You can’t display a web page in a device, but you can display an image, so you could technically display a chart using a 3rd party web app that can render charts from a dataset. See this example:


(Jesse S) #8

Okay, so I decided to just bite the bullet and write the simplest possible SmartApp that gets me to my GroveStreams Dash. Pics and code are below. Basically, it shows up in Convenience and when you hit the gear icon it brings up a preferences page that links you to the URL hardcoded in the page settings. Yes. Very, very, sloppy. BUT it works. It’s easy to just change a few strings of text and it’ll also get you to any other URL you like (Calendar, Weather, or whatever Dash’s you already have set up).



/**

  • SmartDash
  • Copyright 2015 Jesse Silverberg
  • Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except
  • in compliance with the License. You may obtain a copy of the License at:
  •  http://www.apache.org/licenses/LICENSE-2.0
    
  • Unless required by applicable law or agreed to in writing, software distributed under the License is distributed
  • on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License
  • for the specific language governing permissions and limitations under the License.

*/
definition(
name: “SmartDash”,
namespace: “JLS”,
author: “Jesse Silverberg”,
description: “Load a URL to display logged data from GroveStreams.”,
category: “Convenience”,
iconUrl: “https://www.dropbox.com/s/yul96h22z8i9q4l/logo.gif?raw=1”,
iconX2Url: “https://www.dropbox.com/s/yul96h22z8i9q4l/logo.gif?raw=1”,
iconX3Url: “https://www.dropbox.com/s/yul96h22z8i9q4l/logo.gif?raw=1”)

preferences {
section(“Dash”) {
href(name: “hrefNotRequired”,
title: “GroveStreams”,
required: false,
style: “external”,
url: “http://URL_to_GroveStreamsDash_with_API_keys”,
description: “Tap to view GroveStreams data logs”)
}

}

def installed() {
log.debug “Installed with settings: ${settings}”

initialize()

}

def updated() {
log.debug “Updated with settings: ${settings}”

unsubscribe()
initialize()

}

def initialize() {
}


(Jesse S) #9

@geko – Yes, embedding an external (web-based) image within a SmartApp was exactly what I was trying to do. Looks like Col Hack didn’t leave any code behind to learn from. Do you have any snippets that could help get this running?