Get Client Activity Level

Using the function system.util.getSessionInfo() gives me info about currently logged in clients. This is great but i want to see the activity value from an HMI like it shows in the gateway (Active or Dormant).

How can i get that value? I can’t find a function in the docs or the API at the moment.
Anyone know where i can find a function to return the activity level?

Closest thing I see is https://docs.inductiveautomation.com/display/DOC80/system.util.getInactivitySeconds

If you know how many seconds before something becomes dormant you could use that value, but I don’t know what value Ignition uses to say that a client is ‘dormant’.

This is a client scope script. I need someone to view this from a client about all clients.

Create a database table or dataset tag called something like “userInactivity”.

Create a gateway timer script that first clears the userInactivity database table or resets it to your liking, and then does a https://docs.inductiveautomation.com/display/DOC80/system.util.sendMessage to all clients using scope='C'.

Create a client message handler to handle that incoming sendMessage from the gateway, where you run system.util.getInactivitySeconds and write that value and the current user to the database.