It appears that the built-in 'Generic Zigbee Outlet' driver's 'Refresh' command is slightly broken. When invoked from the specific device page, it does write the current state to the log, however, it does not update the 'Last Activity At' value on the device page. I have verified this on multiple device models and multiple specific devices across those models.
ETA: C7, 2.3.9.174 (Though this has been an issue for at least earlier in the 2.3.9... series, if not before.)
The device page will need to be refreshed to load the Latest last activity at data.
I just tested this with an outlet using the generic driver that hadn't been switched off since last year.
Thanks, Mike, but that's not what I'm seeing on my end. I've tried refreshing the page, opening up a new device page, etc, and the activity is still not updated.
Are just refreshing the device. Not actually changing its state.
If the state is not actually changing then there is no activity on the switch.
I'm not sure I would expect to see activity in that scenario.
I’m open to that theory, but there’s one possibility I haven’t yet had a chance to explore. Does your outlet have power reporting and does it update the power along with the status on a refresh?
What I think I saw last night, and again, I want to investigate further, is that a different outlet of mine did update activity, but it also reports power, and I think the power reporting is updating the activity, not the state portion of the refresh. I was using the time stamps of the log, and I want to sit and watch it a little closer before I give that any more or less credence.
Yes, as I said above, of the 6-8 generic driver I have in use, both Zigbee and Z-Wave, this is the only one that behaves in this manner. The rest all update activity with a refresh.
I have reported this issue before, quite a while ago, possibly pigging backing on a different thread where it was brought up.
The Last activity is only updated at a refresh if you have power reporting enabled and the device supports it. For an on/off only device, the event is not being sent to the hub, the driver must be filtering the duplicated switch event out, thus the last activity does not update.
I gave up to the point where I started making my own driver but I just cannot do Zigbee for some reason... would need to spend more time on it using the updated docs we have now.
Its a common issue with older drivers. I consider it a bad habit from things ported over from ST. A lot of those drivers filter out duplicate events and do not post to the hub. Best practice IMO is to only filter out duplicate logs if desired and post all events to the hub. The hub itself will filter duplicates from the event history (but still updates the last activity). Possibly some old iteration of HE or ST did not do this and that is why older code is filtering it out before sending to the hub.
A look at this driver shows that's exactly what it's doing with the switch attribute. If @mike.maxwell doesn't see any problem just doing a sendEvent() and letting the platform handle the filtering, one of us should be able to make this change (and maybe look at similar drivers that might be doing the same thing, maybe switches or dimmers?).
EDIT: This change will appear in 2.4.0 -- only found something like this in a few drivers.