Jump to content

Welcome to Smart Home Forum by FIBARO

Dear Guest,

 

as you can notice parts of Smart Home Forum by FIBARO is not available for you. You have to register in order to view all content and post in our community. Don't worry! Registration is a simple free process that requires minimal information for you to sign up. Become a part of of Smart Home Forum by FIBARO by creating an account.

 

As a member you can:

  •     Start new topics and reply to others
  •     Follow topics and users to get email updates
  •     Get your own profile page and make new friends
  •     Send personal messages
  •     ... and learn a lot about our system!

 

Regards,

Smart Home Forum by FIBARO Team


  • 0

Notification with username


Question

Posted

Hi,

 

I need to send mail when the alarm is inserted with the user who triggered it, is there a way to do it via scenes?

How do I retrieve the user who triggered the alarm via the API?

 

Regards,

Dario

4 answers to this question

Recommended Posts

  • 0
Posted (edited)
2 hours ago, FibaPix said:

Hi,

 

I need to send mail when the alarm is inserted with the user who triggered it, is there a way to do it via scenes?

How do I retrieve the user who triggered the alarm via the API?

 

Regards,

Dario

What do you mean by user who triggered that Alarm? User that has breached the Alarm or User that armed the Alarm?

Edited by cag014
  • 0
Posted

If you arm your alarm by running a scene with the Yubii app and have different users setup for everybody in the household you can see who triggered the scene by reading the system variable sourceTrigger:

 

Please login or register to see this code.

 

  • Like 1
  • 0
Posted (edited)
2 hours ago, Joep said:

If you arm your alarm by running a scene with the Yubii app and have different users setup for everybody in the household you can see who triggered the scene by reading the system variable sourceTrigger:

 

Please login or register to see this code.

 

Another approach you can create different zones (doing same arming) and as you said, each user will have access to different zone. Now using API or sourceTrigger you can find which alarm armed and you know who is the user.

But it's not clear either he is looking for who triggered or armed the alarm?

Edited by cag014
  • 0
  • Inquirer
  • Posted

    Thanks, I recovered the name this way

     

    userid = sourceTrigger.id
    user = api.get("/users/" .. userid)
    print(user["name"])
     
    Regards,
    Dario

    Join the conversation

    You can post now and register later. If you have an account, sign in now to post with your account.

    Guest
    Answer this question...

    ×   Pasted as rich text.   Paste as plain text instead

      Only 75 emoji are allowed.

    ×   Your link has been automatically embedded.   Display as a link instead

    ×   Your previous content has been restored.   Clear editor

    ×   You cannot paste images directly. Upload or insert images from URL.

    ×
    ×
    • Create New...