Appdaemon send a notification with camera picture

Do you know how to send a notification with a camera image ?

self.call_service("camera/snapshot", entity_id="camera.parking",filename="/config/www/snapshots/camera.jpg")
self.call_service("notify/mobile_app_sm_a505fn", message="The Garage Door has been Left Open",data="file:/config/www/snapshots/camera.jpg")

The code above do not work ?
Please advise

Your service call isn’t passing in the right data. I’d recommend taking a look at the companion app docs. Standard Attachments | Home Assistant Companion Docs

hi thanks

i can easily send a camera image with service

But how to write this in appdaemon ?
This is not working?

self.call_service("notify/mobile_app_sm_a505fn", message="camera image",data="image:/local/snapshots/camera.jpg")

Please advise

i think i have it.
Here is the tips for those who are searching

self.call_service("notify/mobile_app_sm_a505fn", message="camera-image",data={"image":"/local/snapshots/camera.jpg"})

As an example, when a doorbell button is pressed, that can be a trigger for a snapshot to be taken and sent.

self.call_service("camera/snapshot", filename="/config/snaps/snap.png",

Then in conjunction with this, one could use the folder watcher integration to automatically fire that snap over a notification once the snapshot image file is created.

I’ve added this to my configuration.yml:

  - folder: /config/snaps/

Here’s the appdaemon code to fire the snap:

added this to the initialization constructor:

self.listen_event(self.notify_of_person, "folder_watcher")

And here’s that method:

def notify_of_person(self, event_name, data, kwargs):
	notificationdata  = {}
	event_type = data["event_type"]
	file_name = data["file"]
	if event_type == "closed":
		file_path = f"/local/snaps/{file_name}"
		notificationdata["image"] = file_path
				message="Person at front door",
				data = notificationdata)

ok thx a lot . I will try that
Do you have a clue to do the same , 1/ Take a picture 2/ Send by email ?
It is not working here

I don’t use email to send notifications, however I’m sure that’s possible. Worth having a look through the documentation.
My suggestion is to use either the mobile app or Telegram. I’ve found these services to work really well.
And your other question, taking a picture. You need a camera entity setup.
If you look at my previous post.
In this case, is just a variable that refers to my camera entity camera.amcrest_stream