Announcement

Collapse
No announcement yet.

Sending an Email or Text of a Snapshot

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

  • skozin
    replied
    Well I found out the error message was from not saving the script as .vb. Now testing the script again. Going out, will let you know later.

    Thanks,
    Steve

    Leave a comment:


  • dcorsus
    replied
    Originally posted by skozin View Post
    I am running a manual event Click image for larger version Name:	Untitled.png Views:	0 Size:	87.6 KB ID:	1599064
    my script is:

    Sub Main(Parm As Object)

    Dim RingImage
    RingImage = hs.devicestring (460)'where x is your HS RING Snapshot device ref#

    hs.SendEmail("xxxxxx@comcast.net","xxxxx@gmail.com","","", "your subject","This is RING Motion Image taken on " &now(),"C:\Program Files (x86)\HomeSeer HS4\html" & RingImage)

    End Sub​

    460 is the Device reference #.

    Dcorsus:

    I tried your method and it ends up giving me a link on my message to click and then it will open the snapshot. What I am trying to get is just the snapshot showing up and not clicking the link.

    Thanks
    What is the file name of your script, more importantly, what is the extension? It should be FrontDoor.vb (or so I believe)

    Leave a comment:


  • skozin
    replied
    I am running a manual event Click image for larger version  Name:	Untitled.png Views:	0 Size:	87.6 KB ID:	1599064
    my script is:

    Sub Main(Parm As Object)

    Dim RingImage
    RingImage = hs.devicestring (460)'where x is your HS RING Snapshot device ref#

    hs.SendEmail("xxxxxx@comcast.net","xxxxx@gmail.com","","", "your subject","This is RING Motion Image taken on " &now(),"C:\Program Files (x86)\HomeSeer HS4\html" & RingImage)

    End Sub​

    460 is the Device reference #.

    Dcorsus:

    I tried your method and it ends up giving me a link on my message to click and then it will open the snapshot. What I am trying to get is just the snapshot showing up and not clicking the link.

    Thanks

    Leave a comment:


  • dcorsus
    replied
    Originally posted by skozin View Post
    Thanks for the script, but I am getting an error message:





    3/18/2023 6:18:05 PM
    Thread Pool Worker
    Error
    Running script: Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: startIndex-> at System.String.IndexOf (System.String value, System.Int32 startIndex, System.Int32 count, System.StringComparison comparisonType) [0x0001b] in :0 at System.String.IndexOf (System.String value, System.Int32 startIndex, System.StringComparison comparisonType) [0x00009] in :0 at System.String.IndexOf (System.String value, System.Int32 startIndex) [0x00000] in :0 at HSCore.Trigger.TriggerRunScript (System.String scr, System.Boolean single_instance, System.Int32 phone_line, System.String host, System.Boolean wait_here, System.String CalledFrom, System.String UName, System.Int32 URights, System.String passedfunc, System.Object passedparam, System.Int32 evref, System.Boolean DoSetEvent) [0x00422] in :0


    ​​
    suggest you post picture of your event and content of your script. What is the feature reference number of the ring device that holds the snapshot feature string?

    Leave a comment:


  • skozin
    replied
    Thanks for the script, but I am getting an error message:





    3/18/2023 6:18:05 PM
    Thread Pool Worker
    Error
    Running script: Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: startIndex-> at System.String.IndexOf (System.String value, System.Int32 startIndex, System.Int32 count, System.StringComparison comparisonType) [0x0001b] in :0 at System.String.IndexOf (System.String value, System.Int32 startIndex, System.StringComparison comparisonType) [0x00009] in :0 at System.String.IndexOf (System.String value, System.Int32 startIndex) [0x00000] in :0 at HSCore.Trigger.TriggerRunScript (System.String scr, System.Boolean single_instance, System.Int32 phone_line, System.String host, System.Boolean wait_here, System.String CalledFrom, System.String UName, System.Int32 URights, System.String passedfunc, System.Object passedparam, System.Int32 evref, System.Boolean DoSetEvent) [0x00422] in :0


    ​​

    Leave a comment:


  • will40
    replied
    you can save this script.vb and run it from your event if your image path is the same

    Code:
    Sub Main(Parm As Object)
    
    Dim RingImage
    RingImage = hs.devicestring (xxxx)'where x is your HS RING Snapshot device ref#
    
    hs.SendEmail("yourto@email","yourfrom@email","","","your subject","This is RING Motion Image taken on " &now(),"C:\Program Files (x86)\HomeSeer HS4\html" & RingImage)
    
    End Sub​

    Leave a comment:


  • dcorsus
    replied
    You have to find the reference value of the feature and use that in conjunction with the $$DTR:xxxx: wrapper, where you now have the fixed name of the attachment in your event. Please read up using the link I posed on replacement variables and do search this forum for other posts that may answer the questions you have.

    Leave a comment:


  • skozin
    replied
    So where would the $$DTR:ref go? I am a little confused.

    Leave a comment:


  • dcorsus
    replied
    Originally posted by skozin View Post
    Well after testing it won't send a picture to the text message at all. Can someone show me how to attach that file when motion is detected?

    Thanks
    There is always the chance that substitution variables are not supported as "an attachment value", but that would be a HS question. Make sure you syntax is correct and you are using the right reference of the correct feature (not the device!)

    Leave a comment:


  • skozin
    replied
    Dcorsus:

    Thanks for the quick reply. I am using A HSPI Linux device, can that still be done?

    Well after testing it won't send a picture to the text message at all. Can someone show me how to attach that file when motion is detected?

    Thanks

    Leave a comment:


  • dcorsus
    replied
    Use $$DTR:ref:​ (see https://help.homeseer.com/help/HS3/s...ent_variables1) to use the string value of the device, so it will always be correct. Depending on whether you plan to retrieve the image through HTTP (then the path is correct) or as a file (then you need to add the <gs root>/html prefix (but you can only do this on the local PC).

    Leave a comment:


  • skozin
    started a topic Sending an Email or Text of a Snapshot

    Sending an Email or Text of a Snapshot

    Hello:

    I just started playing with the plugin and as of now it seems great. One question. Say I want to send an email or text of the snapshot taken based on motion. Each time the snapshot is taken it creates a new file name (Ex: /Ring/snapshots/snapshot_16046093_03-18-2023_17-11-01.jpg) How would I add the latest snapshot as an attachment? The date and time changes all the time. FYI, I am very weak at programming.

    The picture below works but I manually put the date and time in. Is there an easier way?

    Edit: The pic is wrong. I forgot to put in http://192.168.2.XX:XXXX before the Ring/Snapshots...

    Thanks in advance.

    Steve Click image for larger version  Name:	Untitled.png Views:	0 Size:	81.4 KB ID:	1599041
Working...
X