Announcement

Collapse
No announcement yet.

Send email to HS3 that triggers an event/action?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Send email to HS3 that triggers an event/action?

    Wasn't there a way to send an email (like from Outlook or gmail) to HS3 that would in turn trigger an event? Can't find it or maybe i'm just imagining it?

    #2
    In HS3 there is a trigger "If a received email is from or contains"
    Mike____________________________________________________________ __________________
    HS3 Pro Edition 3.0.0.548, NUC i3

    HW: Stargate | NX8e | CAV6.6 | Squeezebox | PCS | WGL 800RF | RFXCOM | Vantage Pro | Green-Eye | Edgeport/8 | Way2Call | Ecobee3 | EtherRain | Ubiquiti

    Comment


      #3
      Originally posted by Uncle Michael View Post
      In HS3 there is a trigger "If a received email is from or contains"
      Yes.. there it is! (BTW, this is another possible way to solve the same problem you are helping me with on the other thread).

      So, how is HS receiving a mail that it can parse to then use this trigger? IT's not monitoring my personal inbox? or is it? I have gmail setup with HS4.

      Comment


        #4
        There are 2 email setups in Homeseer, one to send email, the other to receive/watch it. If you set up the receive function, you can trigger events on it.


        Sent from my Pixel 2 using Tapatalk

        Comment


          #5
          Originally posted by mterry63 View Post
          There are 2 email setups in Homeseer, one to send email, the other to receive/watch it. If you set up the receive function, you can trigger events on it.


          Sent from my Pixel 2 using Tapatalk
          Been a user for years... never tried that. Works pretty well.

          Simple solution to my generator problem. The monitoring service i pay for (Mobile Link) sends me an email notification when the generator is on/off. I can just use this to create my trigger!

          Thanks all!!!!

          Comment


            #6
            Originally posted by Tomgru View Post

            Yes.. there it is! (BTW, this is another possible way to solve the same problem you are helping me with on the other thread).

            So, how is HS receiving a mail that it can parse to then use this trigger? IT's not monitoring my personal inbox? or is it? I have gmail setup with HS4.
            If you have Gmail setup then indeed it is monitoring it, I use the received email trigger to fire whenever an email arrives and it then runs a script to do things with it. I go through the email and if it is something I want to be notified about then I make a TTS announcement. In your case you could run an event if the subject contained a certain string or something.

            In days gone by (HS2) I think there was some email control syntax so that events/devices could be controlled depending on what was written in the email, I don't know if that still works but I suspect not.

            This is the script I use...

            Code:
            Sub Main(ByVal Parm As Object)
                Try
                    Dim mIndex as Integer = hs.MailTrigger
                    Dim mSubject as string = hs.MailFrom(mIndex)
                    Dim sString As String = ""
                    hs.writelog("EmailCheck", "From Address: " & mSubject)
                    If mSubject.Contains("homeseer.com") Then
                        sString = "HomeSeer Message Email"
                    ElseIf mSubject.Contains("CreditCardOnlineServices@cards.natwest.co m") Then
                        sString = ""
                    ElseIf mSubject.tolower.Contains("paypal") Then
                        sString = ""
                    ElseIf mSubject.tolower.contains("ebay") Then
                        sString = ""
                    ElseIf mSubject.tolower.contains("gumtree") Then
                        sString = ""
                    Else
                        sString = "You have new email from " & mSubject
                    End If
                    hs.writelog("EmailCheck", "Speech String: " & sString)
            
                    If sString <> "" then hs.speak("<silence msec=""500""/>" & sString, True, "$SONOS$AllHouseGroup$DEFAULT:*")
            
                Catch ex As Exception : hs.writelog("EmailCheck", "Error: " & ex.Message.ToString)
                End Try
            End Sub

            Comment


              #7
              It works for me. The issue for me I clicked "any" for any email address, subject and body requirements and saved. Later I decided to just use the subject and delete the body portion. I cannot delete the body portion no matter how I try. It reverts back to my original entry. Yes I clicked "SAVE" over and over.

              When I check mail it's through my ISP and not google. I never got gmail to work for me, too many hoops to jump through.

              The actual event that reads the email fires, sends me a text that the email arrived and runs an event to increment a test counter so I assume it would run any desired event.

              Tomgru I started to type this and walked away, I finally hit send and didn't realize in the process you had gotten your answer.

              Comment


                #8
                I just tested this and it works perfectly.

                One KEY question though... if the email that is invoking the trigger sits in your inbox, will it re-run the even the next time it checks the inbox again?

                So, what i'm triggering off of will be the same email/subject every time the generator turns to normal status. This will show up once power is restored and emails come in again.

                But if i don't delete it right away, when HS looks in the inbox again in 10 minutes, will it see the old email and trigger the event again?

                here's my event if it helps put into perspective.

                Click image for larger version

Name:	Screenshot 2020-09-18 135617.jpg
Views:	99
Size:	160.4 KB
ID:	1420185

                Comment


                  #9
                  It will not run the event again. I created exactly the same email 6 times and it only ran it for the latest one. What I'm not sure of is what if you open the received email and it shows as read instead of unread. Will the event run then? I can test easily enough but I wonder what others have experienced.

                  Comment


                    #10
                    Originally posted by racerfern View Post
                    It will not run the event again. I created exactly the same email 6 times and it only ran it for the latest one. What I'm not sure of is what if you open the received email and it shows as read instead of unread. Will the event run then? I can test easily enough but I wonder what others have experienced.
                    What I hope it does is run everytime a new mail comes in that matches the criteria, but only once for that mail.

                    anybody know for sure?

                    Comment


                      #11
                      Tomgru OK, I just sent a test email and on another pc as soon as it arrived I marked it read. A minute or so later HS4 checked for email (which I have set at 5 minute intervals) and it did see there was an email, sent me notification and ran the next event exactly as it should have.

                      Comment


                        #12
                        Originally posted by racerfern View Post
                        Tomgru OK, I just sent a test email and on another pc as soon as it arrived I marked it read. A minute or so later HS4 checked for email (which I have set at 5 minute intervals) and it did see there was an email, sent me notification and ran the next event exactly as it should have.
                        Cool, so it somehow only works on a new incoming mail. that's good... thanks for testing!!!

                        Comment

                        Working...
                        X