Send MJPEG still to discord notify

I am trying to get a still image (snapshot) of my 3D printer camera to upload to Discord along with the status updates.

This printer uses Repetier-Server which does not have a Discord configuration available (this printer fails 50% of the time on Octoprint but runs perfectly on Repetier-Server).

I have the bot configured and seem to be getting status notifications but I would like to add an image as well.

I have the camera’s still image url but cannot seem to get to work by adding it to the automation.
http://192.168.20.35:8888/?action=snapshot
I have looked at the camera integration and a few similar topics.

Current automation is:

id: '1661952559623'
alias: A30T-Discord
description: ''
trigger:
  - platform: state
    entity_id:
      - sensor.a309c8d7_a30t_progress
    to: '0.1'
    from: '0.0'
  - platform: state
    entity_id:
      - sensor.a309c8d7_a30t_progress
    to: '25.0'
  - platform: state
    entity_id:
      - sensor.a309c8d7_a30t_progress
    to: '50.0'
  - platform: state
    entity_id:
      - sensor.a309c8d7_a30t_progress
    to: '100.0'
condition: []
action:
  - service: notify.homeassistant_app
    data:
      target: '1004279058625998899'
      title: A30
      message: >-
        A30T Printing progress of {{states('sensor.a309c8d7_a30t_job')}} is at
        {{states('sensor.a309c8d7_a30t_progress')}}%
mode: single

Attempts of using url: and file: all generate errors in the automation screen.

image

Here’s the part of my automation which takes a snapshot from my MPEG camera and notifies on Discord when my garage door is open. The snapshot is stored in the /www/pictures directory.

  - service: camera.snapshot
    data:
      filename: /config/www/pictures/latest_garage.jpg
    target:
      entity_id: camera.garage_camera
  - delay:
      hours: 0
      minutes: 0
      seconds: 3
      milliseconds: 0
  - service: notify.discord
    data:
      message: The garage door is open. Please close the garage door
      title: Garage Door Open
      target:
        - 'my_discord_target'
      data:
        images:
          - /config/www/pictures/latest_garage.jpg

Awesome - Thank you! That definitely seems to get me on the right track. Now I seems to have a syntax or formatting issue as the image is taken (snapshot) but it is sending the path not the image to discord.

alias: A30T-Discord
description: ""
trigger:
  - platform: state
    entity_id:
      - sensor.a309c8d7_a30t_progress
    to: "0.1"
    from: "0.0"
  - platform: state
    entity_id:
      - sensor.a309c8d7_a30t_progress
    to: "25.0"
  - platform: state
    entity_id:
      - sensor.a309c8d7_a30t_progress
    to: "50.0"
  - platform: state
    entity_id:
      - sensor.a309c8d7_a30t_progress
    to: "100.0"
condition: []
action:
  - service: camera.snapshot
    data:
      filename: /config/www/pictures/latest_A30T.jpg
    target:
      entity_id: camera.a30t_cam
  - service: notify.homeassistant_app
    data:
      target: "1004279058625998899"
      title: A30
      message: >-
        A30T Printing progress of {{states('sensor.a309c8d7_a30t_job')}} is at
        {{states('sensor.a309c8d7_a30t_progress')}}%
          data:
            images:
              - /config/www/pictures/latest_A30T.jpg
mode: restart

image

Aha - fixed it! Helped to paste above for me to see the issue (indent).

Thank you!

image