Custom log – possible?

Posted on
Tue Jan 16, 2018 1:36 pm
haakon offline
User avatar
Posts: 45
Joined: Mar 02, 2017

Custom log – possible?

Hi, I would like to have a custom log updated with certain events only. But I don't know if, or how, it can be done.

This is the idea: I would like the most important events in my Indigo setup to add a line to a log. So that I get an overview of what has been happening in the house, without having to scroll through the (enormous) standard log file. I hope to achieve something looking like this:

11:30 Main entrance door opened
10:15 Motion detected in the living room
09:00 House mode set to away
08:15 All cameras activated
08:00 House mode set to day
...
...

So my questions are: Is this achievable with a plugin or some other method not involving scripting? And would there be a way to show the most recent events from such a log in a control page?

Posted on
Tue Jan 16, 2018 2:17 pm
Different Computers offline
User avatar
Posts: 2533
Joined: Jan 02, 2016
Location: East Coast

Re: Custom log – possible?

Every trigger, action group and schedule could include a shell script that writes to a custom log file.

SmartThings refugee, so happy to be on Indigo. Monterey on a base M1 Mini w/Harmony Hub, Hue, DomoPad, Dynamic URL, Device Extensions, HomeKitLink, Grafana, Plex, uniFAP, Fantastic Weather, Nanoleaf, LED Simple Effects, Bond Home, Camect.

Posted on
Wed Jan 17, 2018 12:17 am
howartp offline
Posts: 4559
Joined: Jan 09, 2014
Location: West Yorkshire, UK

Re: Custom log – possible?

Not without creating triggers on everything you want to log, plus adding script to existing as DC says.

A plugin could probably do it - I was going to say no, but the SQL Logger plugin sees most data changes so it’s obviously possible to get that info from somewhere, just not sure which command it’s using off top of my head.


Sent from my iPhone using Tapatalk Pro

Posted on
Wed Jan 17, 2018 7:53 am
Different Computers offline
User avatar
Posts: 2533
Joined: Jan 02, 2016
Location: East Coast

Re: Custom log – possible?

But if the triggers/schedules/action groups already exist, you just add the shell script as a new action to it.

SmartThings refugee, so happy to be on Indigo. Monterey on a base M1 Mini w/Harmony Hub, Hue, DomoPad, Dynamic URL, Device Extensions, HomeKitLink, Grafana, Plex, uniFAP, Fantastic Weather, Nanoleaf, LED Simple Effects, Bond Home, Camect.

Posted on
Wed Jan 17, 2018 10:07 pm
RogueProeliator offline
User avatar
Posts: 2501
Joined: Nov 13, 2012
Location: Baton Rouge, LA

Re: Custom log – possible?

So my questions are: Is this achievable with a plugin or some other method not involving scripting? And would there be a way to show the most recent events from such a log in a control page?

This would be a fairly straight forward plugin if you wanted to write it just for you (not generic to release) -- you would subscribe to device (and/or variable) changes and act accordingly whenever you saw a change that interested you for the log. Where you store that information, though, might be dependent on how you get it out for display -- but a new table in the SQL Logger DB, a flat file, etc. are all options.

Displaying on a control page will be a chore at the present time... if you are writing the plugin, you could have a device that is considered "Latest Log Entries" with various states for most recent down and display those states on the page. However, that is potentially a lot of state updates to do from the plugin so not sure what the processing impact might be on the server.

Posted on
Fri Jan 19, 2018 1:51 am
howartp offline
Posts: 4559
Joined: Jan 09, 2014
Location: West Yorkshire, UK

Re: Custom log – possible?

DC, that’s true, but I wouldn’t want a load of extra triggers monitoring device state changes on various devices just to get them in a new log.

A plugin would do it much more succinctly.

Just thinking aloud, a file-watcher approach on the live log would probably be the quickest approach. Define a list of strings to monitor for; if the line contains the string, re-log it.


Sent from my iPhone using Tapatalk Pro

Posted on
Fri Jan 19, 2018 7:45 am
haakon offline
User avatar
Posts: 45
Joined: Mar 02, 2017

Re: Custom log – possible?

Thank you for these suggestions! A plugin would be perfect, but unfortunately I am not much of a programmer. So figuring out how to make a shell script will be my next step.

As for getting a list into a control panel, I have thought of a solution (sort of) that will work without scripting: When a relevant action group is triggered, it enters a line into a variable. At the same time, the previous content of that variable is moved along to a second variable, while the previous content of that variable is moved to a third variable. And so on. In that way I at least can have a list in my control panel with the latest few events.

Posted on
Fri Jan 19, 2018 8:36 am
Different Computers offline
User avatar
Posts: 2533
Joined: Jan 02, 2016
Location: East Coast

Re: Custom log – possible?

If all you want is the most recent few lines of the Indigo log to appear on a control page, there's a topic somewhere in the forums on how to do that. I had it working well on some previous versions of my control pages.

SmartThings refugee, so happy to be on Indigo. Monterey on a base M1 Mini w/Harmony Hub, Hue, DomoPad, Dynamic URL, Device Extensions, HomeKitLink, Grafana, Plex, uniFAP, Fantastic Weather, Nanoleaf, LED Simple Effects, Bond Home, Camect.

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 3 guests

cron