home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
71.16k stars 29.84k forks source link

template "image" entity: cannot specify "/local/...." path for images #96212

Open ildar170975 opened 1 year ago

ildar170975 commented 1 year ago

The problem

In all other places (at least which I dealt with) a path to an image may be defined both ways:

input_boolean:
  test_xxxxxxx:
  test_xxxxxxx_2:

homeassistant:
  customize:
    input_boolean.test_xxxxxxx:
      entity_picture: '/local/images/test/pink.jpg'
    input_boolean.test_xxxxxxx_2:
      entity_picture: 'https://design.home-assistant.io/images/logo.png'

i.e. by using /local/... path or a full url.

For the new image entity I cannot do it:

template:
  - image:

      - name: test_image
        url: '/local/images/test/pink.jpg'

      - name: test_image_2
        url: 'http://192.168.0.100:8123/local/images/test/pink.jpg'

Here the 1st image is not properly created, there is an error:

Error getting new image from /local/images/test/pink.jpg: Request URL is missing an 'http://' or 'https://' protocol.

I am 100% sure that users should have the same way to specify a path to images here - as they do in other places of HA. This could be not a bug - but an example of inconsistency.

What version of Home Assistant Core has the issue?

2023.7

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant Container

Integration causing the issue

Image

Link to integration documentation on our website

https://www.home-assistant.io/integrations/image/

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

home-assistant[bot] commented 1 year ago

Hey there @home-assistant/core, mind taking a look at this issue as it has been labeled with an integration (image) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `image` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Renames the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign image` Removes the current integration label and assignees on the issue, add the integration domain after the command.

(message by CodeOwnersMention)


image documentation image source (message by IssueLinks)

snozzlebert commented 1 year ago

Same for changing the local_file camera to the template image platform. This is possible with the camera platform:

platform: local_file
name: QR code
file_path: <path to image file>

However it doesn't work with an image template. It can only reference an URL.

ColColonCleaner commented 1 year ago

Would very much like to see this resolved. Thanks for creating the issue!

issue-triage-workflows[bot] commented 11 months ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

ildar170975 commented 10 months ago

up

Montreal666 commented 10 months ago

still an issue

andorardo commented 9 months ago

There is a community discussion about this here: https://community.home-assistant.io/t/2023-7-image-entity-local-image/588753

I found the problem persists whether I'm on an HTTP or HTTPS connection.

issue-triage-workflows[bot] commented 6 months ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

ildar170975 commented 6 months ago

up

issue-triage-workflows[bot] commented 3 months ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

ildar170975 commented 3 months ago

up

martinhoess commented 1 month ago

I have also just stumbled across this "problem". It's a pity that it doesn't work. And as already mentioned above, the restriction makes little sense.

Also, some "practices" in HA don't really seem to be standardised. Because following this statement, "image" should also never be able to retrieve anything from a "random" URL 🤷‍♂️

Notify integrations will never be allowed to fetch random URLs. There is not going to be any discussion about this. It's a security risk. Feel free to open a PR to change it in all other components. https://github.com/home-assistant/core/issues/32236#issuecomment-594638720