haberda / signal-addon

Signal addon docker files
9 stars 7 forks source link

cannot send images #111

Closed aebgit closed 9 months ago

aebgit commented 9 months ago

I'm using the add-on on

I can send plaintext-messages without problems. However, when I try to attach images the messages are not sent.

The image I want to send is created dynamically in the www-folder /root/config/www.

This is my action-section inside a notification. I use the /local-shortcut for the path.

service: notify.signal
data:
  message: 🤖 Der Staubsauger legt jetzt los
  data:
    attachments:
      - /local/snapshot_rockrobo.png

When triggered, Homeassistant logs the following errors:

While executing automation automation.staubsauger_fertig_signal
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/pysignalclirestapi/api.py", line 202, in send_message
    with open(filename, "rb") as ofile:
         ^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: '/local/snapshot_rockrobo.png'

OK, here I assumed to have found the error (www is somehow not mapped to /local inside the add-on) and have changed the path in my automation accordingly.

service: notify.signal
data:
  message: 🤖 Der Staubsauger legt jetzt los
  data:
    attachments:
      - /root/config/www/snapshot_rockrobo.png

When sending now, I get EXACTLY the same error, complaining about No such file or directory: '/local/snapshot_rockrobo.png'. I'm confused now :-)

haberda commented 9 months ago

I don't maintain the home assistant component and have no idea how it works. I only repack the docker container into an add-on.

That said, I think the problem you are having is you are not pointing to where the file exists in the home assistant container. I think your path should probably be /config/www/snapshot_rockrobo.png not /root/config/www/snapshot_rockrobo.png.

I don't know why you'd get the same error again.

I just sent a picture with the below config and it sent just fine:

service: notify.signal
data:
  message: This is fine
  data:
    attachments:
      -  /config/www/fire.jpg
aebgit commented 9 months ago

Thank you so much for pointing me to the correct path. Now it works :-)