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

Configure Push and Email in LUA


mclass
 Share

Question

I am attempting to send a notification of opened windows in a LUA scene, using the code:

fibaro:call(1, "sendPush", windowname .." is still open ")

From hunting through the forum, I understand that the first argument ("1") is the id of the user that is to receive the push message. What I have not been able to discover is how to find out the user id - it is not obvious from either the user or notification panels. I have tried the user name (eg "admin") without success.

Any instruction would be appreciated.

BTW, can anyone point me to where the sendPush, sendEmail and other lua functions are documented?

Thanks, mclass

Link to comment
Share on other sites

7 answers to this question

Recommended Posts

  • 0

mclass, you must replace 1 with your device ID and not your user ID. You can download the

Please login or register to see this link.

to find easily the ID, "Data"->"Get Devices" ...

Regards

Link to comment
Share on other sites

  • 0
  • Inquirer
  • Appreciate your prompt response, Krikroff!

    However, my understanding is that the argument is the intended recipient of the the push (or the email in the case of sendEmail), rather than a device id.

    Unless of course, in Fibaro, the intended user is regarded as a "device"!!

    Please login or register to see this image.

    /emoticons/default_icon_redface.gif" alt=":oops:" />

    Your toolkit looks great, and I am trying to find time to down load it on to my Mac and run under XP on VirtualBox

    Please login or register to see this image.

    /emoticons/default_icon_razz.gif" alt=":-P" />

    UPDATE: Having now downloaded and trialled Toolkit (great stuff!), I have been able to get the ID number of users. Unfortunately this still hasn't got the push and email working - the search continues!!

    Link to comment
    Share on other sites

    • 0

    mclass,

    I am using the following Lua scene to detect the change of state of my living room window and send a push message to my phone after 3 min.

    Please login or register to see this code.

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • Ah, hah! Now I get it

    Please login or register to see this image.

    /emoticons/default_icon_smile.gif" alt=":-)" />

    For push notifications, the device id for the iPhone/iPad is required, and NOT the user ID!

    Now got the push going fine, with many thanks to Krickroff's wondrous Toolkit!!

    Two questions remain:

    - do you use the user id for email notifications? I can find no id for the email address entered in the notifications panel.

    and

    - how on earth did mere mortals such as me find the device id to push to before Krickroff weaved his magic with the toolkit??!!

    Many thanks for all your help so far!

    Regards,

    mclass

    Link to comment
    Share on other sites

    • 0

    Not that you need it if you use the toolkit to find this but if you want to use lua or integrate.

    /api/devices

    There is a thread on the http api in power users section.

    Link to comment
    Share on other sites

    • 0

    For others looking for how to find the mobile device id for push notifications...

     

    Using the Google chrome web browser, go to the Home Center Access Control settings page. Right click on the tickbox next to the mobile device name and click "Inspect".

    Please login or register to see this attachment.

     

    The mobile device id is shown in the HTML code window and should be selected (grey background). Search for "push_" or "changePush" and the id is the number nearby.

    Please login or register to see this attachment.

     

     

    Same goes for finding the user's id but right click on the username link, delete or edit icons. The user id is also shown in the address bar when editing a user.

    • Like 2
    Link to comment
    Share on other sites

    • 0

    For others looking for how to find the mobile device id for push notifications...

     

    Using the Google chrome web browser, go to the Home Center Access Control settings page. Right click on the tickbox next to the mobile device name and click "Inspect".

    Please login or register to see this image.

    /public/style_images/master/attachicon.gif" alt="attachicon.gif" />

    Please login or register to see this link.

     

    The mobile device id is shown in the HTML code window and should be selected (grey background). Search for "push_" or "changePush" and the id is the number nearby.

    Please login or register to see this image.

    /public/style_images/master/attachicon.gif" alt="attachicon.gif" />

    Please login or register to see this link.

     

     

    Same goes for finding the user's id but right click on the username link, delete or edit icons. The user id is also shown in the address bar when editing a user.

    this is excellent. cheers

    i usually created a block scene for notification then saved it and then converted to LUA to identify the ID number of my user before deleting the scene again, but this method is a lot quicker and easier.

    thanks for sharing

    Link to comment
    Share on other sites

    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.

     Share

    ×
    ×
    • Create New...