Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid example in notifications/attachments #1125

Open
jritsema opened this issue Oct 21, 2024 · 2 comments
Open

Invalid example in notifications/attachments #1125

jritsema opened this issue Oct 21, 2024 · 2 comments

Comments

@jritsema
Copy link

The Example Action under Notifications / Attachments / Standard Attachments / Example action does not seem to work.

automation:
  - alias: Notify Mobile app attachment
    trigger:
      ...
    action:
      - action: notify.mobile_app_<your_device_id_here>
        data:
          message: "Something happened at home!"
          data:
            # an example of an absolute url
            image: "https://www.home-assistant.io/images/default-social.png"

When I tried this, I do get the mobile notification, however, I don’t see a thumbnail, and when I expand it, it says, “Failed to load attachment - URLSessionTask failed with error: The internet connection appears to be offline”.

It appears that your home assistant server needs to be exposed to the internet, even if you want to only use absolute public URLs to another server. If this is the case, I would suggest noting this in the documentation as it feels misleading.

Also see https://community.home-assistant.io/t/ios-notifications-with-public-images-on-a-private-server/

@dshokouhi
Copy link
Member

It appears that your home assistant server needs to be exposed to the internet, even if you want to only use absolute public URLs to another server. If this is the case, I would suggest noting this in the documentation as it feels misleading.

Hello on the same page you have linked we actually have a note about attachments requiring internet.

https://companion.home-assistant.io/docs/notifications/notification-attachments#downloading

Attachments are required to be accessible from the internet

However for a full public URL (that is accessible in a browser) it should work as is. On Android the URL is accessed directly so this may be a iOS only issue as you describe. Have you tested the URL in a browser to make sure it loads without authentication? Authentication is only added with relative URLs.

@jritsema
Copy link
Author

Yes, I tried the example in the docs verbatim.

https://www.home-assistant.io/images/default-social.png

This url is publicly accessible. It does not work on iOS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants