Send picture to pushbullet

Hi,

I’m new with HA, and still learning. This is my first post. :slight_smile:
I’m trying to send a picture from local folder (RP3) to pushbullet using notification.

The title & message were successfully sent & I could see them in pushbullet.
But the picture is not sent/attached to pushbullet. I’ve tried various combination, but still cannot get it to work.

My code is as below:
action:
- service: notify.mypushbullet
data:
title: “Test”
message: “See attached picture”
data:
file: /home/homeassistant/.homeassistant/picture1.jpg

Can I get some help here? Thanks a lot

Cheers,

I don’t think you can send pictures to Pushbullet from HA (unless something has changed recently).

Try Telegram.

1 Like

If you are using dev branch, you can send file and there’s a commit for file_url also (can be any web address).

I was using the file send feature with this in my configuration.yaml:

homeassistant:
whitelist_external_dirs:
- /tmp

Hi mouth4war,

I’ve applied your recommendation and it’s working now; I can send pictures to pushbullet.
Thanks.

Regards,

@mouth4war @padi

Hi, could you please elaborate? Does this only work on the “dev branch”? and what is the absolute path for /tmp, does this folder reside in the same location as configuration.yaml?

Additionally, do you know if whitelist_external_dirs: is a recent addition, I’m still at 0.47, and cannot upgrade. I get the following error when adding

Whitelist_external_dirs:
– /tmp

(MainThread) [homeassistant.config] Invalid config for [homeassistant]: [whitelist_external_dirs] is an invalid option for [homeassistant]. Check: homeassistant->whitelist_external_dirs. (See /home/homeassistant/.homeassistant/configuration.yaml, line 3).

All sorted. It’s because I was using an older version of HA. Manually updated pushbullet.py and it works.

I got this mostly working on my build. I’m using Hassio AIO installer. I’m trying to send a message and picture to my device and an email. I can send just a message to both, and a picture to just my device, but I can’t send a picture and message to both. When I try I just get two messages to my device. Any ideas?? Here is my automation:

- action:
  - data:
    data:
      file: /config/www/hik.jpg
    message: Test message
    target:
    - device/myphone
    - email/[email protected]
  service: notify.pushbullet
alias: notify_test
condition: []
id: 'xxxxxxxxxx'
trigger:
- entity_id: switch.xmas_tree
  from: 'off'
  platform: state
  to: 'on'

It works if I push to a channel and my device, or just a channel, but not to an email (alone or with anything else).

I’m looking at the source code, and it doesn’t look like the email address is getting passed to the pushbullet api when a file is present. Am I overlooking something? https://github.com/home-assistant/home-assistant/blob/79240a0d47fe4b9e414ac98a2f501ae68c3fcc05/homeassistant/components/notify/pushbullet.py#L148

@gremblin i was able to send a picture from a url, but not amble to send a picture from the HA, i got this error

[homeassistant.components.notify.pushbullet] Filepath is not valid or allowed, my config is

  • action:
    data_template:
    message: Test message
    data:
    file: /home/homeassistant/.homeassistant/snapitcu.jpg
    service: notify.pushbullet
    alias: notify_test
    condition: []
    id: ‘15443234324’
    trigger:
    • entity_id: switch.xmas_tree
      from: ‘off’
      platform: state
      to: ‘on’

Based on the error it sounds like either the file path is not valid (so obviously make sure that it’s correct). I don’t have that filepath. I’m running HASSIO all in one installer, and the file tree is a bit different.

Or the file path is not allowed… you may need to add that file path to the “whitelist” as noted at the bottom of the Pushbullet component page: https://home-assistant.io/components/notify.pushbullet/

homeassistant:
  whitelist_external_dirs (Optional): List of folders that can be used as sources for sending files.

I haven’t used this before. I’m pretty new with HA. I’d assume that you just enter the file path there not in quotes. So I’d probably try something like this in my config file under your “homeassistant”:

homeassistant:
  latitude: 32.87336
  longitude: 117.22743
  elevation: 430
  unit_system: metric
  time_zone: America/Los_Angeles
  whitelist_external_dirs: /home/homeassistant/.homeassistant/

obviously not adding a second “homeassistant:” to your config. just adding it to the bottom of the list. https://home-assistant.io/docs/configuration/basic/

Hope this helps!

Also. Did you add that same switch.xmas_tree that you have listed under your trigger? Cause if not, you might get an error there as well.

2 Likes

@gremblin the whitelist_external_dirs did the job, the switch.xmas_tree was only for testing purposes, thanks for you help.

cool :metal: glad i could help

@gremblin Helped me as well, thank you! Now I’ve got my Ip-cameras sending me picture notification when my PIR-sensor detects movement :smiley:.

Anyone know if it’s possible to save a file on another host on the network?