Ludy87 / xplora_watch

Xplora® Watch Home Assistant Integration
MIT License
49 stars 6 forks source link

Chat message images are not rendered #444

Open distante opened 2 weeks ago

distante commented 2 weeks ago

What version of Integration has the issue?

v2.13.11

System Health details

Version core-2024.9.1
Installation type Home Assistant OS
Development false
Supervisor true
Docker true
User root
Virtual environment false
Python version 3.12.4
Operating system family Linux
Operating system version 6.6.46-haos
CPU architecture x86_64
Timezone Europe/Berlin
Configuration directory /config

Checklist

Describe the issue

I am using the markdown card read messages and I can see the text of the messages, but when the message contains any media, it is not shown:

Just this is shown:

image

If I open the developer tools, I see that the image is attached

image

But it is not found

image

Reproduction steps

  1. Include the chat card into your dashboard https://raw.githubusercontent.com/Ludy87/xplora_watch/main/samples/markdown-card-read-messages.md
  2. Send a message with an image
  3. Reload the page

Debug logs

2024-09-08 17:22:28.710 DEBUG (MainThread) [custom_components.xplora_watch] Set up the Xplora® Watch Version 2 component
2024-09-08 17:22:28.711 DEBUG (MainThread) [custom_components.xplora_watch] Configure based on config entry 01J53BSA5NZ3M3N6JG93X41T54
2024-09-08 17:22:28.941 DEBUG (MainThread) [custom_components.xplora_watch] pyxplora_api lib version: 2.12.9-1298
2024-09-08 17:22:30.457 DEBUG (MainThread) [custom_components.xplora_watch.coordinator] Fetch data from Xplora: 6350930
2024-09-08 17:22:33.318 DEBUG (MainThread) [custom_components.xplora_watch.coordinator] load address from openstreetmap.org
2024-09-08 17:22:33.320 DEBUG (MainThread) [custom_components.xplora_watch.coordinator] Manually updated xplora_watch- data
2024-09-08 17:22:33.320 DEBUG (MainThread) [custom_components.xplora_watch.coordinator] Finished fetching xplora_watch- data in 4.379 seconds (success: True)
2024-09-08 17:22:34.683 DEBUG (MainThread) [custom_components.xplora_watch.helper] set services.yaml path: /config/custom_components/xplora_watch/services.yaml
2024-09-08 17:22:34.683 DEBUG (MainThread) [custom_components.xplora_watch.helper] services_en.json path: /config/custom_components/xplora_watch/jsons/service_en.json
2024-09-08 17:22:34.703 WARNING (MainThread) [homeassistant.helpers.frame] Detected that custom integration 'xplora_watch' calls async_forward_entry_setup for integration, xplora_watch with title: Xplora® and entry_id: 01J53BSA5NZ3M3N6JG93X41T54, which is deprecated and will stop working in Home Assistant 2025.6, await async_forward_entry_setups instead at custom_components/xplora_watch/__init__.py, line 67: hass.async_create_task(hass.config_entries.async_forward_entry_setup(entry, platform)), please create a bug report at https://github.com/Ludy87/xplora_watch/issues
2024-09-08 17:22:34.721 DEBUG (MainThread) [custom_components.xplora_watch.binary_sensor] Updating binary_sensor: Dana Watch Charging (Saninn Giancarlo Salas Diaz) | Typ: charging | Watch_ID ...6350930
2024-09-08 17:22:34.732 WARNING (MainThread) [homeassistant.helpers.frame] Detected code that calls async_forward_entry_setup for integration xplora_watch with title: Xplora® and entry_id: 01J53BSA5NZ3M3N6JG93X41T54, during setup without awaiting async_forward_entry_setup, which can cause the setup lock to be released before the setup is done. This will stop working in Home Assistant 2025.1. Please report this issue.
Stack (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/usr/src/homeassistant/homeassistant/__main__.py", line 223, in <module>
    sys.exit(main())
  File "/usr/src/homeassistant/homeassistant/__main__.py", line 209, in main
    exit_code = runner.run(runtime_conf)
  File "/usr/src/homeassistant/homeassistant/runner.py", line 189, in run
    return loop.run_until_complete(setup_and_run_hass(runtime_config))
  File "/usr/local/lib/python3.12/asyncio/base_events.py", line 674, in run_until_complete
    self.run_forever()
  File "/usr/local/lib/python3.12/asyncio/base_events.py", line 641, in run_forever
    self._run_once()
  File "/usr/local/lib/python3.12/asyncio/base_events.py", line 1990, in _run_once
    handle._run()
  File "/usr/local/lib/python3.12/asyncio/events.py", line 88, in _run
    self._context.run(self._callback, *self._args)
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 2184, in async_forward_entry_setup
    _report_non_awaited_platform_forwards(entry, "async_forward_entry_setup")
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 1201, in _report_non_awaited_platform_forwards
    report(
  File "/usr/src/homeassistant/homeassistant/helpers/frame.py", line 151, in report
    _LOGGER.warning(msg, stack_info=True)
2024-09-08 17:22:34.733 WARNING (MainThread) [homeassistant.helpers.frame] Detected code that calls async_forward_entry_setup for integration xplora_watch with title: Xplora® and entry_id: 01J53BSA5NZ3M3N6JG93X41T54, during setup without awaiting async_forward_entry_setup, which can cause the setup lock to be released before the setup is done. This will stop working in Home Assistant 2025.1. Please report this issue.
Stack (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/usr/src/homeassistant/homeassistant/__main__.py", line 223, in <module>
    sys.exit(main())
  File "/usr/src/homeassistant/homeassistant/__main__.py", line 209, in main
    exit_code = runner.run(runtime_conf)
  File "/usr/src/homeassistant/homeassistant/runner.py", line 189, in run
    return loop.run_until_complete(setup_and_run_hass(runtime_config))
  File "/usr/local/lib/python3.12/asyncio/base_events.py", line 674, in run_until_complete
    self.run_forever()
  File "/usr/local/lib/python3.12/asyncio/base_events.py", line 641, in run_forever
    self._run_once()
  File "/usr/local/lib/python3.12/asyncio/base_events.py", line 1990, in _run_once
    handle._run()
  File "/usr/local/lib/python3.12/asyncio/events.py", line 88, in _run
    self._context.run(self._callback, *self._args)
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 2184, in async_forward_entry_setup
    _report_non_awaited_platform_forwards(entry, "async_forward_entry_setup")
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 1201, in _report_non_awaited_platform_forwards
    report(
  File "/usr/src/homeassistant/homeassistant/helpers/frame.py", line 151, in report
    _LOGGER.warning(msg, stack_info=True)
2024-09-08 17:22:34.734 DEBUG (MainThread) [custom_components.xplora_watch.sensor] Updating sensor: Dana Watch Battery (Saninn Giancarlo Salas Diaz) | Typ: battery | Watch_ID ...6350930
2024-09-08 17:22:34.734 DEBUG (MainThread) [custom_components.xplora_watch.sensor] Updating sensor: Dana Watch Message (Saninn Giancarlo Salas Diaz) | Typ: message | Watch_ID ...6350930
2024-09-08 17:22:34.735 WARNING (MainThread) [homeassistant.helpers.frame] Detected code that calls async_forward_entry_setup for integration xplora_watch with title: Xplora® and entry_id: 01J53BSA5NZ3M3N6JG93X41T54, during setup without awaiting async_forward_entry_setup, which can cause the setup lock to be released before the setup is done. This will stop working in Home Assistant 2025.1. Please report this issue.
Stack (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/usr/src/homeassistant/homeassistant/__main__.py", line 223, in <module>
    sys.exit(main())
  File "/usr/src/homeassistant/homeassistant/__main__.py", line 209, in main
    exit_code = runner.run(runtime_conf)
  File "/usr/src/homeassistant/homeassistant/runner.py", line 189, in run
    return loop.run_until_complete(setup_and_run_hass(runtime_config))
  File "/usr/local/lib/python3.12/asyncio/base_events.py", line 674, in run_until_complete
    self.run_forever()
  File "/usr/local/lib/python3.12/asyncio/base_events.py", line 641, in run_forever
    self._run_once()
  File "/usr/local/lib/python3.12/asyncio/base_events.py", line 1990, in _run_once
    handle._run()
  File "/usr/local/lib/python3.12/asyncio/events.py", line 88, in _run
    self._context.run(self._callback, *self._args)
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 2184, in async_forward_entry_setup
    _report_non_awaited_platform_forwards(entry, "async_forward_entry_setup")
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 1201, in _report_non_awaited_platform_forwards
    report(
  File "/usr/src/homeassistant/homeassistant/helpers/frame.py", line 151, in report
    _LOGGER.warning(msg, stack_info=True)
2024-09-08 17:22:34.736 WARNING (MainThread) [homeassistant.helpers.frame] Detected code that calls async_forward_entry_setup for integration xplora_watch with title: Xplora® and entry_id: 01J53BSA5NZ3M3N6JG93X41T54, during setup without awaiting async_forward_entry_setup, which can cause the setup lock to be released before the setup is done. This will stop working in Home Assistant 2025.1. Please report this issue.
Stack (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/usr/src/homeassistant/homeassistant/__main__.py", line 223, in <module>
    sys.exit(main())
  File "/usr/src/homeassistant/homeassistant/__main__.py", line 209, in main
    exit_code = runner.run(runtime_conf)
  File "/usr/src/homeassistant/homeassistant/runner.py", line 189, in run
    return loop.run_until_complete(setup_and_run_hass(runtime_config))
  File "/usr/local/lib/python3.12/asyncio/base_events.py", line 674, in run_until_complete
    self.run_forever()
  File "/usr/local/lib/python3.12/asyncio/base_events.py", line 641, in run_forever
    self._run_once()
  File "/usr/local/lib/python3.12/asyncio/base_events.py", line 1990, in _run_once
    handle._run()
  File "/usr/local/lib/python3.12/asyncio/events.py", line 88, in _run
    self._context.run(self._callback, *self._args)
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 2184, in async_forward_entry_setup
    _report_non_awaited_platform_forwards(entry, "async_forward_entry_setup")
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 1201, in _report_non_awaited_platform_forwards
    report(
  File "/usr/src/homeassistant/homeassistant/helpers/frame.py", line 151, in report
    _LOGGER.warning(msg, stack_info=True)
2024-09-08 17:22:34.736 DEBUG (MainThread) [custom_components.xplora_watch.notify] init Notify Service
2024-09-08 17:27:35.587 DEBUG (MainThread) [custom_components.xplora_watch.coordinator] Fetch data from Xplora: 6350930
2024-09-08 17:27:38.299 DEBUG (MainThread) [custom_components.xplora_watch.coordinator] load address from openstreetmap.org
2024-09-08 17:27:38.301 DEBUG (MainThread) [custom_components.xplora_watch.coordinator] Manually updated xplora_watch- data
2024-09-08 17:27:38.302 DEBUG (MainThread) [custom_components.xplora_watch.coordinator] Finished fetching xplora_watch- data in 4.259 seconds (success: True)
2024-09-08 17:32:39.585 DEBUG (MainThread) [custom_components.xplora_watch.coordinator] Fetch data from Xplora: 6350930
2024-09-08 17:32:42.246 DEBUG (MainThread) [custom_components.xplora_watch.coordinator] load address from openstreetmap.org
2024-09-08 17:32:42.247 DEBUG (MainThread) [custom_components.xplora_watch.coordinator] Manually updated xplora_watch- data
2024-09-08 17:32:42.247 DEBUG (MainThread) [custom_components.xplora_watch.coordinator] Finished fetching xplora_watch- data in 4.204 seconds (success: True)
github-actions[bot] commented 2 weeks ago

:wave: @distante, it is checked whether there is a bug. Please have some patience. This action was performed automatically.

github-actions[bot] commented 2 weeks ago

Thanks for opening this issue! I have applied any labels matching special text in your title and description.

@Ludy87: Please review the labels and make any necessary changes.

Ludy87 commented 2 weeks ago

Hi @distante Please set in your configuration.yaml and try again


homeassistant:
  allowlist_external_dirs:
    - "/config"
distante commented 1 week ago

Hi @Ludy87 thank you for the reply. I tried it, reboot and sended new messages, it still doesn't work.

Ludy87 commented 1 week ago

Can you check whether the image is in another folder? Normally it would be in www/image

Otherwise you can create the www folder in the root directory of the config and test it?

distante commented 1 week ago

I have the www/image folder but there there is nothing

image