Page 1 of 1

Get username in lua

Posted: Tuesday 08 March 2016 17:46
by Clemen
Hi,

Is it posible to get the username of the person activating a switch command in lua?

I can see in the log, that the user is tied to the switch command.

I want to make a push notification when my kids activate/deactivate the alarm to my device, but i dont want to get a push when my wife or myself are activating the switch command.

We all do have different domoticz users.

Re: Get username in lua

Posted: Tuesday 08 March 2016 18:26
by jvdz
Don't think that information is available. Not sure how you are Activation/deactivating exactly via a switch, but you could have 2 separate switches where you for one enable the notification.

Jos

Re: Get username in lua

Posted: Tuesday 08 March 2016 18:43
by Clemen
I have a virtual switch to activate/deactivate,

I think it would be a nice feature in multiple of my scripts to get username of the person activating the switch. Its available in the log.
2016-03-08 18:44:09.598 User: clemen initiated a switch command

Re: Get username in lua

Posted: Tuesday 08 March 2016 18:59
by jvdz
That line is only shown when you have to login with a userid/password, but could be a nice feature. In the mean time you do have that option to create 2 virtual switches and select one of yourselve and partner and select the other for the kids, which you can then send notifications for.

Jos