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

Thanks for checking

Create sensors for each hour.
For example like this

template:
  - trigger:
      - platform: time_pattern
        hours: /1
    action:
      - service: weather.get_forecast
        target:
          entity_id: weather.forecast_testy
        data:
          type: hourly
        response_variable: forecast
    sensor:
      - name: Počasí teplota hodinově 1
        unique_id: teplota_pocasi_hodina_1
        state: "{{ forecast.forecast[0].temperature }}"
      - name: Počasí teplota hodinově 2
        unique_id: teplota_pocasi_hodina_2
        state: "{{ forecast.forecast[1].temperature }}"
      - name: Počasí teplota hodinově 3
        .................
        ....................

@eemceebee and @Zinken
You both are caught in a change that was introduced with the last update. It is the change to eliminate the forecast attributes out of the weather entity to its own entity (forecast attribute vs forecast entity).

There are numerous topics about this, here is a link to one of my posts, with a try to explain that a little. Take a look at that post, and the whole topic as well. :wink:

2 Likes

hmm I basically copy pasted the code and I though after reading this : Weather - Home Assistant it should work, but I only have every element being unknown. Do I have to tell this that I am using met.no ?

hmm I basically copy pasted the code and I though after reading this : Weather - Home Assistant it should work, but I only have every element being unknown. Do I have to tell this that I am using met.no ?

Have you put your own weather entity in your code?

Not sure what I was doing wrong. Maybe a typo, but now it works. Thanks :slight_smile:

How did it works out? I’m interseting in it aswell. If you have something, can you share your code? Thanks!

I unfortunately did not get the graph component to work.
In the end I solved it by just drawing rectangles:

The code:

int bar_size = 33;
it.rectangle(x_offset+(bar_size*0), y_offset-id(electricity_price).state*100, bar_size, id(electricity_price).state*100);
it.rectangle(x_offset+(bar_size*1), y_offset-id(electricity_price_1h).state*100, bar_size, id(electricity_price_1h).state*100);
it.rectangle(x_offset+(bar_size*2), y_offset-id(electricity_price_2h).state*100, bar_size, id(electricity_price_2h).state*100);
it.rectangle(x_offset+(bar_size*3), y_offset-id(electricity_price_3h).state*100, bar_size, id(electricity_price_3h).state*100);
it.rectangle(x_offset+(bar_size*4), y_offset-id(electricity_price_4h).state*100, bar_size, id(electricity_price_4h).state*100);
it.rectangle(x_offset+(bar_size*5), y_offset-id(electricity_price_5h).state*100, bar_size, id(electricity_price_5h).state*100);
it.rectangle(x_offset+(bar_size*6), y_offset-id(electricity_price_6h).state*100, bar_size, id(electricity_price_6h).state*100);
it.rectangle(x_offset+(bar_size*7), y_offset-id(electricity_price_7h).state*100, bar_size, id(electricity_price_7h).state*100);
it.rectangle(x_offset+(bar_size*8), y_offset-id(electricity_price_8h).state*100, bar_size, id(electricity_price_8h).state*100);
it.rectangle(x_offset+(bar_size*9), y_offset-id(electricity_price_9h).state*100, bar_size, id(electricity_price_9h).state*100);
it.rectangle(x_offset+(bar_size*10), y_offset-id(electricity_price_10h).state*100, bar_size, id(electricity_price_10h).state*100);
it.rectangle(x_offset+(bar_size*11), y_offset-id(electricity_price_11h).state*100, bar_size, id(electricity_price_11h).state*100);        
it.printf(x_offset+(bar_size*0)+(bar_size/2), y_offset, id(font_small), TextAlign::BOTTOM_CENTER, "%.0f", id(electricity_price).state*100);
it.printf(x_offset+(bar_size*1)+(bar_size/2), y_offset, id(font_small), TextAlign::BOTTOM_CENTER, "%.0f", id(electricity_price_1h).state*100);
it.printf(x_offset+(bar_size*2)+(bar_size/2), y_offset, id(font_small), TextAlign::BOTTOM_CENTER, "%.0f", id(electricity_price_2h).state*100);
it.printf(x_offset+(bar_size*3)+(bar_size/2), y_offset, id(font_small), TextAlign::BOTTOM_CENTER, "%.0f", id(electricity_price_3h).state*100);
it.printf(x_offset+(bar_size*4)+(bar_size/2), y_offset, id(font_small), TextAlign::BOTTOM_CENTER, "%.0f", id(electricity_price_4h).state*100);
it.printf(x_offset+(bar_size*5)+(bar_size/2), y_offset, id(font_small), TextAlign::BOTTOM_CENTER, "%.0f", id(electricity_price_5h).state*100);
it.printf(x_offset+(bar_size*6)+(bar_size/2), y_offset, id(font_small), TextAlign::BOTTOM_CENTER, "%.0f", id(electricity_price_6h).state*100);
it.printf(x_offset+(bar_size*7)+(bar_size/2), y_offset, id(font_small), TextAlign::BOTTOM_CENTER, "%.0f", id(electricity_price_7h).state*100);
it.printf(x_offset+(bar_size*8)+(bar_size/2), y_offset, id(font_small), TextAlign::BOTTOM_CENTER, "%.0f", id(electricity_price_8h).state*100);
it.printf(x_offset+(bar_size*9)+(bar_size/2), y_offset, id(font_small), TextAlign::BOTTOM_CENTER, "%.0f", id(electricity_price_9h).state*100);
it.printf(x_offset+(bar_size*10)+(bar_size/2), y_offset, id(font_small), TextAlign::BOTTOM_CENTER, "%.0f", id(electricity_price_10h).state*100);
it.printf(x_offset+(bar_size*11)+(bar_size/2), y_offset, id(font_small), TextAlign::BOTTOM_CENTER, "%.0f", id(electricity_price_11h).state*100);
it.printf(x_offset+(bar_size*0)+(bar_size/2), y_offset, id(font_small_bold), TextAlign::TOP_CENTER, "%2.0f", id(time_hour).state);
it.printf(x_offset+(bar_size*1)+(bar_size/2), y_offset, id(font_small_bold), TextAlign::TOP_CENTER, "%2.0f", id(time_hour_1h).state);
it.printf(x_offset+(bar_size*2)+(bar_size/2), y_offset, id(font_small_bold), TextAlign::TOP_CENTER, "%2.0f", id(time_hour_2h).state);
it.printf(x_offset+(bar_size*3)+(bar_size/2), y_offset, id(font_small_bold), TextAlign::TOP_CENTER, "%2.0f", id(time_hour_3h).state);
it.printf(x_offset+(bar_size*4)+(bar_size/2), y_offset, id(font_small_bold), TextAlign::TOP_CENTER, "%2.0f", id(time_hour_4h).state);
it.printf(x_offset+(bar_size*5)+(bar_size/2), y_offset, id(font_small_bold), TextAlign::TOP_CENTER, "%2.0f", id(time_hour_5h).state);
it.printf(x_offset+(bar_size*6)+(bar_size/2), y_offset, id(font_small_bold), TextAlign::TOP_CENTER, "%2.0f", id(time_hour_6h).state);
it.printf(x_offset+(bar_size*7)+(bar_size/2), y_offset, id(font_small_bold), TextAlign::TOP_CENTER, "%2.0f", id(time_hour_7h).state);
it.printf(x_offset+(bar_size*8)+(bar_size/2), y_offset, id(font_small_bold), TextAlign::TOP_CENTER, "%2.0f", id(time_hour_8h).state);
it.printf(x_offset+(bar_size*9)+(bar_size/2), y_offset, id(font_small_bold), TextAlign::TOP_CENTER, "%2.0f", id(time_hour_9h).state);
it.printf(x_offset+(bar_size*10)+(bar_size/2), y_offset, id(font_small_bold), TextAlign::TOP_CENTER, "%2.0f", id(time_hour_10h).state);
it.printf(x_offset+(bar_size*11)+(bar_size/2), y_offset, id(font_small_bold), TextAlign::TOP_CENTER, "%2.0f", id(time_hour_11h).state);

As you can see, both prices and hours come from home assistant sensors.
I still need to fix those price rounding differences that cause the 0 line to jump by 1 pixel.

1 Like

Thanks for your reply. I will look into that

That looks amazing!
Would you consider assembling and coding 1 setup as a commision? I’m willing to pay for a good setup like this.

I see you built this e-ink screen holder quite some time ago. I really like what you did. I read you 3D printed parts. I do own a 3D printer too, so if you have a model you could share I’d be really interested. That would save me time trying to come up with something myself.

No problem

1 Like

Thanks. Unfortunately if I try to follow the link, it says it is missing or no longer shared.

Try again 3D design E-paper stand | Tinkercad

Still going strong :cowboy_hat_face:

Great, I can see it now. Thank you very much.

1 Like

Hi Taco,

I don’t think that I can build this for somebody else. I’m not a programmer and use a lot of trial and error myself (and Google a lot!). Maybe I have spend about 40 hours all together to come to this result. And it still needs time to update the code frequently due to changes in Home Assistant or (like last week) in the Fordpass API. Then I spend several hours to figure out what is changed and how I can make it work again in Home Assistant and in ESPHome.
I can help you if you want, but I can’t make it for you.
But thanks for the compliment!

@sloma ,

I like the what you’ve done with the Weatherman code. Some great additions!

I’d like to replicate temperature and pressure trends in my own code but I’m having difficulty adding the following to my templates.yaml file;

Using Studio Code Server to add the code, I’m presented with an error indicating property “platform is not allowed” and “property sensors not allowed”. can you guide at to what I may be doing wrong?

Here is my template.yaml file;

###################################################
# "Outdoor Temperature Feels Like" Configuration  #
###################################################
- sensor:
    - name: "Feels Like"
      device_class: temperature
      unit_of_measurement: "°C"
      state: >
        {% if not is_state('sensor.stratford_humidex', 'unknown') %}
          {{ states('sensor.stratford_humidex') }}
        {% elif not is_state('sensor.stratford_wind_chill', 'unknown') %}
          {{ states('sensor.stratford_wind_chill') }}
        {% else %}
          {{ states('sensor.stratford_temperature') | round(0) }}
        {% endif %}

#####################################
# "Rain in 48 Hours" Configuration  #
#####################################
- binary_sensor:
    - name: "Percipitation"
      device_class: moisture
      state: "{{ 'rainy' in (state_attr('weather.stratford','forecast')|map(attribute='condition')|list)[:2] }}"
      icon: mdi:weather-rainy

###############################
# "Weatherman" Configuration  #
###############################
- trigger:
    platform: time_pattern
    minutes: "/1"
  sensor:
    - name: Weatherman Data
      state: "OK"
      attributes:
        weather_condition_now: >
          {% set cond_now = states('weather.stratford_hourly') %}
          {% 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 %}

        weather_condition_0: >
          {% set cond0 = state_attr('weather.stratford_hourly', 'forecast')[0].condition %}
          {% set next_setting = as_timestamp(state_attr('sun.sun', 'next_setting')) %}
          {% set next_rising = as_timestamp(state_attr('sun.sun', 'next_rising')) %}
          {% set cond0_time = as_timestamp(state_attr('weather.stratford_hourly', 'forecast')[0].datetime) %}
          {% if cond0_time < next_rising and next_rising < next_setting %}
              {% if cond0 == 'sunny' %} night {% elif cond0 == 'partlycloudy' %} night-partly-cloudy {% else %} {{ cond0 }} {% endif %}
          {% else %}
              {{ cond0 }}
          {% endif %}
        weather_temperature_0: >
          {{ state_attr('weather.stratford_hourly', 'forecast')[0].temperature | round }}
        weather_timestamp_0: >
          {{ as_timestamp(state_attr('weather.stratford_hourly', 'forecast')[0].datetime) | timestamp_custom('%I') | int }} {{ as_timestamp(state_attr('weather.stratford_hourly', 'forecast')[0].datetime) | timestamp_custom('%p') }}

        weather_condition_1: >
          {% set cond1 = state_attr('weather.stratford_hourly', 'forecast')[1].condition %}
          {% set next_setting = as_timestamp(state_attr('sun.sun', 'next_setting')) %}
          {% set next_rising = as_timestamp(state_attr('sun.sun', 'next_rising')) %}
          {% set cond1_time = as_timestamp(state_attr('weather.stratford_hourly', 'forecast')[1].datetime) %}
          {% if cond1_time < next_rising and next_rising < next_setting %}
              {% if cond1 == 'sunny' %} night {% elif cond1 == 'partlycloudy' %} night-partly-cloudy {% else %} {{ cond1 }} {% endif %}
          {% else %}
              {{ cond1 }}
          {% endif %}
        weather_temperature_1: >
          {{ state_attr('weather.stratford_hourly', 'forecast')[1].temperature | round }}
        weather_timestamp_1: >
          {{ as_timestamp(state_attr('weather.stratford_hourly', 'forecast')[1].datetime) | timestamp_custom('%I') | int }} {{ as_timestamp(state_attr('weather.stratford_hourly', 'forecast')[1].datetime) | timestamp_custom('%p') }}

        weather_condition_2: >
          {% set cond2 = state_attr('weather.stratford_hourly', 'forecast')[2].condition %}
          {% set next_setting = as_timestamp(state_attr('sun.sun', 'next_setting')) %}
          {% set next_rising = as_timestamp(state_attr('sun.sun', 'next_rising')) %}
          {% set cond2_time = as_timestamp(state_attr('weather.stratford_hourly', 'forecast')[2].datetime) %}
          {% if cond2_time < next_rising and next_rising < next_setting %}
              {% if cond2 == 'sunny' %} night {% elif cond2 == 'partlycloudy' %} night-partly-cloudy {% else %} {{ cond2 }} {% endif %}
          {% else %}
              {{ cond2 }}
          {% endif %}
        weather_temperature_2: >
          {{ state_attr('weather.stratford_hourly', 'forecast')[2].temperature | round }}
        weather_timestamp_2: >
          {{ as_timestamp(state_attr('weather.stratford_hourly', 'forecast')[2].datetime) | timestamp_custom('%I') | int }} {{ as_timestamp(state_attr('weather.stratford_hourly', 'forecast')[2].datetime) | timestamp_custom('%p') }}

        weather_condition_3: >
          {% set cond3 = state_attr('weather.stratford_hourly', 'forecast')[3].condition %}
          {% set next_setting = as_timestamp(state_attr('sun.sun', 'next_setting')) %}
          {% set next_rising = as_timestamp(state_attr('sun.sun', 'next_rising')) %}
          {% set cond3_time = as_timestamp(state_attr('weather.stratford_hourly', 'forecast')[3].datetime) %}
          {% if cond3_time < next_rising and next_rising < next_setting %}
              {% if cond3 == 'sunny' %} night {% elif cond3 == 'partlycloudy' %} night-partly-cloudy {% else %} {{ cond3 }} {% endif %}
          {% else %}
              {{ cond3 }}
          {% endif %}
        weather_temperature_3: >
          {{ state_attr('weather.stratford_hourly', 'forecast')[3].temperature | round }}
        weather_timestamp_3: >
          {{ as_timestamp(state_attr('weather.stratford_hourly', 'forecast')[3].datetime) | timestamp_custom('%I') | int }} {{ as_timestamp(state_attr('weather.stratford_hourly', 'forecast')[3].datetime) | timestamp_custom('%p') }}

- sensor:
    - name: "Sunrise time"
      unique_id: sunrise_time
      state: "{{ as_timestamp(state_attr('sun.sun', 'next_rising')) | timestamp_custom('%I:%M') }}"
    - name: "Sunset time"
      unique_id: sunset_time
      state: "{{ as_timestamp(state_attr('sun.sun', 'next_setting')) | timestamp_custom('%I:%M') }}"

- platform: trend
  sensors:
    outside_temperature:
      entity_id: sensor.stratford_temperature
      friendly_name: "Temperature Trend"
      max_samples: 60
      sample_duration: 10800

Thank you

You need to add the following line before platform:

- binary_sensor:

Trend sensor is a part of binary sensor. I have a split configuration, which is why you do not see it in my config.

Here is another example form HA website:

Hope this helps.