Hi Homeassistant Community

I’m having some issues pushbullet - notify. I can send text, but I’m trying to send a file. I have followed the config example to the letter, https://home-assistant.io/components/notify.pushbullet/

I tried both “File support” and the example for “File URL support”, both of these do not send the data, I still receive the message. “URL support” works correctly and sends a hyperlink.
url: google.com

No errors are logged either. I have checked permissions on the last example, homassistant has r/w privileges.

- service: notify.homemessage
    title: Send file
    message: This is a file URL
      file_url: https://cdn.pixabay.com/photo/2014/06/03/19/38/test-361512_960_720.jpg

- service: notify.dringhouse
    message: Drive Way Line Crossing
      file: "/home/homeassistant/.homeassistant/scripts/cameraimages/driveway.jpg"


Fixed. Refer to Send picture to pushbullet

Do you mind sharing your script for getting the camera images?

Not at all,

I use command line to run a python script to save the images to a file.

– platform: command_line
command_on: “python /home/homeassistant/.homeassistant/scripts/savecameraimages.py”
command_off: “”

The savecameraimages.py contains, (Note: Make sure that the folder containing the images has the correct permissions so that homeassistant can access them)

import urllib
urllib.urlretrieve(“http://user:[email protected]:80/Streaming/channels/1/picture”, “/home/homeassistant/.homeassistant/scripts/cameraimages/frontdoor.jpg”)
urllib.urlretrieve(“http://user:[email protected]:80/Streaming/channels/1/picture”, “/home/homeassistant/.homeassistant/scripts/cameraimages/driveway.jpg”)

Using a script I toggle the command line “switch”, (there’s probably a neater way to do this)

- service: switch.turn_on
entity_id: switch.saveAllImages
- service: switch.turn_off
entity_id: switch.saveAllImages

Finally, the push bullet part of the code, (automation, using HIKVision Cameras)

– alias: ‘Drive Way Notifications’
- platform: state
entity_id: binary_sensor.driveway_line_crossing
to: ‘on’
- service: script.capture_cameras
- service: notify.home
message: Drive Way Line Crossing
file: “/home/homeassistant/.homeassistant/scripts/cameraimages/driveway.jpg”

Thank you.

Just tried to set it up but getting the following error:

2017-09-07 05:35:52 ERROR (Thread-4) [homeassistant.components.switch.command_line] Command failed: python /home/homeassistant/.homeassistant/scripts/savecameraimages.py

2017-09-07 05:35:52 ERROR (MainThread) [homeassistant.core] Invalid service data for notify.pushbullet: extra keys not allowed @ data[‘file’]. Got ‘/home/homeassistant/.homeassistant/scripts/cameraimages/frontdoor.jpg’

You’ve got an error in the savecameraimages.py file,

Make sure you have not put a tab in the file. if you are using notepad ++ to write the file, you can search for “\t”, selecting Search Mode: Extended.

Make sure that in your main home assistant directory you have a file called scripts (containing savecameraimages.py) and a folder where the images are saved, if you used the same as I did, make sure there is a folder cameraimages in scripts.

Also, the pushbullet file: reference is image location,

In the automation sequence, first the commandline script is called " - service: script.capture_cameras" , followed by the pushbullet code which grabs the image that was just created.


It’s definitely something to do with the python script.

import urllib
urllib.urlretrieve (“http://admin:[email protected]:80/Streaming/channels/1/picture”, “/home/homeassistant/.homeassistant/cameraimages/frontdoor.jpg”)

2017-09-07 07:06:55 ERROR (Thread-4) [homeassistant.components.switch.command_line] Command failed: python /home/homeassistant/.homeassistant/python_scripts/savecameraimages.py

Any ideas?

I suggest doing the following,

  1. Try running the command out of home assistant,
    At a putty session, type python /home/homeassistant/.homeassistant/python_scripts/savecameraimages.py

See if that gives you any additional info.

  1. Double check the permissions and manually assign them on the folder. at a prompt type,
    namei -l /home/homeassistant/.homeassistant/cameraimages.

You should have read/write access for homeassistant. If you do not just give all users access,

sudo chmod 777 /home/homeassistant/.homeassistant/cameraimages

Also, I noticed that you have it stored in python_scripts, that is used for the homeassistant service called python scripts… it may be affecting it?, try a different folder. It would be a lot easier if imports worked for homeassistant python_scripts, but unfortunately we have to call these scripts via a commandline.

  1. /home/homeassistant/.homeassistant/python_scripts/savecameraimages.py
    File “”, line 1
    SyntaxError: invalid syntax

  2. f: /home/homeassistant/.homeassistant/cameraimages
    drwxr-xr-x root root /
    drwxr-xr-x root root home
    drwxr-xr-x homeassistant homeassistant homeassistant
    drwxr-xr-x homeassistant homeassistant .homeassistant
    drwxr-xr-x root root cameraimages

  1. /home/homeassistant/.homeassistant/scripts/savecameraimages.py
    File “”, line 1
    SyntaxError: invalid syntax

I’m truthfully sorry, but I’m a real noob when it comes to scripting.

Something is not correct in savecameraimages.py, permissions are correct.

What editor do you use? Screenshot below.

Also, what cameras are you using? Check that typing the URL into a web browser shows the camera image.

Hikvision, tested in browser and vlc prior.


Moved it to scripts folder, but same issue.

Very odd, the file looks correct. I assume you are running this on a RPi? Is the RPi in the same subnet as the camera? Maybe it cannot access the camera? Can you ping the IP from the RPI?

Also, to rule out the cameras, replace the camera entry with this, it should download the image and place it in the folder instead of your camera. You can then rule out one of the possible causes.


Yes, Hassbian on Pi3.

Both on same subnet, cameras are integrated in HA for video and various sensors.

Same error with https://cdn.pixabay.com/photo/2014/06/03/19/38/test-361512_960_720.jpg

2017-09-07 08:00:18 ERROR (Thread-3) [homeassistant.components.switch.command_line] Command failed: python /home/homeassistant/.homeassistant/scripts/savecameraimages.py

ignoring the homeassistant errors for now, how are you running this in putty? I may have replicated your error, you should type on one line when at the command prompt,

python /home/homeassistant/.homeassistant/python_scripts/savecameraimages.py

Do not type python, then type the above, that generates this error…

python /home/homeassistant/.homeassistant/scripts/savecameraimages.py
File “”, line 1
python /home/homeassistant/.homeassistant/scripts/savecameraimages.py
SyntaxError: invalid syntax

Switched folder to /tmp and it seems to be working.

Got this image now

That’s good. It should work fine for your cameras now, just make sure HA has access to the folder and you should be set.

Any idea why it won’t write to the previous folder even though it has the correct permissions?

I even whitelisted it.

Edit: It was a permission issue, need to be 1777 instead of 0744.

Thanks for all your help, I have been trying to get this feature running for weeks.

Thanks again.