Announcement

Collapse
No announcement yet.

HS3 Pushover Plugin

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

  • ScottAtlanta
    replied
    Thank you mrceolla! I tried testing your code, and after a few tweaks I got it to send a pushover message via a script. So then I had to do a little debugging to ascertain what the difference was between my old script and your script. I ultimately figured it out...for some reason the Sound parameter no longer accepts 'Nothing' as a result. I replaced the word Nothing with double quotes and I was able to send the pushover notification via script. However, I did get an error message that said "Attachment Does Not Exist - Sending Without". So I also changed the last parameter from 'Nothing' to double quotes and the attachment error message went away as well.

    So in its most basic form, here's the script I got to work:

    Public Sub Main(Parms As Object)
    Dim CO(8) As Object

    CO(0) = "All Clients"
    CO(1) = "Script Test"
    CO(2) = "Test"
    CO(3) = Nothing
    CO(4) = ""
    CO(5) = Nothing
    CO(6) = Nothing
    CO(7) = Nothing
    CO(8) = ""

    hs.PluginFunction("PushOver 3P", "", "Pushscript", CO)

    End Sub

    Leave a comment:


  • mrceolla
    replied
    I assume the syntax you're using used to work since you said running via script is an important part of your setup. All of my Pushover messages are sent via a script as well, and they are still working. My code is a little different and I don't know VB well enough to know if what you're doing is equivalent or not. I use this:

    Code:
    Dim toClients As String = "All Clients" ' separate with | if multiple; "All Clients" for all
    Dim pushBody As String = Regex.Replace(body, vbCrLf, "") ' Body; let us remove vbCrLf and rely on HTML <br> for push messages; 512 char max; changed to 1024 in .45
    ' Pushover messages have 1024 max length
    If pushBody.Length > 1023 Then
    pushBody = pushBody.Substring(0, 1023)
    End If
    Dim title As String = subject ' Title
    Dim priority As String = priorityParam ' Priority
    Dim sound As String = soundParam ' Sound
    Dim url As String = "" ' URL
    Dim urlTitle As String = "" ' URL Title
    Dim apiString As String = "" ' API String
    Dim attachmentPath As String = "" ' Attachment path
    
    Dim pushResult As Boolean = hs.PluginFunction("Pushover 3P", "", "Pushscript", New Object() {toClients, pushBody, title, priority, sound, url, urlTitle, apiString, attachmentPath})

    Leave a comment:


  • ScottAtlanta
    replied
    I haven't made any updates to my system, but I recently lost lost the ability to send Pushover messages via VB script. I can still send send messages using Event actions.

    I was using the .52 version plugin (which is the most current version available on the Homeseer web site), but I noticed you uploaded .54 here. So I installed .54 and I'm still getting an error message in the HS log and no message is going out when using a script to do so. Here's is a basic script I wrote just to test the functionality:
    Public Sub Main(ByVal Parms As Object)
    Dim CO(8) As Object

    CO(0) = "All Clients"
    CO(1) = "Script Test"
    CO(2) = "Test"
    CO(3) = Nothing
    CO(4) = Nothing
    CO(5) = Nothing
    CO(6) = Nothing
    CO(7) = Nothing
    CO(8) = Nothing

    hs.PluginFunction("PushOver 3P", "", "Pushscript", CO)

    End Sub

    And here is the error message I get in the HS Log:
    Jan-26 15:35:37 Pushover 3P PushMessage Exception: Object reference not set to an instance of an object.
    Jan-26 15:35:37 Pushover 3P Attachment Does Not Exist - Sending Without
    I've tried deleting the plugin, reinstalling, restarting Homeseer, rebooting my Windows machine...nothing has worked. I opened the plugin using the HS developer console and pasted the results below when I try to send a pushover message via VB script. Any suggestions on how I can start sending pushover messages via script again? It's a very important part of my setup.

    THANKS!


    [1/26/2021 3:40:57 PM] - > PluginFunction Called: Pushscript
    [1/26/2021 3:40:59 PM] - > PushScript Called
    [1/26/2021 3:40:59 PM] - -> Parameters Count: 8
    [1/26/2021 3:40:59 PM] - --> Parameter 0: All Clients
    [1/26/2021 3:40:59 PM] - --> Parameter 1: Script Test
    [1/26/2021 3:40:59 PM] - --> Parameter 2: Test
    [1/26/2021 3:40:59 PM] - --> Parameter 3:
    [1/26/2021 3:40:59 PM] - --> Parameter 4:
    [1/26/2021 3:40:59 PM] - --> Parameter 5:
    [1/26/2021 3:40:59 PM] - --> Parameter 6:
    [1/26/2021 3:40:59 PM] - --> Parameter 7:
    [1/26/2021 3:40:59 PM] - --> Parameter 8:
    [1/26/2021 3:40:59 PM] - -> Correct Paramters
    [1/26/2021 3:40:59 PM] - > PushMessage Called
    [1/26/2021 3:40:59 PM] - > AddToTable : Send Pushover Message Row Count: 14
    [1/26/2021 3:40:59 PM] - -> Input Attachment:
    [1/26/2021 3:40:59 PM] - --> Replace Path Attachment:
    [1/26/2021 3:40:59 PM] - Attachment Does Not Exist - Sending Without
    [1/26/2021 3:40:59 PM] - -> Message Priority normal
    [1/26/2021 3:40:59 PM] - Emergency Priority - Second Check
    [1/26/2021 3:40:59 PM] - -> Send Message Is True - Send The Message
    [1/26/2021 3:40:59 PM] - -> Device Name: All Clients
    [1/26/2021 3:40:59 PM] - --> All Devices
    [1/26/2021 3:40:59 PM] - -> User Key: XXXXXXXXXXXXXX. (redacted)
    [1/26/2021 3:40:59 PM] - -> Priority: 0
    [1/26/2021 3:40:59 PM] - > CustomReplacement Called Input String: Test
    [1/26/2021 3:40:59 PM] - -> ReplacementFunction Return: Test
    [1/26/2021 3:40:59 PM] - > CustomReplacement Called Input String:
    [1/26/2021 3:40:59 PM] - -> ReplacementFunction Return:
    [1/26/2021 3:40:59 PM] - --> URL (Encoded):
    [1/26/2021 3:40:59 PM] - -> URL Title:
    [1/26/2021 3:40:59 PM] - -> Monospace: False
    [1/26/2021 3:40:59 PM] - -> Sound:
    [1/26/2021 3:40:59 PM] - PushMessage Exception: Object reference not set to an instance of an object.
    [1/26/2021 3:41:00 PM] - > tmrFlood Elapsed

    Leave a comment:


  • 123qweasd
    replied
    Yes, the plugin was stopped (but not HS). Will try again. Thx for the feedback

    edit: restarting HS did it, thx

    Leave a comment:


  • goldriver
    replied
    Originally posted by 123qweasd View Post

    PI console still shows 0.0.0.53 instead of 0.0.0.54, is this normal ?
    just disabled the PI and copied the exe over the old one (0.0.0.54 over 0.0.0.53).
    Everything else seems to work though.
    Have you stopped the plugin before copying the file ? I had the same problem, I stopped the plugin, copied over the old file, restart and now I have the correct version

    Leave a comment:


  • 123qweasd
    replied
    Originally posted by mrhappy View Post

    This is an issue which has caused an issue with other plugins of mine - it appears that the device code is dropped when you go into the device details page and then the plugin will try and create the device again (because it can't find the device in HS because the data is not there), if you edit this device again the code will go and the sorry process will continue.

    I have fixed that I think now with the version on this post, sadly you will have to start again with HS devices which may cause some people to be reluctant to do this but it is there if they wish to.
    PI console still shows 0.0.0.53 instead of 0.0.0.54, is this normal ?
    just disabled the PI and copied the exe over the old one (0.0.0.54 over 0.0.0.53).
    Everything else seems to work though.

    Leave a comment:


  • Monk
    replied
    Hello and thank you for this great plug-in. I did not see release notes, I'm curious what to expect if I update from .48 to .52?
    Thanks and stay safe.

    Leave a comment:


  • mrhappy
    replied
    Originally posted by voxie View Post
    Strange (little) problem. Plugin version 0.0.0.52. HS3 3.0.0.548. If I modify for example the Pushover icon or the Floor parameter on a Pushover device, disable and enable the plugin new duplicate devices are created. Looks like the plugin creates new devices if something is changed on the original devices.
    This is an issue which has caused an issue with other plugins of mine - it appears that the device code is dropped when you go into the device details page and then the plugin will try and create the device again (because it can't find the device in HS because the data is not there), if you edit this device again the code will go and the sorry process will continue.

    I have fixed that I think now with the version on this post, sadly you will have to start again with HS devices which may cause some people to be reluctant to do this but it is there if they wish to.

    Attached Files

    Leave a comment:


  • voxie
    replied
    Strange (little) problem. Plugin version 0.0.0.52. HS3 3.0.0.548. If I modify for example the Pushover icon or the Floor parameter on a Pushover device, disable and enable the plugin new duplicate devices are created. Looks like the plugin creates new devices if something is changed on the original devices.

    Leave a comment:


  • akurz
    replied
    Originally posted by mrhappy View Post

    I am an idiot. Please can you try this version...
    Agree with Dan-O: No idiot - by a long shot.

    Latest version works a treat.

    Thanks!
    Alex

    Leave a comment:


  • stefxx
    replied
    Originally posted by mrhappy View Post

    OK I can change this and probably should in all my plugins, thanks for the heads up. I'm not against minor changes like this...
    Excellent! Keep up the good work!

    Leave a comment:


  • mrhappy
    replied
    Originally posted by stefxx View Post
    Thanks mrHappy! Latest version works just fine.

    However, you are using images from the "contemporary" folder. While it does exist on my HS4 production system, (upgraded from HS3) it does not exist on a fresh HS4 installation (my dev environment). All the references images exist in the "status" folder as well, and they are exactly the same.

    The simple fix would be to use the ones from the "status" folder, that should work for HS3 and HS4. As I workaround, I copied the images to the contemporary folder for now.

    I know, HS4 is not supported
    OK I can change this and probably should in all my plugins, thanks for the heads up. I'm not against minor changes like this...

    Leave a comment:


  • stefxx
    replied
    Thanks mrHappy! Latest version works just fine.

    However, you are using images from the "contemporary" folder. While it does exist on my HS4 production system, (upgraded from HS3) it does not exist on a fresh HS4 installation (my dev environment). All the references images exist in the "status" folder as well, and they are exactly the same.

    The simple fix would be to use the ones from the "status" folder, that should work for HS3 and HS4. As I workaround, I copied the images to the contemporary folder for now.

    I know, HS4 is not supported

    Leave a comment:


  • Dan-O
    replied
    Originally posted by mrhappy View Post

    I am an idiot. Please can you try this version...
    NO WAY ARE YOU AN IDIOT!

    I use your Pushover Plugin all the time.


    Leave a comment:


  • mrhappy
    replied
    Originally posted by akurz View Post
    Hi there.

    Looks like with the latest version 0.0.0.52 sending messages from a script in HS3 doesn't work anymore. There's no errors or anything - just no message sent. Same script with same parameters works fine with 0.0.0.48. I've downgraded and got everything working for now, so no pressure.

    Here's the relevant part of the script:

    Code:
    Dim CO(8) as Object
    CO(0) = "phone1|phone2"
    CO(1) = "Roomba hat eine Reinigungsaufgabe in " & Total_Time & " Minuten erledigt und ist nun zurück im Dock."
    CO(2) = "Roomba Reinigung beendet"
    CO(3) = Nothing
    CO(4) = "Gamelan"
    CO(5) = Nothing
    CO(6) = Nothing
    CO(7) = "iRobot"
    CO(8) = Nothing
    
    hs.PluginFunction("Pushover 3P", "", "Pushscript", CO)
    Cheers,
    Alex
    I am an idiot. Please can you try this version...
    Attached Files

    Leave a comment:

Working...
X