Pushover Plugin - push notifications

Posted on
Sat Feb 23, 2019 11:37 am
Dual offline
Posts: 255
Joined: Feb 05, 2019

Re: Pushover Plugin - push notifications

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!

Posted on
Tue Mar 26, 2019 12:36 am
Dual offline
Posts: 255
Joined: Feb 05, 2019

Re: Pushover Plugin - push notifications

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

Posted on
Tue Mar 26, 2019 7:38 am
FlyingDiver online
User avatar
Posts: 7189
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Pushover Plugin - push notifications

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.

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Tue Mar 26, 2019 8:15 am
Dual offline
Posts: 255
Joined: Feb 05, 2019

Re: Pushover Plugin - push notifications

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

Posted on
Tue Jul 02, 2019 1:11 am
Dual offline
Posts: 255
Joined: Feb 05, 2019

Re: Pushover Plugin - push notifications

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

Posted on
Tue Jul 02, 2019 2:27 am
racarter offline
User avatar
Posts: 468
Joined: Jun 18, 2016
Location: North Yorkshire, UK

Re: Pushover Plugin - push notifications

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)

Posted on
Tue Jul 02, 2019 8:17 am
whmoorejr offline
User avatar
Posts: 762
Joined: Jan 15, 2013
Location: Houston, TX

Re: Pushover Plugin - push notifications

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.

Bill
My Plugin: My People

Posted on
Tue Jul 02, 2019 8:28 am
whmoorejr offline
User avatar
Posts: 762
Joined: Jan 15, 2013
Location: Houston, TX

Re: Pushover Plugin - push notifications

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)

Bill
My Plugin: My People

Posted on
Tue Jul 02, 2019 8:55 am
FlyingDiver online
User avatar
Posts: 7189
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Pushover Plugin - push notifications

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

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Thu Apr 16, 2020 12:44 am
davinci offline

Re: Pushover Plugin - push notifications

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'))

Posted on
Thu Apr 16, 2020 1:43 am
Dual offline
Posts: 255
Joined: Feb 05, 2019

Re: Pushover Plugin - push notifications

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

Posted on
Thu Apr 16, 2020 1:46 am
vtmikel offline
Posts: 628
Joined: Aug 31, 2012
Location: Boston, MA

Re: Pushover Plugin - push notifications

The api is down due to a DoS attack.


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




Sent from my iPad using Tapatalk Pro

Posted on
Wed Sep 09, 2020 5:57 pm
Dual offline
Posts: 255
Joined: Feb 05, 2019

Re: Pushover Plugin - push notifications

I have a recurring error from Pushover in my log:

Code: Select all
2020-09-08 00:00:06.673   Pushover Error   Error in plugin execution ExecuteAction:

Traceback (most recent call last):
  File "plugin.py", line 121, in send
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc2 in position 25: ordinal not in range(128)


It appears to be due to the degrees symbol included in my Pushover message:
Code: Select all
1.112 kWh energy used
83 °F west temperature


I am using the latest version of Pushover from the Plugin store 1.5.3.

I checked on GitHub (I am not a user of GitHub nor knowledgable re GitHub) and see Issue #26 fix - unicode error ... @FlyingDiver committed on Apr 27, 2019. There is a Release 1.5.4 @FlyingDiver released this on Apr 27, 2019. It is labelled Pre-release.

I am guessing the fix by @FlyingDiver would correct my problem. Why is it pre-release and not available from the Indigo Plugin Store? Can I download it from GitHub somehow and use it with Indigo, replacing version 1.4.3? How do I do this?

Cheers

John

Posted on
Wed Sep 09, 2020 6:00 pm
FlyingDiver online
User avatar
Posts: 7189
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Pushover Plugin - push notifications

Dual wrote:
I checked on GitHub (I am not a user of GitHub nor knowledgable re GitHub) and see Issue #26 fix - unicode error ... @FlyingDiver committed on Apr 27, 2019. There is a Release 1.5.4 @FlyingDiver released this on Apr 27, 2019. It is labelled Pre-release.

I am guessing the fix by @FlyingDiver would correct my problem. Why is it pre-release and not available from the Indigo Plugin Store? Can I download it from GitHub somehow and use it with Indigo, replacing version 1.4.3? How do I do this?

Cheers

John


Just go to the Releases section of the GitHub project and download it from there.

I expect I was waiting on testing feedback and no one ever got back to me on it. Let me know if you have any issues.

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Wed Sep 09, 2020 7:16 pm
Dual offline
Posts: 255
Joined: Feb 05, 2019

Re: Pushover Plugin - push notifications

I downloaded and installed the 1.5.4 version.

My notification ran at the top of the hour error free.

Thanks @FlyingDiver for the fix and the help on how to get it from GitHub.

Cheers

John

Who is online

Users browsing this forum: No registered users and 0 guests