Page 13 of 13

Re: Pushover Plugin - push notifications

PostPosted: Sat Feb 23, 2019 11:37 am
by Dual
dduff617 wrote:
if your energy meter usage value is a property of an indigo device, then you can use the syntax "%%d:nnnnnn:stateid%%", where you would replace "nnnnnn" with the numeric deviceID and "stated" with the name of the state.


Exactly what I needed. Thanks!

Re: Pushover Plugin - push notifications

PostPosted: Tue Mar 26, 2019 12:36 am
by Dual
FlyingDiver wrote:
If it's a device state, then you can do that substitution as well.


Is there a link to a list of all possible substitutions and their syntax? A user manual of sorts?

Cheers

John

Re: Pushover Plugin - push notifications

PostPosted: Tue Mar 26, 2019 7:38 am
by FlyingDiver
Dual wrote:
Is there a link to a list of all possible substitutions and their syntax? A user manual of sorts?


There's only variable substitutions and device state substitutions, both of which are described in the last few posts in this thread.

Re: Pushover Plugin - push notifications

PostPosted: Tue Mar 26, 2019 8:15 am
by Dual
FlyingDiver wrote:
There's only variable substitutions and device state substitutions, both of which are described in the last few posts in this thread.

Thanks! Pushover is awesome. I am using it extensively. Great plugin!


Sent from my iPhone using Tapatalk

Re: Pushover Plugin - push notifications

PostPosted: Tue Jul 02, 2019 1:11 am
by Dual
When entering my message in the Message field how do I include a carriage return (line feed) in my message so I can delineate my message across several lines?

John


Sent from my iPhone using Tapatalk

Re: Pushover Plugin - push notifications

PostPosted: Tue Jul 02, 2019 2:27 am
by racarter
I don't know of a way to do it via the plugin menu dialogue, but you can do it in a Python script:

Code: Select all
alertPlugin = indigo.server.getPlugin('io.thechad.indigoplugin.pushover')
if alertPlugin.isEnabled():
   msgTitle = "Test"
   message = "Hello\nsailor"
   try:
      alertProps = {'msgTitle':msgTitle, 'msgBody':message, 'msgSound':'pushover', 'msgPriority':0, 'msgDevice':'', 'msgSupLinkUrl':'', 'msgSupLinkTitle':''}
      alertPlugin.executeAction("send", props=alertProps)
   except:
      indigo.server.log('Message send error', isError=True)
else:
   indigo.server.log('Pushover plugin not available', isError=True)

Re: Pushover Plugin - push notifications

PostPosted: Tue Jul 02, 2019 8:17 am
by whmoorejr
If you have a multi-line text field saved as a variable, you can use that variable in the pushover message and it will do the carriage returns.

If you are going to have to write a script to build the variable first, either include sending the pushover message from that script or add a slight delay to allow the script to run before the pushover plugin fires.

Most of my pushover actions are currently done via python script outside of the plugin so I can segregate my notifications by type. I've created Application APIs for various subjects (Climate, Security, Network, Motion, Access Control, etc.)

This is one I use with the Fing plugin to notify me via email, pushover and indigo log entry when a new device joins my network. (I stole this from someone else on the forum... credit to that guy :lol: )

Code: Select all
ipDev = indigo.variables["ipDevsNewDeviceNo"]
ipDevVarNumber = ipDev.value.split(";")[0]
devName = ipDev.value.split(";")[1]
dev = indigo.devices[devName]
st = dev.states # shortcut

theSubject = "New device on network: " + st["ipNumber"]
theBody  = "New device on network: "  + st["ipNumber"]     +"\n"
theBody += "MACNumber: "            +st["MACNumber"]       +"\n"
theBody += "hardwareVendor: "       +st["hardwareVendor"]  +"\n"
theBody += "indigoID: "             +str(dev.id)           +"\n"
theBody += "Name : "                +devName               +"\n"

indigo.server.log(theBody)# also send it to the indigo log file

indigo.server.sendEmailTo("YourEmail@gmail.com", subject=theSubject, body=theBody)

import requests
r = requests.post("https://api.pushover.net/1/messages.json", data = {
  "token": "ApplicationToken", #your application token, I used a specific one for network
  "user": "YourPushoverUserNumber",
  "message": theBody
})
print(r.text)


I hope that helps. FYI, I never figured out how to do a pushover subject line via python.... my script only captures the subject line for the email part of my script.

Re: Pushover Plugin - push notifications

PostPosted: Tue Jul 02, 2019 8:28 am
by whmoorejr
Here is another example (used for letting me know if the thermostat setting change) that creates the message by combining different variable. (of course this references my variables and you'd have to change that)

Code: Select all
#Build the message
import datetime
Time = "{date:%H%:%M}".format(date=datetime.datetime.now())
DTG = u"{}_{}".format(Time, Title)

theMode = indigo.variables[143562231].value
isCool = indigo.variables[285071090].value
isHeat = indigo.variables[1231095420].value
Temp = indigo.variables[796298002].value

TheMessage = '%s\n%s at %s\n%s is %s\n%s is %s\n%s is %s' % ("Thermostat Mode Change", theMode, Time, "Cool Setpoint", isCool, "Heat Setpoint", isHeat, "Current Temp", Temp)

indigo.variable.updateValue(195713191, value=TheMessage) # I used this line for testing to see if it was building a message or error-ing out.

#Send Pushover message
import requests
r = requests.post("https://api.pushover.net/1/messages.json", data = {
  "token": "YourApplicationToken", # I used a specific application token for climate
  "user": "YourPushoveUserID",
  "message": TheMessage
})
print(r.text)

Re: Pushover Plugin - push notifications

PostPosted: Tue Jul 02, 2019 8:55 am
by FlyingDiver
Dual wrote:
When entering my message in the Message field how do I include a carriage return (line feed) in my message so I can delineate my message across several lines?


Please file an enhancement request for a multi-line message text field: https://github.com/IndigoDomotics/indig ... ver/issues

Re: Pushover Plugin - push notifications

PostPosted: Thu Apr 16, 2020 12:44 am
by davinci
The plugin is not working anymore for me. Seems like a connection error.
Pushover works over the website directly.

I'm running the latest version 1.5.4.

Pushover Error Error in plugin execution ExecuteAction:

Traceback (most recent call last):
File "plugin.py", line 114, in send
File "/Library/Application Support/Perceptive Automation/Indigo 7.4/IndigoPluginHost.app/Contents/Resources/PlugIns/requests/api.py", line 111, in post
File "/Library/Application Support/Perceptive Automation/Indigo 7.4/IndigoPluginHost.app/Contents/Resources/PlugIns/requests/api.py", line 57, in request
File "/Library/Application Support/Perceptive Automation/Indigo 7.4/IndigoPluginHost.app/Contents/Resources/PlugIns/requests/sessions.py", line 477, in request
File "/Library/Application Support/Perceptive Automation/Indigo 7.4/IndigoPluginHost.app/Contents/Resources/PlugIns/requests/sessions.py", line 587, in send
File "/Library/Application Support/Perceptive Automation/Indigo 7.4/IndigoPluginHost.app/Contents/Resources/PlugIns/requests/adapters.py", line 467, in send
ConnectionError: ('Connection aborted.', error(54, 'Connection reset by peer'))

Re: Pushover Plugin - push notifications

PostPosted: Thu Apr 16, 2020 1:43 am
by Dual
I have a message sent via Pushover every hour. It has failed intermittently over the past several weeks. Yesterday 20 messages succeeded and 4 failed.


Sent from my iPhone using Tapatalk

Re: Pushover Plugin - push notifications

PostPosted: Thu Apr 16, 2020 1:46 am
by vtmikel
The api is down due to a DoS attack.


https://twitter.com/pushoverapp/status/ ... 48416?s=21




Sent from my iPad using Tapatalk Pro