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

'Complicated' PUSH/Email Msgs


dw89

Question

Hi All,

First question is this: I have a sendEmail request like so:

fibaro:call(2, "sendEmail", "Alert! Glass House Main Alarm at: " .._alarmFloor, "Sensor Tripped is: " .._setOffBy .._setOffType);

What I would like to know is that the second part goes in the main message, can I put in a carriage return and just carry on forever or what's the limit? How do I put a carriage return here? i.e 0x0D0x0A or or or?

I'd like to have multiple lines of information in my main body if I can.

Secondly, can we add photos too into main body? Has anyone done this? I take it there's no way to take directly from an IP cam but that it needs to be taken first, then uploaded and then taken from its storage area via means of URL etc?

All and any info appreciated. Just wondering what 'can' be done here and how far people have taken it?

Many thanks, Dave

Please login or register to see this image.

/emoticons/default_icon_mrgreen.gif" alt=":mrgreen:" />

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 0

Is the hc2 sending the message as plain text or as a html message? If it is html, it should really be as easy as

and then continue the text.

If it is plaintext, there probably isn't a lot you can do. I don't think the newline character ("\n")will work either as it will just be displayed as written. The email client really decides how the message is sent, so if the client isn't already set up for html, then you probably can't change it.

Have you checked if the hc2 will open a smtp or imap socket and then send the message with a custom designed header using a vd.

Link to comment
Share on other sites

  • 0
  • Inquirer
  • Hi Dalle,

    Thanks for the reply. Not that I've tried to convert to HTML, honestly not totally sure how I would do that but, having messed around over the last few days with various bits, I've simply 'continued' the text strings and variables with the sendEmail function and it seems to do the carriage return itself.

    It would be nice to be able to include a JPEG from the camera nearest to the breach, I wonder if anyone's done it?

    So, at moment, my Alarm code (I have a few scenes etc that all work together to form comprehensive alarm now and which works completely with Fibaro's alarm), once it's set by user (iOS, Keyfob or VD), looks for two things: 1) Any door being opened 2) Any two motion sensor triggers within 1 minute and then alarm's go off (siren and fibaro), lights on etc and user/s get emails/Push saying what sensors have been breached and at what time.

    It would be great, in those emails, to be able to include a photo from the camera nearest to where the breach occurred. That way it can 'track' anyone in the house based upon what sensors are triggered on and after alarm went off!

    Please login or register to see this image.

    /emoticons/default_icon_mrgreen.gif" alt=":mrgreen:" />

    Any help appreciated

    Dave

    Please login or register to see this image.

    /emoticons/default_icon_wink.gif" alt=";-)" />

    Link to comment
    Share on other sites

    • 0

    Hi,

    It looks like it's not possible to attach picture/anything to the e-mail send via fibaro:call(id, "sendEmail") - according to this:

    Please login or register to see this link.

    I rembember it was possible to send a picture from a block scene in 3.x (like if sensor breached then camera send picture or sth) - don't have camera right now in the system, so cannot verify if my memory is correct.

    As to multiline e-mail messages. On 3.590 I had a scene that sent an e-mail with multiple lines without any problems just by using "\n" in the body of the e-mail.

    After migrating to 4.032 that stopped working. The workaround I found is that it works from Virtual Device, but if you try to send a multiline e-mail from a scene it doesn't.

    Following code works for me - just create a virtual device, add buton with following code, where 47 is my user id:

    Please login or register to see this code.

    and you should get an e-mail with 3 lines:

    Line1

    Line2

    Line3

    So the workaround is to push the button of the virtual device from the scene. If you know how to adjust the code above to work from the scene on 4.x please do let me know

    Please login or register to see this image.

    /emoticons/default_smile.png" alt=":)" srcset="https://forum.fibaro.com/uploads/emoticons/[email protected] 2x" width="20" height="20" />

    BTW. this is the error I get when trying to run same code from scene:

    [ERROR] 22:14:49: Runtime error: /usr/share/lua/5.2/json/decode/util.lua:35: unexpected character @ character: 1 0:1 [L] line:

    Best,

    Piotr

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • Thanks Piotr, nice info

    Please login or register to see this image.

    /emoticons/default_icon_mrgreen.gif" alt=":mrgreen:" />

    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.

    ×
    ×
    • Create New...