Pushing Images with Pushover 3.0

Thanks @b4dpxl and @sdc… creating a manifest.json file did the trick.

Still having problems with the Pushover custom component. I get the error “attachment: invalid message parameter”. It did work before 0.92 version. These are my settings:

manifest.json

{
  "domain": "pushover_file",
  "name": "pushover_file",
  "documentation": "https://home-assistant.io/components/notify.pushover/",
  "dependencies": [],
  "codeowners": [],
  "requirements": ["python-pushover==0.4"]
}

notify.py

The raw version from this site:
https://raw.githubusercontent.com/brkr19/home-assistant/dev/homeassistant/components/notify/pushover.py

configuration.yaml

whitelist_external_dirs: 
  - /tmp
  - /config/www/tmp

notify:
  - platform: pushover_file
    name: pushover_file
    api_key: !secret pushover_api
    user_key: !secret pushover_user

automation:

- id: '155567345345'
  alias: Camera Snapshot Back South Side
  trigger: []
  condition: []
  action:
  - data:
      entity_id: camera.back_south_side
      filename: /config/www/tmp/back_south_side.jpg
    service: camera.snapshot
  - data:
      data:
        priority: 0
        sound: pushover
        file:
          path: /config/www/tmp/back_south_side.jpg
      message: Camera Back South Side
      title: Camera Snapshot
    service: notify.pushover_file

Try adding an empty __init__.py in your pushover_file folder. It worked for me.

Orson did try that too, but with no success.

Ok I just experienced a weird problem this morning with the custom component. So last night I restarted Home Assistant, and this morning the custom component didn’t work. It gave me the “attachment: invalid message parameter” error. I thought it was strange cause I hadn’t done any modifications to the automation that uses that custom pushover component, so I thought ok lemme just try to restart again and it magically started working after the restart. I’m on 0.92.1. I’m going to try and reproduce the problem.

For some reason the pushover is working again. Sometimes when i do some config changes unrelated with Pushover i will stop working and after a host reboot it works again. Lets hope they can integrate the latest version of Pushover into hassio. Thank you orson1282 for you assistance.

I dug in a little more and it looks like they moved the version requirements to manifest.json on April 3 (https://github.com/home-assistant/home-assistant/pull/22699) so that’s why it’s reverting back to v3.0. (Thanks @b4dpxl for figuring out a fix!)

I’ve updated my code and am running it locally right now. I’ll try to get it merged back into my fork with the latest hass code and will post back here when that’s done. Otherwise, manually updated the manifest.json file will do the trick as shown above.

After that, I’ll give this one last attempt in another PR to see if we can just get this moved into the main code.

3 Likes

i use lke this

automation:
  - alias: familyroom camera trigger
    initial_state: 'on'
    trigger:
      - platform: state
        entity_id:
         - binary_sensor.smoke_detector_6
         - binary_sensor.smoke_detector_7
         - binary_sensor.smoke_detector_8
        to: 'on'
    # condition:
      # - condition: state
        # entity_id: alarm_control_panel.ha_alarm
        # state: armed_away
    action:
      - service: camera.snapshot
        data:
          entity_id: camera.familyroom
          filename: '/tmp/camera_snapshot_familyroom.jpg'
      - service: notify.me
        data_template:
          message: '{{ trigger.to_state.attributes.friendly_name }} has been triggered'
        data:
          title: 'Alarm'
          data:
            priority: 1
            # sound: siren
            file:
              path: '/tmp/camera_snapshot_familyroom.jpg'
      - delay:
            seconds: 2

Hi! I had a version of notify.py for pushover that I believe came from you, and allowed specifying a url to an image. (Like for a camera.)

Can you post a link to your code so I can use it as a custom component while you battle trying to get your PR accepted? Thanks!

Can you share your .py file again please. Isn’t available on github anymore. Thanks

Ok, try this one: https://raw.githubusercontent.com/brkr19/home-assistant/dev/homeassistant/components/pushover/notify.py

3 Likes

Is everyone still using notify.py as a custom component? I just tried this on the newest version of Home Assistant 0.93.1 and can’t send an image through pushover with it.

It never really worked right for me. It would work some days and others it just wouldn’t, it gave attachment invalid error message. After a few restarts it would work again and so on. So I reverted back to the stock pushover component. I hope someone is still working on getting this working/official.

I’m still using the custom component provided in this thread. It works for me 100% of the time.

I’m very interested to know what version you’re running and how you have it setup… can you please share your config?

I override the base component with the custom_component, and then the only setup I have is:

notify:
  - name: pushover
    platform: pushover
    api_key: !secret pushover_api
    user_key: !secret pushover_user

Then I use notify.pushover in node-red like:

{
    "data": {
        "file": {
            "path": "/tmp/snapshot_camera.foscam_camera"
        }
    },
    "message": "Garage door activity: inside",
    "title": "title here"
}

In a previous node I save a snapshot to that path, obviously.

Ok, that’s pretty much what I did, except I didn’t override the base component, I named it custom_pushover. I’m going to try it later by overriding the base pushover. Thanks.:+1:

I did this and it works, thanks!

How do you do to override the base component on hass.io? Thanks

3 days later and it’s still working. looks like overriding it did the trick, thanks @moralsnipe.

@pollinolas in order to override a built-in component just give the folder the same name as the built-in component, so for this it would be: /custom_components/pushover


https://developers.home-assistant.io/docs/en/creating_component_loading.html

1 Like