Announcement

Collapse
No announcement yet.

HS3 Pushover Plugin

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

  • ez1976
    replied
    Originally posted by mrhappy View Post
    Yeah this is one of those things that can catch you out and to be honest my view is HS should not let you do this, I struggle to imagine a scenario that you would need to run a script at more than once a second and even if so I don't imagine HS really appreciates it!

    Just for information the plugin should hopefully limit the ability to flood it with messages if you do program an event like this, I can't remember the timing and the numbers but it shouldn't let you empty your pushover account easily.
    Hi
    i had the same issues.
    you are using the "Had been On for AT LEAST"
    i use the "Exactly" 5 minutes . that way i can get only one notification.

    another way to do it is set it to alert if the gate has been open for at least 5 minutes but set the checkbox under the "options" of the event "cannot re-run for" and set it for 10 minutes.

    that way you will get an alert every 10 minutes until it get closed.

    Leave a comment:


  • mrhappy
    replied
    Originally posted by aj84 View Post
    Hi all
    Just trying this plugin out and on the face of it, its great but I think (being new to HS), I'm not seeing something.

    I set up a simple event
    IF This device has been/for at least...
    Outside Gates has been On for at least 5 minutes
    Then
    Message Title "Gates are still open"

    It kicked in perfectly but sent a constant message every second until I disabled the event altogether.

    I've seen things about timers etc but can't see this option - am I going blind?
    I assume I need to add one or set something so it only sends a single message?

    Thanks in advance
    Yeah this is one of those things that can catch you out and to be honest my view is HS should not let you do this, I struggle to imagine a scenario that you would need to run a script at more than once a second and even if so I don't imagine HS really appreciates it!

    Just for information the plugin should hopefully limit the ability to flood it with messages if you do program an event like this, I can't remember the timing and the numbers but it shouldn't let you empty your pushover account easily.

    Leave a comment:


  • mrhappy
    replied
    Originally posted by ez1976 View Post
    Worked perfectly
    thank you.
    now i need to see how i can send hebrew characters in the push from a script
    i get blocks instead

    Is there a way to add it to an event via script?
    i can add to event using
    Hs.AddDeviceActionToEvent

    is there something for pushover as well?
    The lack of Hebrew characters could be due to the character encoding, I've checked and the plugin can send Hebrew characters and the Pushover app can receive them so it appears support is there for it. I've checked and sending them by script does work and as such I suspect it might be due to how you are editing the script. If you send an immediate script command with a Hebrew character (I picked ך) then it does not work, I've edited a script using the HS script editor and it seems to work but it may be the way you are saving the script does not support Unicode or is not saving as Unicode and as such the character is not getting to the script. If you are using Notepad then AFAIK it saves as ASCII only and as such you will not get any special characters.

    You can't add Pushover actions to an event by script (nor can you add any other plugin actions to an event by script). The only two options that I am aware of are as per the attached image, you appear to be able to add a script action (I don't think that this is documented anywhere) but I have not tested whether or not this works and how well.
    Last edited by mrhappy; March 31st, 2018, 05:58 AM.

    Leave a comment:


  • ez1976
    replied
    Originally posted by mrhappy View Post
    I'm sorry but I don't quite catch what you mean, the script I posted could be expanded to any number of variables that you want, if you are using timers in HS I would however use the HS replacement variable - timers return a TimeSpan rather than a string and formatting those is not as straightforward.

    Code:
    Sub Main(ByVal Parms As Object)
    
    Dim VariableToSend As String = hs.DeviceLastChangeRef(5678).ToString
    
    hs.PluginFunction("Pushover 3P", "", "Pushscript", New Object() {"All Clients", "Offline",""The boiler was on for: $$TIMER:timerName: and last time it was on was: " & VariableToSend, "emergency", "Tug Boat", Nothing, Nothing, "A.I Emergency"})
    
    End Sub
    Worked perfectly
    thank you.
    now i need to see how i can send hebrew characters in the push from a script
    i get blocks instead

    Is there a way to add it to an event via script?
    i can add to event using
    Hs.AddDeviceActionToEvent

    is there something for pushover as well?
    Last edited by ez1976; December 11th, 2017, 06:30 AM. Reason: add more info

    Leave a comment:


  • aj84
    replied
    eesh - I should have done this with a clear head.
    thank you that fixed it

    Leave a comment:


  • Monk
    replied
    Originally posted by aj84 View Post
    Hi all
    I set up a simple event
    IF This device has been/for at least...
    Outside Gates has been On for at least 5 minutes
    Then
    Message Title "Gates are still open"

    Thanks in advance
    Use "EXACTLY" 5 minutes and it won't keep repeating.

    Leave a comment:


  • aj84
    replied
    Hi all
    Just trying this plugin out and on the face of it, its great but I think (being new to HS), I'm not seeing something.

    I set up a simple event
    IF This device has been/for at least...
    Outside Gates has been On for at least 5 minutes
    Then
    Message Title "Gates are still open"

    It kicked in perfectly but sent a constant message every second until I disabled the event altogether.

    I've seen things about timers etc but can't see this option - am I going blind?
    I assume I need to add one or set something so it only sends a single message?

    Thanks in advance

    Leave a comment:


  • mrhappy
    replied
    Originally posted by ez1976 View Post
    Thanks.
    But i would like to add both text and variable as the message in the push.just like if i would do it from an event.
    So it should look like.
    "The boiler was on for: " boilervariable "and last time it was on was: " another-variable.

    The idea us to have a push being sent when a timer is set.
    I'm sorry but I don't quite catch what you mean, the script I posted could be expanded to any number of variables that you want, if you are using timers in HS I would however use the HS replacement variable - timers return a TimeSpan rather than a string and formatting those is not as straightforward.

    Code:
    Sub Main(ByVal Parms As Object)
    
    Dim VariableToSend As String = hs.DeviceLastChangeRef(5678).ToString
    
    hs.PluginFunction("Pushover 3P", "", "Pushscript", New Object() {"All Clients", "Offline",""The boiler was on for: $$TIMER:timerName: and last time it was on was: " & VariableToSend, "emergency", "Tug Boat", Nothing, Nothing, "A.I Emergency"})
    
    End Sub

    Leave a comment:


  • ez1976
    replied
    Originally posted by mrhappy View Post
    Inside a script it can be done (can't be done as an immediate script command) so something like this is how you would do it;

    Code:
    Sub Main(ByVal Parms As Object)
    
    Dim VariableToSend As String = hs.DeviceLastChangeRef(5678).ToString
    
    hs.PluginFunction("Pushover 3P", "", "Pushscript", New Object() {"All Clients", "Offline","Circle Problem: " & VariableToSend, "emergency", "Tug Boat", Nothing, Nothing, "A.I Emergency"})
    
    End Sub
    Thanks.
    But i would like to add both text and variable as the message in the push.just like if i would do it from an event.
    So it should look like.
    "The boiler was on for: " boilervariable "and last time it was on was: " another-variable.

    The idea us to have a push being sent when a timer is set.

    Leave a comment:


  • mrhappy
    replied
    Originally posted by ez1976 View Post
    Hi
    happy to say that this works just fine
    but i would like send a few details list "offline Since" parm(0) "since" timer_value" and etc
    can this be done?
    thanks
    Inside a script it can be done (can't be done as an immediate script command) so something like this is how you would do it;

    Code:
    Sub Main(ByVal Parms As Object)
    
    Dim VariableToSend As String = hs.DeviceLastChangeRef(5678).ToString
    
    hs.PluginFunction("Pushover 3P", "", "Pushscript", New Object() {"All Clients", "Offline","Circle Problem: " & VariableToSend, "emergency", "Tug Boat", Nothing, Nothing, "A.I Emergency"})
    
    End Sub

    Leave a comment:


  • ez1976
    replied
    Originally posted by mrhappy View Post
    Some HTML tags are supported including text colours, see here - https://pushover.net/api#html - so just put the HTML in the message field.

    I am not sure how they follow through to the watch glance messages though, I can't test them.

    As said by others try &nhs but be aware that pir_name is a variable and you are trying to send it by immediate script command which will not have that variable declared. This works for me,

    &nhs.PluginFunction("Pushover 3P", "", "Pushscript", New Object() {"All Clients", "Offline","Circle Problem", "emergency", "Tug Boat", Nothing, Nothing, "A.I Emergency"})
    Hi
    happy to say that this works just fine
    but i would like send a few details list "offline Since" parm(0) "since" timer_value" and etc
    can this be done?
    thanks

    Leave a comment:


  • Freddan101
    replied
    Originally posted by mrhappy View Post
    I'm losing my head here, it works for the normal messages just fine (I was forgetting the leading #). I should've read your post a bit closer, the API for glance messages does not explicitly say that it supports any HTML so as such I didn't include that option - https://pushover.net/api/glances

    I'm more than happy to add functionality if it is supported however the only people that know are pushover, if you want to ask them and see what they say then if they say that they are or they will add support I can make a change to the plugin.
    I sent them a question today. Let's see what they come back with.

    Leave a comment:


  • mrhappy
    replied
    Originally posted by mrhappy View Post
    Hold fire I think there may be a bug in the plugin as it is no longer working for normal messages either and it should do. I will take a look.
    I'm losing my head here, it works for the normal messages just fine (I was forgetting the leading #). I should've read your post a bit closer, the API for glance messages does not explicitly say that it supports any HTML so as such I didn't include that option - https://pushover.net/api/glances

    I'm more than happy to add functionality if it is supported however the only people that know are pushover, if you want to ask them and see what they say then if they say that they are or they will add support I can make a change to the plugin.

    Leave a comment:


  • mrhappy
    replied
    Originally posted by Freddan101 View Post
    I sent <font color="#0000ff">$$DSR:847:</font> but sad to say that the whole tag was printed out in the glance message. Maybe I should give Pushover support a try and see if this is a limitation in the Apple Watch or in Pushover.
    Hold fire I think there may be a bug in the plugin as it is no longer working for normal messages either and it should do. I will take a look.

    Leave a comment:


  • Freddan101
    replied
    Originally posted by mrhappy View Post
    Some HTML tags are supported including text colours, see here - https://pushover.net/api#html - so just put the HTML in the message field.
    I sent <font color="#0000ff">$$DSR:847:</font> but sad to say that the whole tag was printed out in the glance message. Maybe I should give Pushover support a try and see if this is a limitation in the Apple Watch or in Pushover.

    Leave a comment:

Working...
X