Activity Viewer

I've been looking for something similar to SmartThing's Activity Feed. It's helpful for debugging event order across multiple devices and just checking up on things too. I originally tried to use the events method which was always returning empty but found out eventsBetween is returning data and working for the most part! There are some attributes like displayText that aren't working, but enough for me to work with.

I started with a simple table sorting in reverse chronological order. There's a javascript library that adds in filtering by column. I hard coded in some ignored events, for now this can be modified on line 46.

I decided to add something a little more visual too since I don't have my Granfana installation moved over from ST yet. The events from the last 24 hours are enough to give me an indication of what's going on.

There's no special installation steps, just copy over the code and create a new instance of the app.

Currently this isn't very mobile friendly. The table really chokes my Chrome browser on mobile and the timeline probably won't display well either. I'm looking to add a more mobile friendly layout soon.

The code is available here

12 Likes

This is a great idea. I loaded the code and, though the Apps -> local activity Viewer Links, I can see the Activity and Timeline. I can’t through the Remote Activity View Links. When I click on the cloud Remote Activity Viewer Links, I get the message: “Internal server error”

I’m not sure what’s going on with the remote links. The URLs seem to be formatted correctly and I can’t find any apparent code issues. I’ll have to check into it more.

I played with it a little more and it looks like the url is being formed correctly (as compared to my SmartTiles cloud.hubitat.com access).

I get the same error. And I don’t get the activity view, just a blank screen. The log works ok though.

I see internal error from time to time for smarttiles but a hub reboot will usually fix it.

This is the exact app I am looking for - something to see when events happen in an easy to read format. Any update on this app? I installed it, saved it, and oath the app but don't see it working? Wondering if anyone else has taken this on or developed something similar, since I know this was a ways back? Thanks!

great stuff! Thanks. Very nice to see when lights are on/off or windows open/closed visually over the past 24 hours

This works well but the remote links give errors: “{"error":true,"type":"AppException","message":"Not Found"}”

Anyone else get it to work? Would be nice to be able to see activity while off the network and without VPN access.

No, I have not gotten it to work yet either. I don't think the external link work correctly.

1 Like

I opened a pull request with a tiny change to allow you to optionally set the name of the app (since I added 3 of them)

I just realized that I can't select virtual switches as actuators. Why is that? The code is just using capabilty.actuator, and I would have assumed it would include virtual switches as well as regular switches.

    section ("Choose Devices") {
        input "actuators", "capability.actuator",
            title: "Which Actuators?",
            multiple: true,
            hideWhenEmpty: false,
            required: false

True

Screen Shot 2021-02-13 at 7.15.02 PM

Hubitat's Virtual drivers are neither Actuators nor Sensors.

1 Like

Should they be? (or is there any reason for them not to be?)

Meanwhile, I changed my live copy of the code to use capability.switch so that I could select the virtual switches I wanted.

I think the fact they are Virtual opens an argument for either way being correct. I'm guessing, but the reasons for is probably balanced by the reasons against.

Well, I asked as a feature request: Virtual switches do not have capability.actuator

1 Like

I just realized this is the same reason my HubConnect devices don't show up in either selector (the other selector is sensors via capability.sensor).

E.g., this is a motion sensor I'm pulling over from SmartThings. Couldn't the HubConnect Motion Sensor include capability.sensor? (Well, I edited mine and now it does, so it shows up in the selector).

image

I was wondering why the timeline included about 29 hours of output always. I realized this code in buildActivityMap was computing the start point as today's time but in UTC, which basically adds my current timezone offset into the calculation (I'm in EST, so it adds 5 hours).

def today = new Date()
def then = timeToday(today.format("HH:mm"), TimeZone.getTimeZone('UTC')) - 1
log.debug "then " + then
log.debug "today " + today

and I got:

2021-03-01 01:25:37.650 pm [debug] today Mon Mar 01 13:25:37 EST 2021
2021-03-01 01:25:37.647 pm [debug] then Sun Feb 28 08:25:00 EST 2021

I changed the code to

def today = new Date()
def then = today - 1

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.

Download the Hubitat app