Hi all I’m using the following in a script to push a notification to my iphone this works( see below)
I tried to put the Yaml in the automation rather than call a script . If I put the Yaml into the automation the Push message works but there is no jpg attached, Should it work or do I need to do it via the script?
alias: MdF apple push jpg front door
sequence:
- service: notify.mobile_app_garryiphone
data:
message: Someone is on the Drive!
data:
image: /media/local/front/photo/front_latest.jpg
mode: single
Regards
Garry
I think it would be:
/config/www/front/photo/front_latest.jpg
I could be wrong.
It changes to that www folder when trying to access it other than in the file system on the local machine.
Thanks just tried it and it didnt work I also tried
- /www/front/photo/front_latest.jpg
- /www/media/front/photo/front_latest.jpg
- /config/www/media/front/photo/front_latest.jpg
no joy with any of them ,
Oh my bad, externally you need the full URL.
Here’s my automation:
- id: '1608125892221'
alias: Front Yard | Camera Snapshot
description: ''
trigger:
- platform: state
entity_id: input_boolean.front_door_person
to: 'on'
- platform: state
entity_id: input_boolean.front_door_doorbell
to: 'on'
condition: []
action:
- service: camera.snapshot
data:
filename: /config/www/nestperson.jpg
target:
entity_id: camera.front_door
- service: notify.mobile_app_iphone
data:
message: Person Detected Front Yard
data:
attachment:
url: https://<insert your external URL here>/local/nestperson.jpg
content-type: png
hide-thumbnail: false
lol the type is set to png. It works though…
Thanks I will give it a go any idea why it need to be a different command in an Automation that a Script?
I didn’t say that. Or didn’t mean to at least.
Should be the same for both.
You need the full URL when doing something over the internet, which a push notification is.
Thanks I will give it a go, Sorry I didn’t mean to imply you said anything, I was asking if you had any idea why my example works in a script but not in an automation
Oh I didn’t read that properly from your OP.
That is very strange.
That is very bizarre.
Your phone is almost always going to try to get things over the internet, so I can’t imagine why an internal HA reference would work, unless that’s built into the function.
There’s so many skeletons in this software’s closet begging to be reported, I just don’t have the time nor am I confident enough to say that it’s a true bug.
In the end I did this
alias: MdF apple push jpg front door
sequence:
- delay:
hours: 0
minutes: 0
seconds: 10
milliseconds: 0
- service: notify.Hassio_front_cam
data:
message: Someone is on the Drive !
data:
images:
- /media/front/photo/front_latest.jpg
- delay:
hours: 0
minutes: 0
seconds: 10
milliseconds: 0
- service: imagedirectory.create_gif_mp4
data:
sourcepath: /media/front/photo
exclude: front_latest.jpg
destinationpath: /media
format: mp4
- service: notify.mobile_app_garryiphone
data:
message: Someone is on the drive
data:
video: /media/local/latest.mp4
- delay:
hours: 0
minutes: 0
seconds: 5
milliseconds: 0
- service: imagedirectory.move_files
data:
sourcepath: /media/front/photo
exclude: front_latest.jpg
destinationpath: /media/front/old
- service: delete.files_in_folder
data:
folder: /media/front/
time: 604800
mode: single