Display OpenEPaperLink Shop Tags in Dashboard

I’m currently using shop E-ink tags to display information from Home Assistant using OpenEPaperLink and this Home Assistant Addin.

This is working superbly allowing low cost e-ink tags to display low frequency update sensors , such as “Bin day” , “BEV current charge”, “Number of items on shopping list”, Weather reports , etc.

The openPaper addin creates new images for the tags via a custom service call and does not currently create a GUI preview.

As the tags update very infrequently, editing and amending data on the tags via the service calls can be very frustrating, having to wait for the new display to update on the tags.

NONE OF THESE HACKS ARE NOW REQUIRED. EPAPER LINK NOW HAS BUILT IN CAMERA SENSORS. PLEASE USE THESE INSTEAD OF FOLLOWING THESE INSTRUCTIONS

However, I discovered the OpenEPaper Addin stores the updated images as jpg files in /config/custom_components/open_epaper_link, before sending the image to the OpenEPaper AP.

More importantly these files can be viewed using the standard file editor in Home Assistant!

Since these are just standard jpg files, why not create a Dashboard to simply view the tags. The following works, but you need to go through a few “hoops”. The file browser method above is simpler and works OK.

To view JPG’s files in Home Assistant they need to be in the local directory see: -

https://www.home-assistant.io/integrations/http#hosting-files

Once you have created the WWW folder we need to copy the JPG’s files into it.

To copy the files we need to create a shell script.

First create a new folder in /config with the file editor called shell. Then create a new file in the shell folder called epaper_copy.sh. Add the following script.

cp -f /config/custom_components/open_epaper_link/*.jpg /config/www

Save the file. We now need to run this script via a shell service command.

Create the shell command in the configuration. yaml

</s> <s>shell_command:</s> <s> epaper_copy: ></s> <s> bash /config/shell/epaper_copy.sh</s> <s>
Reboot Home assistant and confirm you have a new Shell Command: epaper_copy in Services tab in developer tools.

Run the service command and confirm the files have copied into the WWW folder using the file Editor.

You now have the raw JPG files which can be displayed in dashboard Picture-elements, picture glance and picture entity cards. To update the pictures, you simply run the shell service.

However, these static picture cards do not update correctly in Home Assistant see :-

Refresh Cached images in Lovelace Picture-Elements (maybe other places too) - #13 by janser01

I found the simplest solution was to create a “file” camera for each tag. These update perfectly on my Dashboards. They have the added advantage of being an entity so can used on all cards, using “more info” will display the tag JPG.

Add the following to the configuration.yaml l file. Change the tag names and file names as required.

</s> <s>camera:</s> <s> - platform: local_file</s> <s> name: tag_0000026ccc483b1d</s> <s> file_path: /config/www/open_epaper_link.0000026ccc483b1d.jpg</s> <s> - platform: local_file</s> <s> name: tag_000002832a763b19</s> <s> file_path: /config/www/open_epaper_link.000002832a763b19.jpg</s> <s> - platform: local_file</s> <s> name: tag_000002838f4f3b1c</s> <s> file_path: /config/www/open_epaper_link.000002838f4f3b1c.jpg</s> <s>

Check Configuration and reboot Home Assistant. This should create the camera entities.

You can now create a simple Dashboard using the camera entities.

Hope this helps someone :blush:

7 Likes

Great idea, thanks for sharing.
I get to the point where the file is copied to the config/www-folder, but i don’t seem to be able to show it in a dashboard. can you please share your dashboard yaml?
And did you make it an automation to have those files copied?

Its a very simple view.

The trick is to create the camera entries.

I Just have a simple script to copy the files . Then run from the dashboard when required.

alias: Update Tags
sequence:
  - service: shell_command.epaper_copy
    data: {}
mode: single
icon: mdi:tag

Dashboard

This uses the picture elements card. I use a blank template sensor to hide the label.
Just create a template helper with nothing in it

views:
  - title: Home
    path: home
    subview: false
    icon: mdi:home
    type: custom:grid-layout
    badges: []
    cards:
      - type: entities
        entities:
          - entity: script.update_tags
      - square: false
        type: grid
        cards:
          - type: picture-elements
            elements:
              - type: state-label
                entity: sensor.blank
                icon: void
            camera_image: camera.tag_0000026ccc483b1d
          - type: picture-elements
            elements:
              - type: state-label
                entity: sensor.blank
                icon: void
            camera_image: camera.tag_000002832a763b19
          - type: picture-elements
            elements:
              - type: state-label
                entity: sensor.blank
                icon: void
            camera_image: camera.tag_000002838f4f3b1c
          - type: picture-elements
            elements:
              - type: state-label
                entity: sensor.blank
                icon: void
            camera_image: camera.tag_000002b4a9ad341f
title: Home

I have this in my configuration.yaml

camera:
  - platform: local_file
    name: tag_0000021876B03B18
    file_path: /config/www/open_epaper_link.0000021876b03b18.jpg

and i try adding this as a card

type: picture-elements
elements:
  - type: state-label
    entity: sensor.blank
    icon: void
    camera_image: camera.tag_0000021876b03b18

result: “Image required” and a broken image icon showing up.

the file is clearly in the folder. no idea why it won’t show up.

Looks like you don’t have a camera entity .

look in the developers tools entities for the camera id you created. If you click on the tiny info button you should see the tag.

that’s what i have, clicking on info does show the preview jpg.

I just pulled the yaml from the edit dashboard. Your camera image line is in the wrong column.

type: picture-elements
camera_image: camera.tag_0000021876b03b18
elements:
  - type: state-label
    entity: sensor.blank
    icon: void
1 Like

great! thank you, that did the trick.

For copying the files automatically when they are modified, i added this to the configuration.yaml

homeassistant:
  allowlist_external_dirs: 
    - /config/www
    - /config/custom_components/open_epaper_link/

folder_watcher:
  - folder: /config/custom_components/open_epaper_link/
    patterns:
      - '*.jpg'

After rebooting, create this automation.

alias: New file alert
trigger:
  - platform: event
    event_type: folder_watcher
    event_data:
      event_type: modified
action:
  - service: shell_command.epaper_copy
    data: {}
2 Likes

There’s a new camera entity in the newest release.

The entities show up as camera.<0000etcID>_cam , but they don’t give me a picture, can anyone confirm this?

1 Like

Yes . Same issue

camera images appear to be in

/config/www/open_epaper_link/open_epaper_link."mac address".jpeg

aren’t those the ones you created with the solution before?

no mime are in the root of WWW

Source code https://github.com/jonasniesner/open_epaper_link_homeassistant/blob/1e9e34692aa57dec926cfc3231c0b4511947cce5/custom_components/open_epaper_link/camera.py

shows

async def async_setup_entry(hass, config_entry, async_add_entities):
    hub = hass.data[DOMAIN][config_entry.entry_id]
    new_devices = []
    for esls in hub.esls:
        if hub.data[esls]["lqi"] != 100 or hub.data[esls]["rssi"] != 100:
            camera = LocalFile(esls, "/config/www/open_epaper_link/open_epaper_link."+ esls + ".jpg", hub)
            new_devices.append(camera)
    async_add_entities(new_devices,True)

Cameras now working . This is no longer needed :slight_smile:

1 Like

still doesn’t work for me. Except updating the integration, anything else that needs to be done?

oh it does, just not by entering the camera per se.

something as before works, like this

type: picture-elements
camera_image: camera.000002ca6233483f_cam
elements:
  - type: state-label
    entity: input_text.blank
    icon: void
style: |
  ha-card {--ha-card-border-radius: 0px;
  }