OpenEPaperLink / Home_Assistant_Integration

Home assistant Integration for the OpenEPaperLink project
Apache License 2.0
133 stars 32 forks source link

FR: Picture entity of last generated/send picture #64

Closed emufan closed 7 months ago

emufan commented 7 months ago

Wouldn't it be a good thing to have a picture entity in each device of the last generated picture?

So one can see the generated one (test mode) in HA and not only in file system and one can have a dashboard of the current pictures of the devices as well.

jonasniesner commented 7 months ago

Your FR was implemented with the latest release

emufan commented 7 months ago

@jonasniesner Fantastico! Thx a lot. Unfortunately I have no camera entity in my device. :-( Can I provide something for finding the reason?

BTW Only for interest, why did you implement a camera and not a picture entity? I'm not an expert here, but always try to understand why something has been done this and that way.

four2six commented 7 months ago

for me the entities are created like camera.<000etc>_cam , but they don't show an image

jonasniesner commented 7 months ago

@four2six did you call draw custom after the update. It will only show newly generated images and not fetch anything from the AP at the moment

four2six commented 7 months ago

Yes, I did. Just found the images under config/www/open_epaper_link/ .... does this folder have to have be configured in the allow list for external directories or something?

emufan commented 7 months ago

Here, unfortunately, I don't have any of the camera entities. The images are now (additionally) generated in www folder, etc., but no entities.

emufan commented 7 months ago

I have deleted the integration and re-added. Still the case.

This the only related part in the log:

2023-11-29 15:04:49.825 WARNING (Thread-8 (establish_connection)) [websocket] websocket connected
2023-11-29 15:05:13.702 WARNING (MainThread) [py.warnings] /usr/src/homeassistant/homeassistant/config_entries.py:1438: RuntimeWarning: coroutine 'ConfigEntries.async_forward_entry_unload' was never awaited
name=f"config entry forward unload {entry.title} {entry.domain} {entry.entry_id} {platform}",
2023-11-29 15:05:13.704 ERROR (MainThread) [homeassistant.config_entries] Error unloading entry 192.168.178.145 for camera
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 557, in async_unload
result = await component.async_unload_entry(hass, self)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/camera/__init__.py", line 446, in async_unload_entry
return await component.async_unload_entry(entry)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 202, in async_unload_entry
raise ValueError("Config entry was never loaded!")
ValueError: Config entry was never loaded!
emufan commented 7 months ago

Oh, sorry. Cams seem to be there yet. But not bound to sand so no visible in the devices. Sorry, only looked there as for the other entities.

So I have still the errors in the log, but no picture in the cam, same as four2six. Even if new generated and send.

emufan commented 7 months ago

Next feedback. It is there, but not displayed, because the ID-part of the filename is expected in uppercase, where it is generated in lowercase. Perhaps depending on file system, but here it is case sensitive. So it is not fitting at the moment, the generated image to the url, which is bound to the cam. If I rename it to uppercase, it is shown.

But as said, not bound to the device. And I wonder if an image-entity would be better than the cam. But that it not that relevant.