I use portainer and opened a console session on the home assistant container and ran the command.
Your explanation and portainer helped solve the problem. HassOS 2.11 v0.94.4, sending images again working.
I just upgraded to 0.95 and it looks like I still need to run the command with this version.
pip3 install --upgrade python-pushover
Anyone know when it will be bundled into the normal releases?
Thank you!! I was pulling my head (I am bald) with this! Thanks for the link, after I installed it on the custom_components folder, I started getting the new messages with pictures attached!
Great!!!
Am running Pushover on Hass.io ver 0.95.4 without docker. I used Portainer Hassio addon to access the root, and than run the command. And it works !
Powefull App handle with care.
pip3 install --upgrade python-pushover
I need install portainer then? Container console is installed by default?
Yes. In the portainer quide you will see how to unhide the Home assistant Container.
Known issues and limitations
By default all Hass.io managed containers are hidden from Portainer. This is recommended since fooling around with Hass.io managed containers can easily lead to a broken system.
Access to these containers can be gained by going into Portainer -> Settings -> Hidden containers. Then delete the listed hidden labels (io.hass.type labels). Only do this if you know what youāre doing!
right now its working again,thaks a lot everyone for help
it looks like this has been officially added in the next release
Add ability to send attachments in pushover notifications (#24806)
Itās been officially added in the 0.96.0 release and itās working! Thanks to the devs.
Note that the new component is not directly compatible with the version that had been floating around before. The new implementation can be called like this from the Developer / Services pane in the UI:
{
"message":"test",
"title":"Title Here",
"data":{
"attachment": "/config/www/snaps/cam5.jpg",
"html": "1",
"sound" : "bike"
}
}
This new component sniffs at the front of the attachment
string for a http
prefix to figure out if itās a URL that needs to be retrieved; or if itās just a plain file name. Itās too bad that the documentation doesnāt show an example of how to send an attachment, and rather show usage of a url:
parameter that just sends along a URL associated with the message, and not an actual image or whatever.
Also note that āattachmentā should specify the actual file or URL itself, not another dictionary that specfied āfileā or āurlā as previously.
As a more complete example for people from the future, Iām using it like this:
- alias: doorbell fired
initial_state: true
trigger:
- platform: state
entity_id: input_boolean.doorbell_button
to: 'on'
action:
- service: camera.snapshot
data:
entity_id: camera.cam5
filename: "/config/www/snaps/cam5.jpg"
- service: notify.pushover_louie
data_template:
message: 'Doorbell rung at {{ now().strftime("%l:%M:%S %p (%a)") }} <a href="https://example.com/local/snaps/cam5.jpg">cam5</a> <a href="https://example.com/local/snaps/cam6.jpg">cam6</a>'
title: "HASS"
data:
attachment: /config/www/snaps/cam5.jpg
html: "1"
sound: "bike"
- service: camera.snapshot
data:
entity_id: camera.cam6
filename: "/config/www/snaps/cam6.jpg"
Where I send a notification with a grabbed image from one of the cameras at the time the automation fires, and links to two cameras if I want to look at at either/both images later. While my twisted needs here might not apply to your circumstances, I thought a real-life example would be helpful.
As an asideā¦ whatās interesting is that the camera.snapshot
service seems to be synchronous; when the next step in the automationās script is processed, the file has actually been created and saves. So you can reference that file in the pushover notification service call. Iāve found this not to be the case when you tell a āstreamingā camera to record, e.g., 15 seconds of video. That seems to kick some parallel activity off and the next action in the script will be invoked. This surprised me; maybe someone else can avoid learning this the hard way.
forgive me for not understanding you very well, do you want to say that the new component mentioned above is not capable of sending images?, just a url like the previous one
@pollinolas, no the new component can send images.
Itās just that thereās only one dictionary key, attachement:
thatās used to specify either a file name or a URL. It distinguishes the difference by looking for a leading http
string prefix on the attachment:
specifiction; if it is present, then it uses it as a URL; otherwise it treats it as a local file name.
Note that the prefix it looks for, http
would match either an http://foo.com/ or an https://bar.com/ style URL.
Iāve not actually tried to use it as a URL (since that wasnāt necessary for my purposes), just noticed that by inspection of the python code, specifically these lines of code: core/homeassistant/components/pushover/notify.py at a6e3cc6617f76ae50443ac8299276ebb0f83b704 Ā· home-assistant/core Ā· GitHub
If you just try to use your existing configuration, whereby attachment:
references either a URL or a file name, youāll get a an unusual error since the attachment wonāt be a string, but a dictionary with the older style configuration. This is what led me to look at the code to try to understand what was going on.
working good with native component,thanks to Imamakos for show the example and clarify my doubts
Thank you! I finally upgraded home assistant (a few versions behind) and the custom component stopped working. Glad itās finally official.
Hey, no thanks to me for getting the component in! I just figure out how to make it go; the heavy lifting of working the submission through the process was done by someone else. But I join you in being real happy this has happened!
The thanks should go to https://github.com/kreegahbundolo who submitted the pull request
I have a problem using variables.
So i have an automation that uses camera.snapshot to write filename (this works fine):
filename: /share/yi_snapshot_{{now().strftime('%Y%m%d-%H%M%S')}}.jpg
and then want to use this same image in the notify.pushover using attachment:
attachment: /share/yi_snapshot_{{now().strftime('%Y%m%d-%H%M%S')}}.jpg
This is not working when a {{}} is in the attachment name. Maybe it is then confused by a url or something? Anybody an idea?