Page 1 of 1

Nice to know the user of an action, but better....

Posted: Sunday 28 June 2020 19:22
by EddyG
It is nice to know which user activated a switch etc...
A lot of those users are

Code: Select all

EventSystem//home/pi/domoticz/dzVents/runtime/dzVents.lua
It is nice to know that a dzVents script triggered the action, but I rather would like to know WHICH script initiated the action.

Would that be possible?

Re: Nice to know the user of an action, but better....

Posted: Sunday 28 June 2020 22:02
by waaren
EddyG wrote: Sunday 28 June 2020 19:22 A lot of those users are

Code: Select all

EventSystem//home/pi/domoticz/dzVents/runtime/dzVents.lua
It is nice to know that a dzVents script triggered the action, but I rather would like to know WHICH script initiated the action.
Would that be possible?
This will not be possible. The user that triggered the switch action is determined by the main domoticz process and from the perspective of that process it's dzVents.lua that triggered the action. A dzVents user script is a function of this main script and domoticz does not see that function.

Besides that this (relatively new) user field in the log cannot be trusted yet.
see this forum post and this github issue

Re: Nice to know the user of an action, but better....

Posted: Monday 29 June 2020 9:48
by EddyG
So if dzVents gave back to Domoticz, with a parameter, which script initiated the action my problem would/could be solved?

Re: Nice to know the user of an action, but better....

Posted: Monday 29 June 2020 10:16
by waaren
EddyG wrote: Monday 29 June 2020 9:48 So if dzVents gave back to Domoticz, with a parameter, which script initiated the action my problem would/could be solved?
Because of the way the domoticz event system interacts with dzVents (via commandArray and API), I don't think that will ever happen. If you really want to log this kind of information, a dzVents shared_ helper function that writes this in a separate logfile could be the next best thing.