SmartThings Community

[RELEASE] Simple Device Viewer

smartapp_alerts
wellness_check
smartapp_hvac
project_dashboard

(Kevin) #176

[RELEASE] Simple Device Viewer v2.0

New Features

  • Dashboard that allows you to see all the capability screens from any web browser. If you decide you want to use this feature, you need to enable OAuth in the App Settings.

  • New exclude list for each capability allows you to show a device on one screen and hide it from another. These settings are located in the “Display Settings” section.

  • The image location can be changed to a forked repository allowing you to use different icons. This setting is located in the “Other Settings” section.

  • The setting that allows you to choose which capabilities to show in the menu has been moved to the “Display Settings” section and it’s been reset to display all capabilities.

New Installtion Warning

When installing the SmartApp for the first time from the Marketplace, click “Done” when you get to the screen that says “Choose Devices” and then exit the Marketplace. You can then open it from the usual SmartApp location and configure everything.

This isn’t required, but it ensures you don’t spend a lot of time configuring everything and then lose all your changes because you accidentally tapped the back button and cancelled the installation.

Dashboard Feature

The dashboard allows you to view all your devices by capability the same way as the SmartApp, but it’s accessible from any web browser.

The Lights, Switches, and Alarms screens are interactive and allow you to toggle the state of those devices.

I made the Alarms screen interactive because if your siren is going off and the SmartApp is down, this might provide another way for you to turn them off.

The Switches and Lights screens have an option for “turn all on” and “turn all off”, but this feature may time out if you have a lot of devices.

Enabling the Dashboard

To use this feature you need to open the SmartApp from the “My SmartApps” screen in the IDE, click the “App Settings” button, and enable OAuth.

Once OAuth is enabled and you’ve selected at least one device from the “Choose Devices” section, you can enable the Dashboard by tapping the “Enable Dashboard” button on the main page.

Finding the Dashboard URL

The dashboard url gets written to Live Logging when you enable the dashboard and every time you open the “Dashboard Settings” screen.

You can also use the “View Dashboard” button on the main screen to open the dashboard and copy the url from the textbox at the bottom of the screen.

Don’t give this url out or show it in any screenshots you post to the forum because others can use it to view your dashboard. If you’re concerned that your URL has been compromised, you can go into the “Dashboard Settings”, disable the dashboard, and then enable it again.

If you want to have this dashboard and the IDE open at the same time, you need to use 2 different browsers. If you’re using Chrome, it might work in one browser if you’re in incognito mode.

Dashboard Settings

Dashboard Refresh Interval: When you have the dashboard open, this field determines how often the page should automatically refresh. It’s default value is 300 (5 minutes).

Default View: Determines which page should be displayed when you open it using the “View Dashboard” button in the SmartApp.

Menu Position: This determines if all the pages should display the menu above or below the device list.

Enter CSS rules that should be appended to the dashboard’s CSS file: This allows you to customize the look of the dashboard. For example, if you want a specific device to have a light blue background, you could make that happen by entering something like the following into this field.

.device-id-abcdefgh-1234-5555-asdf-aa2323sdsdsd{background-color:aliceblue;}

Disable Dashboard: This feature revokes the access token so that the dashboard url will no longer work. Re-enabling it will generate a new url for the dashbaord so if you have shortcuts setup for the dashboard, you’ll have to update them.


(Never Trust @bamarayne) #177

What a time to be alive!

I can view my IOT battery statuses from a real computer.

Thank You.


(Allen Crawford) #178

Whatever the standard/default one is, nothing custom.


(Kevin) #179

I don’t have the device so I have no way of knowing what it defaults to or if it’s zwave or zigbee.

Can you open the device through the IDE and let me know what it says in the “Device Type” field?


(Rick S) #180

Hey Kevin,

Great work, love it

Question, what is the Events page telling me? It shows and Event for x days for 2 different devices.

1 is a window sensor which we do leave open for long periods at a time
The other is a water sensor by the washing machine. It’s dry, battery at 100% and temp at 80

Thanks in advance
Rick


(Rick S) #181

OK, just found it was showing as an Event due to the Threshold Setting with a default of 7 days. Maybe I get that for the window if it’s been left open longer than the setting, but the water sensor? It’s been dry for longer than 7 days so that’s an event?

Rick


(Never Trust @bamarayne) #182

I use events and polling to make sure I don’t have any devices drop off the network.

For example I have a very quiet contact sensor on a liquor cabinet, I open it ever 15 days or so to wake it up - not sure if it responds to polling or not - for example. Anything that goes beyond 20 days, I check out and revive if necessary.

With over 100 devices, need some way to keep track of them all and make sure they are and remain healthy and alive.

Same thing with batteries, I sort them by % left. Although there are some that are at 100% then die as the battery monitoring in the devices are not always perfect.


(Rick S) #183

Lights/Contact sensors… I get, a water detection sensor? How do I refresh it, splash some water on it? LOL NOT

Rick


(Never Trust @bamarayne) #184

Use polling for the most part, mine are ST branded and they also have temperature sensors - so they must report in on some interval.

I have my polling set to 8640 minutes, the max as I don’t want to kill my batteries. Then I have my event threshold set to 20 days. I have battery set to 25% for example.

Not sure if this is ideal, but it’s working for me so far.


(Rick S) #185

Well, both listed on the Events page report battery and temp, so now I’m stumped

Rick


(Never Trust @bamarayne) #186

Take out the battery for 15 min, put it back in. See how it behaves in 20 days with polling enabled.


(Rick S) #187

Kevin, is this really necessary? We saw issues of the URL being shown before it was noticed by CoRE users when it was being written to the IDE log as well so Adrian took it out. In fact I was one of them :frowning:

Maybe I am missing the use case for it to be written to the log

Thanks again
Rick


(Kevin) #188

A lot of devices only report whether or not the battery is low which is why they display 100% then drop to 1% and stop working shortly after.


(Kevin) #189

The purpose of the event is basically just to ensure that it hasn’t dropped offline. Most battery operated zwave devices sleep and then wake up about every 4 hours, but whether or not the SmartApp can detect that is based on how the DTH was written.

You can add 2 lines of code to the DTH of any device that sleeps and it should check in a few days a day without effecting the battery life.

This line goes below the last capability line near the top:

attribute "lastPoll", "number"

and this line goes right below the line def parse() {

sendEvent(name: "lastPoll",value: new Date().time, isStateChange: true, displayed: false)

If the device doesn’t sleep and doesn’t support the Polling capability, getting it to report is a little bit more involved, but not difficult.

Disclaimer: Any modifications you make to a default DTH will prevent it from running locally, but unless you’re only using Smart Lighting and possibly SHM, it’s not going to run locally anyways.

You can’t open the mobile app from a regular computer so without writing it to live logging, there’s no easy way to copy and paste the url.

It only writes it to the log when you open the dashboard settings screen which is something I doubt you will have to do often. You can also prevent it from showing in the logs by going into the Other Settings and disabling debug logging.

I was also one of the people that complained about that in CoRE, but that’s because it displayed it every time I opened a piston making it really easy to accidentally display it when posting log information.


(Kevin) #190

If the water sensor is monitoring something important, I recommend splashing water on it every once in a while because that’s the only way to know for sure that it’s still working properly.


(Never Trust @bamarayne) #191

Should automate that.


(Kevin) #192

FYI, CoRE still displays the url in live logging every time you open it or get brought back to that page after closing a piston or settings screen.


(Rick S) #193

Interesting Kevin, I don’t see it in my IDE log even with debug enabled, maybe it’s another setting that I am not familiar with

Rick


(Allen Crawford) #194

Sorry, I don’t know much about the default device types either and assumed there were standards or something that made it easier. In the IDE if I click “My Devices” and then my outlet, the resulting screen doesn’t have a “Device Type” field. There is one that just says “Type” but the value is simply “SmartPower Outlet”.

It is definitely a ZigBee device, however.


(John) #195

Thank you, @krlaframboise. The new dashboard is really nice!

I’m using this custom CSS to fix the menu bar on the top of the screen. This works well for up to three rows of buttons on the menu bar. (If you only have 2 rows, you can reduce the section margin-top to 150px).

header{position:fixed;top:0;height:20px;z-index:1;}
nav.top{position:fixed;top:22px;width:100%;z-index:1;background-color:#808080;}
section{margin-top:220px;}
.menu-item{width:62px;font-weight:normal;}