Use ESPHome with e-ink Displays to blend in with your home decor!

You’re already have a template tag I think

I have an entire template.yaml, but if I paste the items there, I get the following message:

So if I paste the code in template.yaml, I receive the following message:

nd of the stream or a document separator is expected (116:1)

113 |         value_template: "{{ sta ...
 114 | 
 115 | 
 116 | sensor:
-------^
 117 |

I have a sensors.yaml file as well and I feel. like I should be splitting apart the sensors.yaml provided in the repository, but I don’t know which sensor/template goes where.

Making Progress!

I have populated the screen but cannot get the glyph to display the weather icon for the weather conditions 1 hour from now using my tempest weather flow as the source.

Here is the template code in yaml:

weather_1_hour: >
           {% set cond_now = state_attr('weather.weatherflow_hourly_based_forecast', 'forecast')[0].condition %}
            {% if states('sun.sun') == 'below_horizon' %}
                {% if cond_now == 'sunny' %} night {% elif cond_now == 'partlycloudy' %} night-partly-cloudy {% else %} {{ cond_now }} {% endif %}
            {% else %}
                {{ cond_now }}
            {% endif %}

This creates the attribute weather_1_hour to sensor.weatherman_data. When I run this template I return the value ‘night-partly-cloudy’, which should produce the mdi-icon. Here is the configuration in weather.yaml:

- platform: homeassistant
    entity_id: sensor.weatherman_data
    attribute: weather_1_hour
    id: weather_1_hour
    on_value:
      then:
        - lambda: 'id(data_updated) = true;'

… and here is the code to generate the result on the e-reader.

it.printf(105, 306, id(font_mdi_medium), color_text, TextAlign::TOP_CENTER, "%s", weather_icon_map[id(weather_1_hour).state.c_str()].c_str());

When I try to flash the ESP32, I receive this error:

/config/esphome/weatherman.yaml: In lambda function:
/config/esphome/weatherman.yaml:497:126: error: request for member 'c_str' in 'weather_1_hour->esphome::homeassistant::HomeassistantSensor::<anonymous>.esphome::sensor::Sensor::state', which is of non-class type 'float'
         it.printf(105, 306, id(font_mdi_medium), color_text, TextAlign::TOP_CENTER, "%s", weather_icon_map[id(weather_1_hour).state.c_str()].c_str());

Am I formatting the template attribute incorrectly?

I’m stuck here as well:

Processing ramme (board: esp32dev; framework: arduino; platform: platformio/[email protected])
--------------------------------------------------------------------------------
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
 - toolchain-xtensa-esp32 @ 8.4.0+2021r2-patch5
Dependency Graph
|-- AsyncTCP-esphome @ 1.2.2
|-- WiFi @ 2.0.0
|-- FS @ 2.0.0
|-- Update @ 2.0.0
|-- ESPAsyncWebServer-esphome @ 2.1.0
|-- DNSServer @ 2.0.0
|-- ESPmDNS @ 2.0.0
|-- noise-c @ 0.1.4
|-- SPI @ 2.0.0
|-- ArduinoJson @ 6.18.5
Compiling /data/ramme/.pioenvs/ramme/src/main.cpp.o
/config/esphome/ramme.yaml: In lambda function:
/config/esphome/ramme.yaml:408:120: error: request for member 'c_str' in 'weather_condition_now->esphome::homeassistant::HomeassistantSensor::<anonymous>.esphome::sensor::Sensor::state', which is of non-class type 'float'
         it.printf(100, 158, id(font_mdi_large), TextAlign::TOP_CENTER, "%s", weather_icon_map[id(weather_condition_now).state.c_str()].c_str());
                                                                                                                        ^~~~~
*** [/data/ramme/.pioenvs/ramme/src/main.cpp.o] Error 1
========================== [FAILED] Took 6.38 seconds ==========================

As this appears during compile time… must be something wrong in the esphome-yaml

The code I have in ramme.yaml is:

it.printf(100, 158, id(font_mdi_large), TextAlign::TOP_CENTER, "%s", weather_icon_map[id(weather_condition_now).state.c_str()].c_str());

I’m guessing/hoping something broke with the newest ESPHome release for july.

I’ve found something!

The examples above all define the weather variables under sensor:
However, the ones that fail compiling should be under text_sensor:

Then it will compile and it appears to work.

I do not know when or why it was changed, but for those struggling to set up their dashboard now, move the releveant entries to this:

text_sensor:
  - platform: homeassistant
    entity_id: sensor.weatherman_data
    attribute: weather_condition_now
    id: weather_condition_now
    on_value:
      then:
        - lambda: 'id(data_updated) = true;'

Hi Harald, I have been trying to fix this for MONTHS. Could you post your whole config.yaml so I could try copy and pasting it? I am very new to this and when I try to copy/paste your paragraph it doesn’t work

Where are you stuck? Are you having trouble with your home assistant configuration.yaml or our esphome pictureframe.yaml?

Is there a problem with compiling or with getting the data to the frame?

I found it helpful to add this to the esphome so I can see the variables by going to the picture frame itself with a web browser:

web_server:
  port: 80
  include_internal: True
1 Like

Hi Harald,

I have installed everything as per the guide. However, my HA board says “Weatherman data: unavailable”

image

When I go to the developer tools - States list, it says the Sensor is Unavailable.

When I click on the dashboard for the entity, it says as follows:

Before this it gave me an error of lacking a custom ID. I named it Steve and the error went away.

Hey @blank321 ,

So what I see from your description is that the communication from your esp32 to home assistant is okay, the sensors on the esp32 are propegated to home assistant.

However, the sensor “sensor.weatherman_data” is not working. This sensor is generated by your template configuration in configuration.yaml on home assistant. That is where you should start debugging now. Could be a typo or something, and that should be visible in the logs.

Can you show us the relevant part of your home assistant configuration.yaml?

PS: For any changes to configuration.yaml to be active/visible, you have to restart home assistant.

Especially #11 seems more than relevant. :wink: Thanks!

1 Like

@blank321 , I can see from your edited post that the configuration you have entered was more or less verbatim from the original project. Example: They retrieved the weather from the entity weather.valhalla_hourly, which I assume you don’t have. You have to use the weather entity you have.

In my installation it is weather.oslo and weather.oslo_hourly, and I had to enable the hourly one as that was disabled by the integration.

Please note that none of the configurations you will see linked here (as far as I know) will work if you copy and paste them. They have to be adjusted to your sensors. If it is helpful, I can create an extremely simple “hello world”-example to perhaps get you up and running and learning more about how it all connects?

Just throwing an idea out there. I was thinking about having multiple pages on the dashboard, allowing the user to switch by pressing a button, or changing it based on some sensors (ie, in the morning, show commute times to work).

Maybe something like this on the side of the picture frame?

Was hoping to find something more invisible/white, but the search continues.

I’m not 100% sure on how to do this yet, but I assume a sensor on the esp32 that’s called current_page, and the display-lambda will look at this to decide what page to display. And with the automation engine from esphome change this number. It should also be changeable from home assistant.

Is there a sensor one could mount behind the picture frame that would sense touch on the glass/right in front of the glass?
Thoughts?

ESP32s can work good with touch sensing, so the only problem you might have, is how to get a touch button. Aluminum works nice, you could work with some small touch buttons cut out of a bigger board or even touch buttons out of aluminum foil should work. :slight_smile:

I feel like a fool. This completely fixed the issue. For posterity, changing “sensor.weatherman_data” to “weather.weather_home_hourly” (click on the name of your weather widget to find the entity ID) fixed the issue I was having completely. I changed it on the config.yaml, sensors.yaml, and on the ESP32 files. This is progress and not a fix, causing exciting new issues!

It appears I have completely burnt out the display in the months of troubleshooting process lmao but progress is progress!

1 Like

It appears the weather for today is incomprehensible eldritch horrors.

If I had to guess it has something to do with this error from the ESP32 device logs.

No, you still have to use sensor.weatherman_data, but you have to change the template-sensor so THAT sensor pulls data from weather.weather_home_hourly :slight_smile:

It does some manipulating of the data and puts it where Weatherman needs it

To describe it another way: the sensor sensor.weatherman_data is used as a gather-it-all-and-pass-it-to-esphome. It stuffs the weather, the trainschedule and whatever else you would need into attributes of the sensor. Then the config for esphome unwraps it and divides it into seperate internal sensors which we refer to by id(blabla)

You’re getting close, hang in there :smiley:

One more thing: If you add the debug config that I pasted earlier, you can go to the IP address of your esp32 and you should see something like this when the data is flowing correctly to the esp32/esphome:

Attached below is the code for the debug for everyone’s reference. When you add this it will add some tables to the ESPhome browser that show what data the ESP32 is getting. Thanks Harald!

So, I deleted and reinstalled all the files and installed the logger. All of the weather data cropped below says NA. Weirdly, deleting and reinstalling broke some of the dashboard buttons such as “refresh screen” but it can still be done through the ESPhome page so we’ll leave that for now.

Working through this: I have reverted all the files to the OG install. the issue I’m trying to resolve is to get the weather.home to populate sensor.weatherman_data. As per your post, the template-sensor must be changed.

(I am still working on figuring this out but want to search this thread for the post regarding template.yaml, will edit with progress)

ESPhome 2023.7.1 was released today, and one of the things that was fixed was:

  • Fix graininess & streaks for 7.50inV2alt Waveshare e-paper

From what limited testing I did, I believe the black now looks slightly better.

Before the update:

After the update:

2 Likes

Hi Alexander,

can you show me/us how you got it to work with 3 colors ?