[OBSOLETE] Simple Device Viewer

I opened live logging 20 minutes ago and I’ve already seen it 3 times so that definitely wasn’t the problem…

I haven’t touched this SmartApp in 3 years and I’m constantly in live logging and I’ve never seen it log any errors until recently so I wish I knew what the hell ST changed.

I’m going to add some error handling around that code to see if there’s a pattern between when it works and when it doesn’t. I’ll let you know what I find.

As you can see in the screenshot, this is a platform issue so when the check executes it can either get that attribute for all the devices or none of them.

I can’t do anything to prevent that from happening and ignoring it for each device isn’t an option because it will throw it about 9 times before triggering my abort feature and throwing that many exceptions is probably worse than letting it completely crash like it is now.

The abort feature is something I built-in a long time ago when ST performance degraded and it makes it stop checking after 10 seconds to avoid exceeding the ST execution time limit and pick back up where it left off the next time it executes.

I’ve modified the code to catch the error and trigger the abort feature immediately which is the best workaround I can think of.

I’m not sure if that change is going to make the notification feature better or worse so I’m going to have to watch it for a while before releasing the new version.

If you’re interested in testing it let me know and I’ll PM you the code.

1 Like

I had suspected that it was related to a timeout on Smartthings (platform/cloud) side. Thanks for looking into it; I actually use webCore for notifications and use the Simple Device Viewer primarily for it’s lightweight dashboard and as such I’m not too bothered by this issue other than the shiny red error in live logging :wink:

If you don’t care about the last activity time shown in the app and you’re not using the notification feature then there’s no need to have it execute that code every 5 minutes.

You can easily disable that schedule by changing line 1283 to the following and then open the SmartApp in the mobile app and save.

// initialize()

@krlaframboise this is a fantastic SmartApp for an ST newbie like me. Thank you!

Whilst I love the web dashboard, I’m a little concerned that anybody can control my devices. Other than the URL obfuscation, can it be secured even more? Password authentication would be great.

When I try to open SDV, I get a spinning circle for a bit and then a screen with “Something’s Wrong / We can’t load your screen right now” with a “Retry” button (Android, classic app). This started 2 nights ago right after I added some about 6 more devices into SDV (89 total). No matter how many times I hit “Retry”, it won’t load. Nothing at all shows up in Live Logging in the IDE.

What’s interesting is that the web dashboard continues to work just fine (including control; e.g., turning lights on and off).

Without any logs I’m not sure I can do anything but delete and re-add the smart app.

I am working through a series of tutorials that will show how to create a simple device viewer in glitch that does not require any groovy smartapps to be installed. First episode is here:

Feel free to remix and expand on this for the future versions of SDV

1 Like

Put // in front of line 125 and let me know if that lets the application open.

Yes, it opens now.

If I select “All Devices - States”, I do get the same error.

That was just a workaround so you could get into it and delete it or change settings that might fix it.

In the “Choose Devices” screen, make sure each device is only selected once.

In the “Display Settings”, select only the capabilities you really need.

I had a number of duplicate devices (e.g., temp and humidity from the same sensor, or selecting all my devices with batteries while also selecting them for other capabilities), because the help text said “Duplicates are automatically removed so selecting a device more than once won’t hurt anything”.

The sentence before that said “you only need to select each device once” and that other part was just so that users didn’t have to double check to make sure that they didn’t accidentally select a device more than once, but I’ll remove it the next time I release an update.

Originally it didn’t cause problems, but I think ST changed their timeout thresholds after I wrote it and now if someone has a bunch of devices and a lot of them are selected multiple times then it will cause problems.

You should make sure each device is only selected once and except for lights, it doesn’t matter which list you select them from. Devices with the switch capability only appear as lights if they’re selected from the lights list.

I did take the “only need to select each device once” and “duplicated are automatically removed” to mean I didn’t have to double check each selection. But I’ll be more careful.

While in the dashboard, I noticed an odd thing in the Batteries display. The one device under 25% has no image at all, with the CSS class being “null-battery”.
image
I have the low battery notification threshold set to “10”, because I have some Quirky Trippers that report 16% for a long time, and don’t want alerts for those. Looking at the code, I found that getBatteryImage() uses that threshold to return the “low-battery” image, and then has a case statement to compute the other images. The case doesn’t set a value when the battery is below 25, and ends up with a null. Adding a default to the case fixed it for me:

        default:
        	status = "low"
            break
1 Like

That bug has been there for almost 4 years and you’re the first one to mention it, LOL.

Thanks for pointing it out, I’ll most likely be posting a new version at some point in the near future to optimize some things so it will include a fix for that.

5 Likes

Hello,
This is a great app and thank you for making the code available to the community.

I have a wave device (water valve) which periodically goes silent. The workaround is to manually restart the device via a Z-wave repeater/on-off plug.

Do you know of a way I could automate this process. If device goes off line, then power off device, wait a minute then power back on.

Would also have to figure out the timing to avoid a power off and on triggering another on-off cycle. Maybe if device is unresponsive (after an hour) then try again?

You’re probably better off setting up a nightly automation that closes it and opens it a few minutes later.

I’ve seen a lot of users report that problem with the water cop shutoff valve and it sounds like opening and closing it nightly has been a reliable solution for them.

1 Like

Thank you… I will be looking at this option as well!

Hello,

I installed this via the instructions on installing custom code. It shows up on the website in Smart Apps, however I am not seeing it in the App on my phone under Smart Apps. Am I missing a step?

Thanks in advance.

Try the Classic app.

Did you publish it to you?