email notification when a user disarmed the alarm

Post Reply
EricT
Posts: 20
Joined: Tuesday 01 May 2018 8:09
Target OS: Raspberry Pi
Domoticz version: 3.9440
Location: Rijen, The Netherlands
Contact:

email notification when a user disarmed the alarm

Post by EricT » Wednesday 16 May 2018 10:55

Hi all,

Is it possible to send an email notification if one of the users has armed or disarmed the alarm?

E.g if user X has logged in and disarmed the alarm an email notification is send to the other users like:

user X has disarmed the alarm

Thanks for your help.

Eric
if it was easy everybody would do it

ben53252642
Posts: 364
Joined: Saturday 02 July 2016 5:17
Target OS: Linux
Domoticz version: Beta
Contact:

Re: email notification when a user disarmed the alarm

Post by ben53252642 » Wednesday 16 May 2018 12:13

Yes this is easily possible but I don't see the need to explain it specifically for your use case in this post.

The alarm is simply a device of which the typical Domoticz home usually has dozens if not hundreds.

You need to read the Wiki and perhaps some threads in this forum to find how to send a notification when a device state changes.

Eg: Bed light turned off = send notification to x user

It's the same thing as: Device alarm turned off (disarmed or whatever) send notification to x user or users.

EricT
Posts: 20
Joined: Tuesday 01 May 2018 8:09
Target OS: Raspberry Pi
Domoticz version: 3.9440
Location: Rijen, The Netherlands
Contact:

Re: email notification when a user disarmed the alarm

Post by EricT » Wednesday 16 May 2018 12:35

I am sorry but maybe I was not clear enough.

I can send an email when something is switched on or off, no problem with that. What I am looking for that it mentioned in the email which user has done it, to be more specific name of the user that has logged in and made the change.

This email has to be send to the other users to notify them that it was user X that has done it.

I can see in the log which user activated an event but I do not know how to get that user name in an email notification.

I hope this explains what I am looking for.

Eric
if it was easy everybody would do it

ben53252642
Posts: 364
Joined: Saturday 02 July 2016 5:17
Target OS: Linux
Domoticz version: Beta
Contact:

Re: email notification when a user disarmed the alarm

Post by ben53252642 » Wednesday 16 May 2018 12:58

How exactly will Domoticz know which user disarmed the alarm?

What is the interface with Domoticz?

User avatar
DewGew
Posts: 192
Joined: Thursday 21 April 2016 12:01
Target OS: Raspberry Pi
Domoticz version: V3.8799
Location: Sweden
Contact:

Re: email notification when a user disarmed the alarm

Post by DewGew » Wednesday 16 May 2018 13:02

You can add several users to domoticz. In my head it should work some how. :?
When you switch a device it says in the log:
2018-05-16 13:04:30.438 User: Dewgew initiated a switch command (130/Lamp outside/On)
Raspberry Pi 2B - domoticz - Aeon Labs Z-Stick GEN5 - RFlink gateway
NanoPi NEO-air - domoticz - REGO6XX interface

EricT
Posts: 20
Joined: Tuesday 01 May 2018 8:09
Target OS: Raspberry Pi
Domoticz version: 3.9440
Location: Rijen, The Netherlands
Contact:

Re: email notification when a user disarmed the alarm

Post by EricT » Wednesday 16 May 2018 13:08

That is exactly my question.

In the log it is visable who made a change thus somehow Domoticz knows who made the change (see attachment). So the question is how to get that name in an email to other users.
Attachments
user log.png
user log.png (3.36 KiB) Viewed 97 times
if it was easy everybody would do it

ben53252642
Posts: 364
Joined: Saturday 02 July 2016 5:17
Target OS: Linux
Domoticz version: Beta
Contact:

Re: email notification when a user disarmed the alarm

Post by ben53252642 » Wednesday 16 May 2018 13:17

Now I understand, the logic you are looking for:

If x user controls x device and state = x then perform x (send an email in your case).

One solution I can think of is this:

Create a dummy device for each user and in security lock it down so only they and the domoticz admin user can see their dummy device.

User can turn dummy device on to arm or off to disarm etc... (you will need to use a Lua script, Dzvents or maybe blockly can do it)

Then you can use blockly or a script in events eg: If x device (the dummy device for that user) becomes x state then send an email to x.

EricT
Posts: 20
Joined: Tuesday 01 May 2018 8:09
Target OS: Raspberry Pi
Domoticz version: 3.9440
Location: Rijen, The Netherlands
Contact:

Re: email notification when a user disarmed the alarm

Post by EricT » Wednesday 16 May 2018 13:37

Thank you very much for your advice but I only want to make the dashboard available to the users.

I have the alarm arm/disarm switch on the Domoticz dashboard available for all users. If one of the users arms or disarms the alarm I want to notify the other users who done it.

I currently use a Lua script to send an email to all users that the alarm is armed or disarmed. I want to be more specific to avoid confusion among the users, therefore I want to know how to pull that name of the user into my Lua.
if it was easy everybody would do it

Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests