giuseppecastaldo / ha-addons

Home Assistant Whatsapp Add-on
Apache License 2.0
49 stars 18 forks source link

How to send image that's saved on home assistant #16

Closed chinedu40 closed 1 year ago

chinedu40 commented 1 year ago

I'm trying to make an automation that automatically send a snapshot image. The snapshop is saved in www/tmp/ . what is the format to send this picture that's saved on home assistant?

chinedu40 commented 1 year ago

For more context, i was using this using the docker image created by @swinster. I figured this out by mapping a volume to the location of the snapshot image on home assistant docker. e.g. ../www/tmp:/snapshots. Then the code to run in the service is

service: whatsapp.send_message
data:
  clientId: default
  to: XXXXXXX@s.whatsapp.net
  body:
    image: 
      url: snapshots/snapshots_camera.camera.jpg
swinster commented 1 year ago

Wow - whodathought I would have done something useful :) . I would like to update that image using @giuseppecastaldo v1.3 for all architectures, but I am struggling with building it. Perhaps we can incorporate this as well (I feel some documentation coming on).

glmnet commented 11 months ago

I got this working by saving the image in the www folder, e.g. www/image1.jpg then the following data:

  body:
    image: 
      url: https://<my-public-url>/local/image1.jpg

this way the image is accessible from internet, is there a better option?

julienelasri commented 6 months ago

I'm looking for the same thing. But doesn't work with local network. ...for me.