Allow Image Attachments in Hangouts Notification

The current Hangouts Notification (https://www.home-assistant.io/components/notify.hangouts/) only supports text messages, and does not allow image attachments.

Alternatively, SMTP Notification (https://www.home-assistant.io/components/notify.smtp/) to send MMS via MMS Gateway allows this functionality.

According to the documentation


it should be possible to attach data (i.e. image file or url) but I can not get it to work with 0.80.1

Was anybody successfull?

I have tried using call service but can only send text messages, no images. Might be me though

So I have tried again, with correctly formatted json, and I am able to send attachments (fotos).
But as stated here at the moment this is only possible, when you call the service directly in the dev-tool.

The json would look like this (insert your conversationID!)

{
  "message": [
 {"text": "messagen text here"}
  ],
  "target": [
{"id": "conversationID"}
  ],
 "data": 
   {"image_file": "/config/www/cam_captures/snapshot1.jpg"}
}

According to this this is supposed to be fixed a week ago but I can not get this to work in 0.81.0.

Here is my service-call:

- service: notify.hangouts
  data_template:
    message: 'Hallo'
    data:
      image_file: '/config/www/cam_captures/snapshot1.jpg'

Nothing is sent, not even the text alone. If I remove the last two lines, I receive the message in hangouts. And yes, the image exists and can be send via the dev-tools successfully.

Any ideas anybody? Maybe the fix didn’t make it in the latest version jet?

I struggled with this for a couple of hours yesterday but finally figured it out. If you use the hangouts.send_message service you can get it to work. I only have the JSON as I use node red but you can probably do something similar in YAML.

{
    "message": [
        {
            "text": "Doorbell"
        }
    ],
    "target": [
        {
            "id": "insert_target_id_here"
        }
    ],
    "data": {
        "image_file": "/config/webcam/snapshot.jpg"
    }
}

Also, I had to whitelist the directory where my snapshots were stored. Place this code under homeassistant: in your config.

  whitelist_external_dirs:
    - /config/webcam

Everything seems to work since Version 0.82.1.
Also notify and attachments.

Works for me … this is great. :grinning:

It’d be be even better if we could do multiple image attachments rather than just the one

how do you guys use the image in an automation? for me it works only if i do it in an service call

this is my automation:

below doesnt work if i add image

  - service: hangouts.send_message
    data: 
      target: 
        - id: !secret hangouts_id
      message:
        - text: 'Alarm Aan'
      data: 
        - image_file: "/config/www/images/snapshot_buiten.jpg"

this one works without image

  - service: hangouts.send_message
    data: 
      target: 
        - id: !secret hangouts_id
      message:
        - text: 'Alarm Aan'

from service call manually it works with no issue
[{"text": "Alarm Aan!"}],"target": [{"id": "xxxx}],"data": {"image_file": "/config/www/images/snapshot_buiten.jpg"}}

This works fine for me now. In dev tools I run notify.hangouts with the following YAML:

message: Bevegelse i båten!
data:
  image_file: /config/www/sofia.jpg

Attaches the image just fine. :slight_smile:

Yeah got it working too :wink: