Latest API version for Pushover allows to attach images, how can we get this new feature onboard? More info https://updates.pushover.net/post/170043375237/pushing-images-with-pushover-30
@xtianpaiva you hear any updates on this? Iād love to be able to use this in my setup for push image notification on my front doorbell.
Hi, same project here, still waiting, maybe we can have news with the next HA update.
Any more news about this feature? Would like to use it for my doorbell.
Is anyone else already working on this? If not, I figured Iād give it a shot.
I have this working locally and have tested it by attaching an image like ā/local/xyz.pngā (www directory) as well as from a security camera with basic auth. Iām working through cleaning it up and testing the edge cases but will get this submitted as soon as I can.
I would be very interested in this as well, would you like to share the code?
I just submitted a pull request for this (#13748), but you can find my updated code here if youād like to test it locally: https://github.com/brkr19/home-assistant/blob/dev/homeassistant/components/notify/pushover.py
Edited to fix the repository in the url
Great job! What platform do you use? Iām running HA on docker, do you know how I would test it on there?
Iām just learning Docker myself, but I added this to my docker run
command to use my local source dir instead: -v /home/brkr19/opt/home-assistant:/usr/src/app
(so my local source dir was in ~/opt/home-assistant). Thereās probably a better way, but this was what worked for me while doing frequent code changes and testing.
Great, thanks
Hi, @brkr19 It seems that your pull request is now Live. could you update the documentation how we should use it?
i have tried a few things but i didnāt manage to get it working.
{ āmessageā: āTest pluginā,
āfilenameā: { āurlā:ā5 Vorteile der Mediation fĆ¼r Fahrradfahrer ā GBSun ā Sommer, Sonne, Fahrradā
} }
{ āmessageā: āTest pluginā,
āattachmentā: { āurlā:ā5 Vorteile der Mediation fĆ¼r Fahrradfahrer ā GBSun ā Sommer, Sonne, Fahrradā
} }
Hmm, thatās strange - last I saw, it was rejected due to the desire to continue using the third-party library instead of the APIs directly. I actually had a PR for the documentation too, but then had to roll that back.
Hereās an example in case it is actually live though:
- alias: Garage motion detected
trigger:
platform: state
entity_id: sensor.garage_motion
from: '0'
to: '1'
condition:
- condition: state
entity_id: input_boolean.security_armed
state: 'on'
action:
- service: notify.pushover
data_template:
message: "Security system: Motion in Garage!"
data:
title: "Home Assistant"
data:
priority: 1
sound: siren
file:
url: !secret cam_garage_latest_url
auth: basic
username: !secret cam_garage_username
password: !secret cam_garage_password
did your code every get rolled in home assistant to support images?
looks like the 3rd party library supports it, Iām no developer though
https://pushover.net/faq#library-python
Alternatively, the 3rd party pushnotify Python package written by Jeffrey Goettsch, the pushover Python 3 package written by Wyatt Johnson, and the Chump Python package written by Karan Lyons are available.
To send an image attachment, the 3rd party Requests library can be used. For example, to send the file āyour_image.jpgā:
import requests
r = requests.post(āhttps://api.pushover.net/1/messages.jsonā, data = {
ātokenā: āAPP_TOKENā,
āuserā: āUSER_KEYā,
āmessageā: āhello worldā
},
files = {
āattachmentā: (āimage.jpgā, open(āyour_image.jpgā, ārbā), āimage/jpegā)
})
print(r.text)
I just updated my code here: 6f354e6. Iāll be testing it and creating a new PR soon, but in the meantime, feel free to grab this code for now.
How can I modify original pushover.py?
Itās best not to edit the original files. I used the custom_components method described here; https://community.home-assistant.io/t/editing-component-files-in-hassio/24273
So I took the new pushover.py from @brkr19 and placed it in config/custom_components/notify
Works like a charm (reboot ofcourse) really happy, thanks a lot @brkr19
Iām trying to have my camera image sent to Pushover but still, with the custom component, have issues.
Could you share you automation lines so I can compare?
thanks
nobody can help?