Hi!
I have a Waveshare 4.2" e-Paper Module. I want to use it to show the dynamic energy prices of today and tomorrow. Including when the price is the cheapest in the night (when available).
Since the graph is a bit limited in it’s options I decided to create a little python script to make the image I want to show and host that on my network.
This is the image:
Showing that image on the eInk screen works fine. But it never seems to refresh; even when I manually restart the device.
It looks quite good though:
And it also flashes a lot every time the device (restarts). Is that normal?
This is my esp32 code:
esphome:
name: epaper1
friendly_name: epaper1
on_boot:
priority: -10
then:
- delay: 10s
- component.update: epaperdisplay
esp8266:
board: esp01_1m
logger:
api:
ota:
password: !secret otaPassword
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
use_address: 192.168.169.54
ap:
ssid: "Epaper1 Fallback Hotspot"
password: !secret fallbackHotSpot
captive_portal:
image:
- file: https://office.********.nl/EnergyPrices.png
id: energypricesimage
spi:
clk_pin: 14
mosi_pin: 13 #DIN
display:
- platform: waveshare_epaper
id: epaperdisplay
cs_pin: 15
dc_pin: 12
update_interval: 300s
busy_pin: 16
reset_pin: 4
model: 4.20in-bV2
lambda: |-
it.image(0,0,id(energypricesimage));
nickrout
(Nick Rout)
May 30, 2024, 7:33am
2
I don’t think the images are dynamic. In other words it includes the image at compile time.
That would explain a lot!
Hope that someone has a workaround.
nickrout
(Nick Rout)
May 30, 2024, 7:45am
4
Perhaps the last post here?
Does anyone has another idea…?
nickrout
(Nick Rout)
May 30, 2024, 7:47am
5
1 Like
Yes! This seems to be the way to do it:
esphome:dev
← guillempages:online_image_buffer
opened 10:06PM - 19 Apr 23 UTC
# What does this implement/fix?
This PR implements the possibility of downloa… ding PNG images at runtime and showing them in a compatible display.
## Types of changes
- [ ] Bugfix (non-breaking change which fixes an issue)
- [x] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] Other
**Related issue or feature (if applicable):** fixes https://github.com/esphome/feature-requests/issues/1463
**Pull request in [esphome-docs](https://github.com/esphome/esphome-docs) with documentation (if applicable):** esphome/esphome-docs#2076
## Test Environment
- [x] ESP32
- [ ] ESP32 IDF
- [ ] ESP8266
- [ ] RP2040
## Example entry for `config.yaml`:
<!--
Supplying a configuration snippet, makes it easier for a maintainer to test
your PR. Furthermore, for new integrations, it gives an impression of how
the configuration would look like.
Note: Remove this section if this PR does not have an example entry.
-->
```yaml
# Example config.yaml
esphome:
# ...
on_boot:
then:
- wait_until: api.connected
- component.update: example_image
online_image:
- url: "https://www.example.org/image.png"
id: example_image
type: RGB565
on_download_finished:
- component.update: my_display
on_error:
- logger.log: "Could not download the image"
display:
id: my_display
# ...
lambda: |-
it.image(0, 0, id(example_image));
```
## Checklist:
- [x] The code change is tested and works locally.
- [ ] Tests have been added to verify that the new code works (under `tests/` folder).
If user exposed functionality or configuration variables are added/changed:
- [ ] Documentation added/updated in [esphome-docs](https://github.com/esphome/esphome-docs).
But that’s not working yet…
esphome:dev
← guillempages:online_image_buffer
@ianByrne sorry about that error. I did a fix for the beta, and somehow forgot… , that the release is not yet out 🫤.
When the next release is released (should be on Wednesday if I am not mistaken) the issue will be automatically fixed.
Meanwhile I'll try to do some hack tomorrow, to see if I can make it work again on the previous versions as well.
WallyR
(Wally)
May 31, 2024, 10:18am
8
Well, the image is somewhat dynamic, but an e-ink is not like a normal LCD.
It updates the screen and then that image stays until another update is called.
When it updates the screen, then it needs to “clear” the old image, which is why it flickers.
An update can take a few seconds, so the refresh rate of an e-ink is generally not for quickly changing images.
There are a few e.ink screens that support partial updates, which can update an area faster without to much flicker, but once in a while it needs to “clear” properly too, so it is more of a patch.
1 Like