Past Logs vs Device Events

When I use the Devices Menu for a particular device and the select the EVENTS button for that device I can see several days of events for that one device.

If I use Past Logs to view that same device, I only see events from today.

If I use Past Logs ALL [Devices] I see events for all devices but only going back a few hours.

What am I doing wrong?

I want to see all events for all devices that happened yesterday at 3:00. Is there a way to do this?

Not a thing. Believe it or not this is how it works. I don't remember the number but there is a size limit for the Logs from the menu and when that limit is reached it dumps the older records to make room for more.

I've seen, like you, that we can get more history from the Devices detail page. Someone with more knowledge on the internals will have to take it from here.

1 Like

What you see (and what LosinIt wrote above) is correct: "Events" and logs/past logs are different. Logs, for one, are not automatically generated; an app or driver must specifically call for something to be logged. Most drivers (devices) do this for events that they generate, like a motion sensor becoming active or inactive or a switch turning off or on. However, this is up to the driver author; it's not an inherent feature of the platform. Most stock Hubitat drivers have debug logging (lots more information that you you need but may be useful for troubleshooting) enabled for the first 30 minutes after installing the device or enabling this setting; most also have "info/description text logging" enabled, indefinitely, by default, with these log entries being ones tied to events from the device. Well written (IMHO) community drivers normally do the same. Apps aren't quite as standardized here, but most have configurable logging options. But theoretically, anything is possible. :slight_smile:

The "Events" history is a platform thing. If a device (or app, but this is rarer with apps) generates an event, you'll see it here. No event, no entry; no entry, no event (or it's been long enough that it's disappeared from the history).

There are limits for both. "Past Logs" get pruned to 256 KB, but I'm not sure on the schedule (either as it happens or nightly maintenance, I'd guess). The "Event" history is pruned to 1000 entries per attribute per device as part of nightly maintenance (so for a dimmer device, this would be the past 1000 switch on/off events, the past 1000 level events, and so on).

4 Likes

Haven't we been told it is per event PAIR, so that in the case of the switch attribute the limit would be 1000 on events AND 1000 off events?

1 Like

My understanding, and anecdotal data, suggests 1000 event per attribute, per device as @bertabcd1234 mentioned. I have devices with two attributes and they typically have about 2000 events. They get pruned at night, so the best time to check is early in the morning.

1 Like

Thank you everyone for the information. Has anyone written software to extract event history from each device and aggregate it into a chronological log?
I believe all the event data I am looking for regarding 3PM yesterday is still there but, if I understand correctly, I would have to manually extract it from each device's event history in order to assemble a complete picture of what happened at 3PM yesterday. Please correct me if this assumption is wrong.

That's more or less correct, or at least there's nothing built in to the hub to do that. HubiGraphs is an example of a custom app that reads past device event data and puts it into an easily viewable format. Some people also do something similar with Grafana plus a database backend, but all I'm aware of rely on real-time device event subscriptions, meaning you couldn't retroactively do it for device history with those solutions. I do something like this myself with Home Assistant, which has simple history graphs built in (not really its intended purpose--it's a full-fledged automation system similar in theory to Hubitat, but this is one of a few things I liked about it when I tried it and couldn't quite let go of). I've also seen various other solutions for logging data out to other sources, but I think all are similar in that they don't dig into the past as written.

If you're up on Hubitat app development, you could write a custom app that could do something like HubiGraphs--basically, select devices and read their event history, doing with it as you see fit. Otherwise, manually looking at the history for devices of concern might be easier. :slight_smile:

2 Likes

What I'm referring to are statements like these (I've seen more recent ones but can't find them right now):

Yup, I recall that same thread... However, a few posts later, Mike corrects himself...

I should have kept reading :stuck_out_tongue: I do also remember similar threads saying the same as his first statement though, much more recent ones. It would explain some of the more insane number of events in temperature devices I've seen if his first statement was true. I really hope it isn't.