Anyone looked into using Electronic Price Tag screens with HA?

Hi,
Where can I find these settings? (Searching without success :frowning: )

Open the tag in access point and change content as in screenshop.

image

@arganto Thanks a lot - found it :slight_smile:
Sadly there is no option I hoped to find - is there a way to change the update / wake frequency?
Is there a way to change the transmit power - I get less than 10 meters in distance - less than 5 with a wall in between, multiple house floor completely not working :frowning:

Not that I’m aware of. But currently I have not problems with ranges. I didn’t even install my second ap, which I would have to mesh such problems if they would appear. 20 meters with walls and floors do not make problems at the moment. Perhaps try to change the position and angel of the AP

1 Like

Did you check for updates of the AP? I had tags “forgetting” their settings. After the latest AP update this seems to have gone.

And: I had tags that didn’t work, after resetting them (take the batteries out, shorten the battery contacts), they worked fine.

Heya, I have a problem with a code I’m trying to send to one of my 2.9’’ displays.
The source-code is:

{% set today = now().strftime('%Y-%m-%d') %}{% set ns = namespace(counter=0) %}{% for week, menu_list in state_attr('skolmat.tunge_skola', 'calendar').items() %}
{% for menu_day in menu_list %}{% if menu_day.date >= today %}{% if ns.counter < 2 %}{% set ns.counter = ns.counter + 1 %}
{{ menu_day.weekday }} ({{ menu_day.date }})
{%- for course in menu_day.courses %}
• {{ course }}
{%- endfor -%}{% endif %}{% endif %}{% endfor %}{% endfor %}

And if I use this in the Dev tool > template it shows up with nice line feeds:

Onsdag (2024-04-17)
• Currykyckling, serveras med ris
• Pastagratäng med tomat och parmesan
Torsdag (2024-04-18)
• Krämig blomkålssoppa, serveras med mjukt bröd och pålägg

But when I send it to my panel it only show me all the info without any line feeds!
This is the code I use in the automation, is it something wrong with that one?
In the step details in the automation it shows up like the way I want it with line feeds and everything. But on my display its wierd, check the picture.
Thank you :slight_smile:
1212

Please post pictures of those meals! They sound far more interesting than mine:


I took a look at one of my displays that is doing carriage returns. It has this sensor

  - variables:
      anniversaries_upcoming: "{{ states('sensor.anniversaries_upcoming') | string }}"

The definition for sensor.anniversaries_upcoming is below. The {{"\n"}} (towards the bottom) part might be helpful for you?

platform: template
sensors:
  anniversaries_upcoming:
    value_template: >
      {%- set ns = namespace(a=[]) %}

      {%- for item in expand(integration_entities('anniversaries')) |
        selectattr("state", 'is_number') %}
        {%- set d_h = item.attributes.get('days_until_half_anniversary', 999) %}
        {%- set h = d_h < item.state | int %}
        {%- set d = [item.state | int, d_h] | min %}
        {%- set y = item.attributes.get('current_years') %}
        {%- set y = y + (0.5 if h else 1 if d != 0 else 0) if y is not none %} 
        {%- set ns.a = ns.a + [ dict(n=item.name, d=d, y=y, h=h)] %}
      {%- endfor %}

      {%- for item in ns.a | sort(attribute='d') -%}
        {%- set n, d, y, h = item.n, item.d, item.y, item.h %}
        {%- if d == 0 %}Today: {{ n }}
          {%-if y %} ({{ y }} year){%-endif %}{{"\n"}}
        {%- elif d < 45 %}{{ d }} day{{'s' if d > 1 }} until: {{ n }}
          {%-if y %} ({{ y }} year){%-endif %}{{"\n"}}
        {%- endif %}
      {%- endfor %}
    
    friendly_name: "Anniversaries Upcoming"
1 Like

Thank you! Looks like this could be the solution for me :slight_smile:

1 Like

I use the multiline function and add a delimiter where I need to line break.

1 Like

I love this project and I’d like to get some tags of my own, but I’m struggling to find anywhere that sells them in the UK (or at all for that matter!), if anyone has any links I’d greatly appreciate it :slight_smile:

Thx for sharing it last year. I took over several things and adjusted to my needs and taste. Big and square small one.

1 Like

looks great, better than mine! would you mind sharing the code?

Of course.

alias: EPaper Wetter groß
description: ""
trigger:
  - platform: state
    entity_id:
      - sensor.weather_home_daily
    to: null
    id: wetter_state
  - platform: state
    entity_id:
      - sensor.weather_home_daily
    id: wetter_alles
  - platform: state
    entity_id:
      - sensor.moon_phase
    id: mond
  - platform: state
    entity_id:
      - group.jemand_zu_hause
    to: home
condition:
  - condition: time
    after: "05:30:00"
    before: "23:30:00"
action:
  - if:
      - condition: trigger
        id:
          - wetter_alles
          - mond
    then:
      - condition: template
        value_template: >-
          {{ (as_timestamp(now()) -
          as_timestamp(state_attr("automation.epaper_wetter_gross","last_triggered")
          | default(0)) | int > 3600 ) }}
  - service: counter.increment
    metadata: {}
    data: {}
    target:
      entity_id: counter.epaper_wetter_update_counter
  - service: open_epaper_link.drawcustom
    target:
      entity_id:
        - open_epaper_link.xxx
        - open_epaper_link.yyy
        - open_epaper_link.zzz
    data:
      background: white
      dry-run: false
      rotate: 0
      payload:
        - type: text
          value: "{{ ['Mo','Di','Mi','Do','Fr','Sa','So'][now().weekday()] }}"
          x: 18
          "y": 8
          anchor: la
          size: 32
          color: black
        - type: text
          value: "{{ '{:02d}'.format(now().day) }}.{{ '{:02d}'.format(now().month) }}."
          x: 18
          "y": 43
          anchor: la
          size: 26
          color: black
        - type: text
          value: >
            {% set temp =
            states('sensor.aussenthermometer_actual_temperature')|float %} {% if
            temp < 10 %}
              {% set temp = temp|round(0,"floor")|string %}
            {% elif temp > 20 %}
              {% set temp = temp|round(0,"ceil")|string %}
            {% else %}
              {% set temp = (((temp>0)-(temp<0))*(temp|abs+0.5)|int)|string %}
            {% endif %}

            {{ temp ~ "°" }}         
          x: |
            {{ 93 - 93 + 18}}
          "y": 147
          anchor: la
          size: 70
          color: black
        - type: text
          value: >-
            {% set templow =
            state_attr('sensor.weather_home_daily','forecast')[0].templow|float
            %} {% if templow < 10 %}
              {% set templow = templow|round(0,"floor")|string %}
            {% elif templow > 20 %}
              {% set templow = templow|round(0,"ceil")|string %}
            {% else %}
              {% set templow = (((templow>0)-(templow<0))*(templow|abs+0.5)|int)|string %}
            {% endif %}

            {% set tempmax =
            state_attr('sensor.weather_home_daily','forecast')[0].temperature|float
            %} {% if tempmax < 10 %}
              {% set tempmax = tempmax|round(0,"floor")|string %}
            {% elif tempmax > 20 %}
              {% set tempmax = tempmax|round(0,"ceil")|string %}
            {% else %}
              {% set tempmax = (((tempmax>0)-(tempmax<0))*(tempmax|abs+0.5)|int)|string %}
            {% endif %}

            {{ templow ~ "° - " ~ tempmax ~ "°"}}
          x: 18
          "y": 229
          anchor: la
          size: 24
        - type: text
          value: >-
            {% set tag =
            ['','Mo','Di','Mi','Do','Fr','Sa','So'][as_datetime(state_attr('sensor.weather_home_daily',
            'forecast')[1].datetime).strftime('%u')|int] %} {{tag}}
          x: |
            {{ 238 - var_temp_laenge }}
          "y": 103
          anchor: la
          size: 24
          color: >-
            {% set templow =
            state_attr('sensor.weather_home_daily','forecast')[1].templow|float|round(0,"floor")
            %}

            {% if templow < 3 %}
              red
            {% else %}
              black
            {% endif %} 
        - type: text
          value: >-
            {% set templow =
            state_attr('sensor.weather_home_daily','forecast')[1].templow|float
            %} {% if templow < 10 %}
              {% set templow = templow|round(0,"floor")|string %}
            {% elif templow > 20 %}
              {% set templow = templow|round(0,"ceil")|string %}
            {% else %}
              {% set templow = (((templow>0)-(templow<0))*(templow|abs+0.5)|int)|string %}
            {% endif %}

            {% set tempmax =
            state_attr('sensor.weather_home_daily','forecast')[1].temperature|float
            %} {% if tempmax < 10 %}
              {% set tempmax = tempmax|round(0,"floor")|string %}
            {% elif tempmax > 20 %}
              {% set tempmax = tempmax|round(0,"ceil")|string %}
            {% else %}
              {% set tempmax = (((tempmax>0)-(tempmax<0))*(tempmax|abs+0.5)|int)|string %}
            {% endif %}

            {{ templow ~ "° - " ~ tempmax ~ "°"}}
          x: |
            {{ 238 - var_temp_laenge }}
          "y": 128
          anchor: la
          size: 24
        - type: text
          value: >-
            {% set tag =
            ['','Mo','Di','Mi','Do','Fr','Sa','So'][as_datetime(state_attr('sensor.weather_home_daily',
            'forecast')[2].datetime).strftime('%u')|int] %} {{tag}}
          x: |
            {{ 238 - var_temp_laenge }}
          "y": 166
          anchor: la
          size: 24
          color: >-
            {% set templow =
            state_attr('sensor.weather_home_daily','forecast')[2].templow|float|round(0,"floor")
            %}

            {% if templow < 3 %}
              red
            {% else %}
              black
            {% endif %} 
        - type: text
          value: >-
            {% set templow =
            state_attr('sensor.weather_home_daily','forecast')[2].templow|float
            %} {% if templow < 10 %}
              {% set templow = templow|round(0,"floor")|string %}
            {% elif templow > 20 %}
              {% set templow = templow|round(0,"ceil")|string %}
            {% else %}
              {% set templow = (((templow>0)-(templow<0))*(templow|abs+0.5)|int)|string %}
            {% endif %}

            {% set tempmax =
            state_attr('sensor.weather_home_daily','forecast')[2].temperature|float
            %} {% if tempmax < 10 %}
              {% set tempmax = tempmax|round(0,"floor")|string %}
            {% elif tempmax > 20 %}
              {% set tempmax = tempmax|round(0,"ceil")|string %}
            {% else %}
              {% set tempmax = (((tempmax>0)-(tempmax<0))*(tempmax|abs+0.5)|int)|string %}
            {% endif %}

            {{ templow ~ "° - " ~ tempmax ~ "°"}}
          x: |
            {{ 238 - var_temp_laenge }}
          "y": 191
          anchor: la
          size: 24
        - type: text
          value: >-
            {% set tag =
            ['','Mo','Di','Mi','Do','Fr','Sa','So'][as_datetime(state_attr('sensor.weather_home_daily',
            'forecast')[3].datetime).strftime('%u')|int] %} {{tag}}
          x: |
            {{ 238 - var_temp_laenge }}
          "y": 229
          anchor: la
          size: 24
          color: >-
            {% set templow =
            state_attr('sensor.weather_home_daily','forecast')[3].templow|float|round(0,"floor")
            %} {% if templow < 3 %}
              red
            {% else %}
              black
            {% endif %} 
        - type: text
          value: >-
            {% set templow =
            state_attr('sensor.weather_home_daily','forecast')[3].templow|float
            %} {% if templow < 10 %}
              {% set templow = templow|round(0,"floor")|string %}
            {% elif templow > 20 %}
              {% set templow = templow|round(0,"ceil")|string %}
            {% else %}
              {% set templow = (((templow>0)-(templow<0))*(templow|abs+0.5)|int)|string %}
            {% endif %}

            {% set tempmax =
            state_attr('sensor.weather_home_daily','forecast')[3].temperature|float
            %} {% if tempmax < 10 %}
              {% set tempmax = tempmax|round(0,"floor")|string %}
            {% elif tempmax > 20 %}
              {% set tempmax = tempmax|round(0,"ceil")|string %}
            {% else %}
              {% set tempmax = (((tempmax>0)-(tempmax<0))*(tempmax|abs+0.5)|int)|string %}
            {% endif %}

            {{ templow ~ "° - " ~ tempmax ~ "°"}}
          x: |
            {{ 238 - var_temp_laenge }}
          "y": 254
          anchor: la
          size: 24
        - type: text
          value: Mond
          x: 339
          "y": 17
          anchor: ra
          size: 16
        - type: text
          value: >-
            {% from 'easy_time.jinja' import count_the_days %} {% set mond_tage
            = count_the_days(states('sensor.next_full_moon'))|int %} {% set
            mond_datum = strptime(states('sensor.next_full_moon'),"%Y-%m-%d
            %H:%M:%S") %} {% if mond_tage > 10 %}
              {% set mond_tage = count_the_days(states('sensor.last_full_moon'))|int %}
            {% endif %}

            {% if mond_tage < -4 %}
              {{ mond_datum.day }}.{{ '{:02d}'.format(mond_datum.month) }}.
            {% elif mond_tage < -2  %}
              {{ mond_tage }}
            {% elif mond_tage == -2  %}
              Vorgestern
            {% elif mond_tage == -1  %}
              Gestern  
            {% elif mond_tage == 0  %}
              Heute
            {% elif mond_tage == 1  %}
              Morgen
            {% elif mond_tage == 2  %}
              Übermorgen  
            {% elif mond_tage > 4  %}
              {{ mond_datum.day }}.{{ '{:02d}'.format(mond_datum.month) }}.
            {% elif mond_tage > 3  %}
              {{ ' +' ~ mond_tage ~ " Tage" }}      
            {% endif %}
          x: 339
          "y": 34
          anchor: ra
          size: 16
        - type: icon
          value: >-
            {% from 'easy_time.jinja' import count_the_days %} {% set mond_tage
            = count_the_days(states('sensor.last_full_moon'))|int %} {% if
            mond_tage == 0 %}
              moon-full
            {% else %}            
              {{ ("moon-" ~
              states('sensor.moon_phase')|replace('_','-'))|replace('moon-new-moon','moon-new')|replace('moon-full-moon','moon-full')
              }}
            {% endif %}
          x: 346
          "y": 16
          anchor: la
          size: 40
          color: black
        - type: dlimg
          url: >-
            http://192.168.178.100:8123/local/open_epaper_link/open_epaper_arrow_down.png
          x: 68
          "y": 104
          anchor: mm
          xsize: 50
          ysize: 50
          rotate: >-
            {{ state_attr('sensor.weather_home_daily', 'wind_bearing')|round(0)
            }}          
        - type: icon
          value: "{{ var_icon_array[states(\"sensor.weather_home_daily\")] }}"
          x: |
            {{ 93 - 93 + 18}}
          "y": 101
          size: 55
          anchor: la
          color: black
          visible: true
        - type: icon
          value: >-
            {{
            var_icon_array[state_attr('sensor.weather_home_daily','forecast')[1].condition]
            }}
          x: 298
          "y": 105
          size: 55
          anchor: la
          color: black
        - type: icon
          value: >-
            {{
            var_icon_array[state_attr('sensor.weather_home_daily','forecast')[2].condition]
            }}
          x: 298
          "y": 168
          size: 55
          anchor: la
          color: black
        - type: icon
          value: >-
            {{
            var_icon_array[state_attr('sensor.weather_home_daily','forecast')[3].condition]
            }}
          x: 298
          "y": 231
          size: 55
          anchor: la
          color: black
        - type: text
          value: >-
            {{
            state_attr('sensor.weather_home_daily','forecast')[0].precipitation|float|round(0,"ceil")
            ~ " L" ~ " - " ~
            state_attr('sensor.weather_home_daily','forecast')[0].precipitation_probability|float|round(0,"ceil")
            ~ "%" }} 
          x: |
            {{ 93 - 93 + 18}}
          "y": 254
          anchor: la
          size: 24
          visible: >
            {{
            state_attr('sensor.weather_home_daily','forecast')[0].precipitation|float|round(0,"ceil")
            > -10 }}
        - type: text
          value: >-

            {{
            state_attr('sensor.weather_home_daily','forecast')[1].precipitation|float|round(0,"ceil")
            ~" L" }}
          x: 360
          "y": 134
          anchor: la
          size: 16
          visible: >
            {{
            state_attr('sensor.weather_home_daily','forecast')[1].precipitation|float|round(0,"ceil")
            > -10 }}
        - type: text
          value: >-
            {{
            state_attr('sensor.weather_home_daily','forecast')[2].precipitation|float|round(0,"ceil")
            ~" L" }}
          x: 360
          "y": 197
          anchor: la
          size: 16
          visible: >
            {{
            state_attr('sensor.weather_home_daily','forecast')[2].precipitation|float|round(0,"ceil")
            > -10 }}      
        - type: text
          value: >-
            {{
            state_attr('sensor.weather_home_daily','forecast')[3].precipitation|float|round(0,"ceil")
            ~" L" }}
          x: 360
          "y": 260
          anchor: la
          size: 16
          visible: >
            {{
            state_attr('sensor.weather_home_daily','forecast')[3].precipitation|float|round(0,"ceil")
            > -10 }}
        - type: icon
          value: windsock
          x: 106
          "y": 15
          anchor: la
          size: 30
          color: >
            {% set wind = state_attr('sensor.weather_home_daily',
            'forecast')[0].wind_speed|int  %} {% if wind > 74 %}
              red
            {% else %}
              black
            {% endif %}
          visible: >
            {% set wind = state_attr('sensor.weather_home_daily',
            'forecast')[0].wind_speed|int %} {{ wind > 49 }}    
        - type: icon
          value: windsock
          x: 358
          "y": 112
          anchor: la
          size: 25
          color: >
            {% set wind = state_attr('sensor.weather_home_daily',
            'forecast')[1].wind_speed|int %} {% if wind > 74 %}
              red
            {% else %}
              black
            {% endif %}
          visible: >
            {% set wind = state_attr('sensor.weather_home_daily',
            'forecast')[1].wind_speed|int %} {{ wind > 49 }}    
        - type: icon
          value: windsock
          x: 358
          "y": 175
          anchor: la
          size: 25
          color: >
            {% set wind = state_attr('sensor.weather_home_daily',
            'forecast')[2].wind_speed|int %} {% if wind > 74 %}
              red
            {% else %}
              black
            {% endif %}
          visible: >
            {% set wind = state_attr('sensor.weather_home_daily',
            'forecast')[2].wind_speed|int %} {{ wind > 49 }}    
        - type: icon
          value: windsock
          x: 360
          "y": 238
          anchor: la
          size: 25
          color: >
            {% set wind = state_attr('sensor.weather_home_daily',
            'forecast')[3].wind_speed|int %} {% if wind > 74 %}
              red
            {% else %}
              black
            {% endif %}
          visible: >
            {% set wind = state_attr('sensor.weather_home_daily',
            'forecast')[3].wind_speed|int %} {{ wind > 49 }}
        - type: icon
          value: alert-octagon
          x: >
            {% set wind = state_attr('sensor.weather_home_daily',
            'forecast')[0].wind_speed|int  %} {% if wind > 49 %}
              150
            {% else %}
              106
            {% endif %}
          "y": 15
          anchor: la
          size: 30
          color: >
            {% if
            states('sensor.dwd_wetterwarnung_current_warning_level')|int
            == 3
               or states('sensor.dwd_wetterwarnung_advance_warning_level')|int == 3
            %}red{% else %}black{% endif %}
          visible: >
            {{
            states('sensor.dwd_wetterwarnung_current_warning_level')|int
            > 0
               or states('sensor.dwd_wetterwarnung_advance_warning_level')|int > 0 }}            
variables:
  var_icon_array: |
    {% set array = {
      'clearsky':'weather-sunny',
      'clear-night':'weather-night',
      'clear-night2':'weather-night-partly-cloudy',           
      'cloudy':'weather-cloudy',        
      'fair':'weather-sunny',        
      'sunny':'weather-sunny',
      'fog':'weather-fog',
      'heavyrain':'weather-pouring',        
      'heavyrainandthunder':'weather-lightning-rainy',        
      'heavyrainshowers':'weather-pouring',
      'heavyrainshowersandthunder':'weather-lightning-rainy',
      'heavysleet':'weather-snowy-heavy',        
      'heavysleetandthunder':'weather-snowy-heavy',        
      'heavysleetshowers':'weather-snowy-rainy',
      'heavysleetshowersandthunder':'weather-snowy-rainy',
      'heavysnow':'weather-snowy-heavy',        
      'heavysnowandthunder':'wweather-snowy-rainy',        
      'heavysnowshowers':'weather-snowy-heavy',
      'heavysnowshowersandthunder':'weather-snowy-heavy',
      'lightrain':'weather-rainy',        
      'lightrainandthunder':'weather-lightning-rainy',        
      'lightrainshowers':'weather-partly-rainy',
      'lightrainshowersandthunder':'weather-partly-lightning',
      'lightsleet':'weather-snowy-rainy',        
      'lightsleetandthunder':'weather-snowy-rainy',        
      'lightsleetshowers':'weather-snowy-rainy',
      'lightsnow':'weather-snowy',
      'lightsnowandthunder':'weather-snowy',
      'lightsnowshowers':'weather-snowy-rainy',        
      'lightssleetshowersandthunder':'weather-snowy-rainy',        
      'lightssnowshowersandthunder':'weather-snowy-rainy',
      'partlycloudy':'weather-partly-cloudy',
      'rainy':'weather-rainy',
      'rainandthunder':'weather-lightning-rainy',
      'rainshowers':'weather-partly-rainy',
      'rainshowersandthunder':'weather-lightning-rainy',
      'sleet':'weather-snowy',
      'sleetandthunder':'weather-snowy',
      'sleetshowers':'weather-snowy',
      'sleetshowersandthunder':'weather-snowy',
      'snow':'weather-snowy',
      'snowandthunder':'weather-snowy',
      'snowshowers':'weather-snowy',
      'snowshowersandthunder':'weather-snowy' }
    %} {{ array }} 
  var_temp_laenge: >
    {% set temp_laenge_max = 0 %}  

    {% set templow =
    state_attr('sensor.weather_home_daily','forecast')[1].templow|float %} {% if
    templow < 10 %}
      {% set templow = templow|round(0,"floor")|string %}
    {% elif templow > 20 %}
      {% set templow = templow|round(0,"ceil")|string %}
    {% else %}
      {% set templow = (((templow>0)-(templow<0))*(templow|abs+0.5)|int)|string %}
    {% endif %}

    {% set tempmax =
    state_attr('sensor.weather_home_daily','forecast')[1].temperature|float %}
    {% if tempmax < 10 %}
      {% set tempmax = tempmax|round(0,"floor")|string %}
    {% elif tempmax > 20 %}
      {% set tempmax = tempmax|round(0,"ceil")|string %}
    {% else %}
      {% set tempmax = (((tempmax>0)-(tempmax<0))*(tempmax|abs+0.5)|int)|string %}
    {% endif %}

    {% set temp_laenge = namespace(foo=0) %}

    {% for i in range(templow|length) %}
      {% set d = {
        '-': 14,
        '0': 15,
        '1': 9,
        '2': 14,
        '3': 14,
        '4': 16,
        '5': 15,
        '6': 15,
        '7': 14,
        '8': 15,
        '9': 14 } %}
      {% set temp_laenge.foo = temp_laenge.foo + d.get(templow[i]) %}
    {% endfor %}

    {% for i in range(tempmax|length) %}
      {% set d = {
        '-': 14,  
        '0': 15,
        '1': 9,
        '2': 14,
        '3': 14,
        '4': 16,
        '5': 15,
        '6': 15,
        '7': 14,
        '8': 15,
        '9': 14 } %}
      {% set temp_laenge.foo = temp_laenge.foo + d.get(tempmax[i]) %}
    {% endfor %}

    {% if temp_laenge.foo > temp_laenge_max %}
      {% set temp_laenge_max = temp_laenge.foo %}
    {% endif %}  

    {% set templow =
    state_attr('sensor.weather_home_daily','forecast')[2].templow|float %} {% if
    templow < 10 %}
      {% set templow = templow|round(0,"floor")|string %}
    {% elif templow > 20 %}
      {% set templow = templow|round(0,"ceil")|string %}
    {% else %}
      {% set templow = (((templow>0)-(templow<0))*(templow|abs+0.5)|int)|string %}
    {% endif %}

    {% set tempmax =
    state_attr('sensor.weather_home_daily','forecast')[2].temperature|float %}
    {% if tempmax < 10 %}
      {% set tempmax = tempmax|round(0,"floor")|string %}
    {% elif tempmax > 20 %}
      {% set tempmax = tempmax|round(0,"ceil")|string %}
    {% else %}
      {% set tempmax = (((tempmax>0)-(tempmax<0))*(tempmax|abs+0.5)|int)|string %}
    {% endif %}

    {% set temp_laenge = namespace(foo=0) %}

    {% for i in range(templow|length) %}
      {% set d = {
        '-': 14,
        '0': 15,
        '1': 9,
        '2': 14,
        '3': 14,
        '4': 16,
        '5': 15,
        '6': 15,
        '7': 14,
        '8': 15,
        '9': 14 } %}
      {% set temp_laenge.foo = temp_laenge.foo + d.get(templow[i]) %}
    {% endfor %}

    {% for i in range(tempmax|length) %}
      {% set d = {
        '-': 14,  
        '0': 15,
        '1': 9,
        '2': 14,
        '3': 14,
        '4': 16,
        '5': 15,
        '6': 15,
        '7': 14,
        '8': 15,
        '9': 14 } %}
      {% set temp_laenge.foo = temp_laenge.foo + d.get(tempmax[i]) %}
    {% endfor %}

    {% if temp_laenge.foo > temp_laenge_max %}
      {% set temp_laenge_max = temp_laenge.foo %}
    {% endif %}  

    {% set templow =
    state_attr('sensor.weather_home_daily','forecast')[3].templow|float %} {% if
    templow < 10 %}
      {% set templow = templow|round(0,"floor")|string %}
    {% elif templow > 20 %}
      {% set templow = templow|round(0,"ceil")|string %}
    {% else %}
      {% set templow = (((templow>0)-(templow<0))*(templow|abs+0.5)|int)|string %}
    {% endif %}

    {% set tempmax =
    state_attr('sensor.weather_home_daily','forecast')[3].temperature|float %}
    {% if tempmax < 10 %}
      {% set tempmax = tempmax|round(0,"floor")|string %}
    {% elif tempmax > 20 %}
      {% set tempmax = tempmax|round(0,"ceil")|string %}
    {% else %}
      {% set tempmax = (((tempmax>0)-(tempmax<0))*(tempmax|abs+0.5)|int)|string %}
    {% endif %}

    {% set temp_laenge = namespace(foo=0) %}

    {% for i in range(templow|length) %}
      {% set d = {
        '-': 14,
        '0': 15,
        '1': 9,
        '2': 14,
        '3': 14,
        '4': 16,
        '5': 15,
        '6': 15,
        '7': 14,
        '8': 15,
        '9': 14 } %}
      {% set temp_laenge.foo = temp_laenge.foo + d.get(templow[i]) %}
    {% endfor %}

    {% for i in range(tempmax|length) %}
      {% set d = {
        '-': 14,  
        '0': 15,
        '1': 9,
        '2': 14,
        '3': 14,
        '4': 16,
        '5': 15,
        '6': 15,
        '7': 14,
        '8': 15,
        '9': 14 } %}
      {% set temp_laenge.foo = temp_laenge.foo + d.get(tempmax[i]) %}
    {% endfor %}

    {% if temp_laenge.foo > temp_laenge_max %}
      {% set temp_laenge_max = temp_laenge.foo %}
    {% endif %}  

    {{ temp_laenge_max }}
mode: queued
max: 10

Some infos:

  • I put the icon mapping in a variable
  • The other variable is for having theforecast day and temperatures left aligned but always as right as possiblem. For this I counted the pixcels and calculate the x avalue
  • The color coding for temperature and wind is still there
  • The wind as well, but nor with visible parameter and not with pushing x and y out of display
  • The rounding looks most probaly weired, but I wanted to have german rounding (,5 is 1) but round down on low temperature and round up on high for this display.
2 Likes

much cleaner than my old code, which doesn’t work anymore anyway due to the changes in the met.no sensors.
What about the small one?

Here I use now local sensors with forcast deriving from met.no. They are used in the automation.

  - trigger:
    - platform: time_pattern
      minutes: "/30"
    - platform: homeassistant
      event: start
    - platform: event
      event_type: event_template_reloaded
    action:
      - service: weather.get_forecasts
        target:
          entity_id: weather.home
        data:
          type: hourly
        response_variable: hourly_forecast
      - service: weather.get_forecasts
        target:
          entity_id: weather.home
        data:
          type: daily
        response_variable: daily_forecast
    sensor:
      - name: "Weather Home Hourly"
        unique_id: waether_home_hourly
        state: "{{ states('weather.home') }}"
        attributes:
          temperature: "{{ state_attr('weather.home', 'temperature') }}"
          dew_point: "{{ state_attr('weather.home', 'dew_point') }}"
          temperature_unit: "{{ state_attr('weather.home', 'temperature_unit') }}"
          humidity: "{{ state_attr('weather.home', 'humidity') }}"
          cloud_coverage: "{{ state_attr('weather.home', 'cloud_coverage') }}"
          pressure: "{{ state_attr('weather.home', 'pressure') }}"
          pressure_unit: "{{ state_attr('weather.home', 'pressure_unit') }}"
          wind_bearing: "{{ state_attr('weather.home', 'wind_bearing') }}"
          wind_gust_speed: "{{ state_attr('weather.home', 'wind_gust_speed') }}"
          wind_speed: "{{ state_attr('weather.home', 'wind_speed') }}"
          wind_speed_unit: "{{ state_attr('weather.home', 'wind_speed_unit') }}"
          visibility: "{{ state_attr('weather.home', 'visibility') }}"
          visibility_unit: "{{ state_attr('weather.home', 'visibility_unit') }}"
          precipitation: "{{ state_attr('weather.home', 'precipitation') }}"
          precipitation_unit: "{{ state_attr('weather.home', 'precipitation_unit') }}"
          forecast: "{{ hourly_forecast['weather.home'].forecast[:23] }}"
      - name: "Weather Home Daily"
        unique_id: weather_home_daily
        state: "{{ states('weather.home') }}"
        attributes:
          temperature: "{{ state_attr('weather.home', 'temperature') }}"
          dew_point: "{{ state_attr('weather.home', 'dew_point') }}"
          temperature_unit: "{{ state_attr('weather.home', 'temperature_unit') }}"
          humidity: "{{ state_attr('weather.home', 'humidity') }}"
          cloud_coverage: "{{ state_attr('weather.home', 'cloud_coverage') }}"
          pressure: "{{ state_attr('weather.home', 'pressure') }}"
          pressure_unit: "{{ state_attr('weather.home', 'pressure_unit') }}"
          wind_bearing: "{{ state_attr('weather.home', 'wind_bearing') }}"
          wind_gust_speed: "{{ state_attr('weather.home', 'wind_gust_speed') }}"
          wind_speed: "{{ state_attr('weather.home', 'wind_speed') }}"
          wind_speed_unit: "{{ state_attr('weather.home', 'wind_speed_unit') }}"
          visibility: "{{ state_attr('weather.home', 'visibility') }}"
          visibility_unit: "{{ state_attr('weather.home', 'visibility_unit') }}"
          precipitation: "{{ state_attr('weather.home', 'precipitation') }}"
          precipitation_unit: "{{ state_attr('weather.home', 'precipitation_unit') }}"
          forecast: "{{ daily_forecast['weather.home'].forecast[:5] }}"

And the small one is

alias: EPaper Wetter klein
description: ""
trigger:
  - platform: state
    entity_id:
      - sensor.weather_home_daily
    to: null
    id: wetter_state
  - platform: state
    entity_id:
      - sensor.weather_home_daily
    id: wetter_alles
  - platform: state
    entity_id:
      - group.jemand_zu_hause
    to: home
condition:
  - condition: time
    after: "03:30:00"
    before: "23:30:00"
action:
  - if:
      - condition: trigger
        id:
          - wetter_alles
    then:
      - condition: template
        value_template: >-
          {{ (as_timestamp(now()) -
          as_timestamp(state_attr("automation.epaper_wetter_klein","last_triggered")
          | default(0)) | int > 3600 ) }}
  - service: counter.increment
    metadata: {}
    data: {}
    target:
      entity_id: counter.epaper_wetter_klein_update_counter
    enabled: true
  - service: open_epaper_link.drawcustom
    target:
      entity_id:
        - open_epaper_link.xxx
    data:
      background: white
      dry-run: false
      rotate: 0
      payload:
        - type: text
          value: >-
            {{ ['Mo','Di','Mi','Do','Fr','Sa','So'][now().weekday()] }}, {{
            '{:02d}'.format(now().day) }}.{{ '{:02d}'.format(now().month) }}.
          x: 9
          "y": 4
          anchor: la
          size: 16
          color: black
        - type: text
          value: "{{ '{:02d}'.format(now().day) }}.{{ '{:02d}'.format(now().month) }}."
          x: 9
          "y": 20
          anchor: la
          size: 16
          color: black
          visible: false
        - type: text
          value: >-
            {% set templow =
            state_attr('sensor.weather_home_daily','forecast')[0].templow|float
            %} {% if templow < 10 %}
              {% set templow = templow|round(0,"floor")|string %}
            {% elif templow > 20 %}
              {% set templow = templow|round(0,"ceil")|string %}
            {% else %}
              {% set templow = (((templow>0)-(templow<0))*(templow|abs+0.5)|int)|string %}
            {% endif %}

            {% set tempmax =
            state_attr('sensor.weather_home_daily','forecast')[0].temperature|float
            %} {% if tempmax < 10 %}
              {% set tempmax = tempmax|round(0,"floor")|string %}
            {% elif tempmax > 20 %}
              {% set tempmax = tempmax|round(0,"ceil")|string %}
            {% else %}
              {% set tempmax = (((tempmax>0)-(tempmax<0))*(tempmax|abs+0.5)|int)|string %}
            {% endif %}

            {{ templow ~ "° - " ~ tempmax ~ "°"}}
          x: 9
          "y": 20
          anchor: la
          size: 20
        - type: icon
          value: >-
            {{
            var_icon_array[state_attr('sensor.weather_home_daily','forecast')[1].condition]
            }}
          x: 144
          "y": 9
          size: 42
          anchor: rt
          color: black
        - type: text
          value: >
            {% set temp =
            states('sensor.aussenthermometer_actual_temperature')|float %} {% if
            temp < 10 %}
              {% set temp = temp|round(0,"floor")|string %}
            {% elif temp > 20 %}
              {% set temp = temp|round(0,"ceil")|string %}
            {% else %}
              {% set temp = (((temp>0)-(temp<0))*(temp|abs+0.5)|int)|string %}
            {% endif %}

            {{ temp ~ "°" }}                   
          x: 76
          "y": 43
          size: 60
          anchor: ma
          color: black
        - type: icon
          value: alert-octagon
          x: 146
          "y": 84
          anchor: ra
          size: 25
          color: >
            {% if
            states('sensor.dwd_wetterwarnung_gemeinde_warning_level')|int
            == 3
               or states('sensor.dwd_wetterwarnung_advance_warning_level')|int == 3
            %}red{% else %}black{% endif %}
          visible: >
            {{
            states('sensor.dwd_wetterwarnung_current_warning_level')|int
            > 0
               or states('sensor.dwd_wetterwarnung_advance_warning_level')|int > -0 }}
        - type: text
          value: >-
            {{
            state_attr('sensor.weather_home_daily','forecast')[0].precipitation|float|round(0,"ceil")
            ~ " L" ~ " / " ~
            state_attr('sensor.weather_home_daily','forecast')[0].precipitation_probability|float|round(0,"ceil")
            ~ "%" }}
          x: 76
          "y": 121
          anchor: ma
          size: 20
          visible: >
            {{
            state_attr('sensor.weather_home_daily','forecast')[0].precipitation|float|round(0,"ceil")
            > -10 }}
variables:
  var_icon_array: |
    {% set array = {
      'clearsky':'weather-sunny',
      'clear-night':'weather-night',
      'clear-night2':'weather-night-partly-cloudy',           
      'cloudy':'weather-cloudy',        
      'fair':'weather-sunny',        
      'sunny':'weather-sunny',
      'fog':'weather-fog',
      'heavyrain':'weather-pouring',        
      'heavyrainandthunder':'weather-lightning-rainy',        
      'heavyrainshowers':'weather-pouring',
      'heavyrainshowersandthunder':'weather-lightning-rainy',
      'heavysleet':'weather-snowy-heavy',        
      'heavysleetandthunder':'weather-snowy-heavy',        
      'heavysleetshowers':'weather-snowy-rainy',
      'heavysleetshowersandthunder':'weather-snowy-rainy',
      'heavysnow':'weather-snowy-heavy',        
      'heavysnowandthunder':'wweather-snowy-rainy',        
      'heavysnowshowers':'weather-snowy-heavy',
      'heavysnowshowersandthunder':'weather-snowy-heavy',
      'lightrain':'weather-rainy',        
      'lightrainandthunder':'weather-lightning-rainy',        
      'lightrainshowers':'weather-partly-rainy',
      'lightrainshowersandthunder':'weather-partly-lightning',
      'lightsleet':'weather-snowy-rainy',        
      'lightsleetandthunder':'weather-snowy-rainy',        
      'lightsleetshowers':'weather-snowy-rainy',
      'lightsnow':'weather-snowy',
      'lightsnowandthunder':'weather-snowy',
      'lightsnowshowers':'weather-snowy-rainy',        
      'lightssleetshowersandthunder':'weather-snowy-rainy',        
      'lightssnowshowersandthunder':'weather-snowy-rainy',
      'partlycloudy':'weather-partly-cloudy',
      'rainy':'weather-rainy',
      'rainandthunder':'weather-lightning-rainy',
      'rainshowers':'weather-partly-rainy',
      'rainshowersandthunder':'weather-lightning-rainy',
      'sleet':'weather-snowy',
      'sleetandthunder':'weather-snowy',
      'sleetshowers':'weather-snowy',
      'sleetshowersandthunder':'weather-snowy',
      'snow':'weather-snowy',
      'snowandthunder':'weather-snowy',
      'snowshowers':'weather-snowy',
      'snowshowersandthunder':'weather-snowy' }
    %} {{ array }}             
mode: queued
max: 10

2 Likes

I love these price tags!
Demo movie:
https://dms.licdn.com/playlist/vid/D4E05AQE42PulNwFtig/mp4-640p-30fp-crf28/0/1716144748030?e=2147483647&v=beta&t=LCkBmj2orM5Ex_WbmQuEf-7_3rw07URB5lEZP74CU1k

I love esp. the integration.

For the tags (have lots of them nevertheless) I would like to have more beautiful ones with same border and without bar codes. Saw a lot of prettier ones here in the markets. And the big ones in white instead of black.

Yes, I know, that I can pull the barcode tag, but then I have still the big site and an empty slot with a little hole.

I just made a Nordpool portrait template.
If I could then I would use the landscape versions that has been posted previously here in the thread but since I need it to fit with other displays I need it in portrait mode.

It displays today and tomorrows prices with a maximum of 12 times. Cheapest times are marked with a red bold border, highest prices are written in red.

Here is the template that I added some easy tweaks for different currencies and such also.

alias: Elpriser kĂśksdisplay
description: ""
trigger:
  - platform: time_pattern
    hours: /1
condition: []
action:
  - service: open_epaper_link.drawcustom
    target:
      entity_id:
        - open_epaper_link.0000021e68ba3b1b
    data:
      background: white
      rotate: 270
      payload: >
        {% set ns = namespace( text_list = [], line =0) %} 
        {% set nordpool = "sensor.nordpool_kwh_se4_sek_3_10_025" %} 
        {% set cheapest = 5 %} {## Number of cheapest times per day to highlight ##} 
        {% set expensivest = 5 %} {## Number of expensivest times per day to highlight ##} 
        {% set decimal = "," %}  {## decimal separator in currency ##} 
        {% set currency = "kr" %} {## include space if needed/wanted ##} 
        {% set position = "trailing" %} {## trailing or leading position of currency ##} 
        {% set decimal_places = 2 %}

        {## No need to change anything below here ##} 

        {% for day in ["today", "tomorrow"] %}
          {% for s in state_attr(nordpool,'raw_' ~ day)-%}
            {% if s.end > now() -%}
              {%- set ns.text_list = ns.text_list +  

               [{ "type": "rectangle",  
                 "x_start": 1,
                 "x_end": 127,
                 "y_start": 1 + (25*ns.line), 
                 "y_end": 25 + (25*ns.line),
                 "width": 4 if s.value in (state_attr(nordpool, day) | sort(reverse = false))[0:cheapest] else 2,
                 "fill": "white",
                 "outline": "red" if s.value in (state_attr(nordpool, day) | sort(reverse = false))[0:cheapest] else "black"}] +

              [{ "type": "text",  
                 "value": ("0" ~ s.start.hour)[-2:3] ~ ":00", 
                 "font": "ppb.ttf",
                 "x": 5,
                 "y":  7 + (25*ns.line), 
                 "size": 16,
                 "color": "red" if s.value in (state_attr(nordpool, day) | sort(reverse = true))[0:expensivest] else "black"} ] +
                 
              [{ "type": "text",  
                 "value": (currency if position == "leading") ~ (((s.value | round(decimal_places) ~ "00000")[0:decimal_places+(s.value|string).split(".")[0]|length +1]) |string).replace(".", decimal) ~ (currency if position == "trailing"),
                 "font": "ppb.ttf",
                 "x": 58,
                 "y":  7 + (25*ns.line), 
                 "size": 16,
                 "color": "red" if s.value in (state_attr(nordpool, day) | sort(reverse = true))[0:expensivest] else "black"} ] -%}
            
              {% set ns.line = ns.line + 1 %} 
            {% endif %}
          {%- endfor -%}
        {%- endfor -%}


        {{ ns.text_list }}
      enabled: true
mode: single

Is there any good monospaced fonts anyone has a link to?

2 Likes

Does anyone know if it would be OK to power the 2.9″ ST‐GR29000 from a 3.3V PSU? My application (medical information) updates every ten minutes and burns through batteries too fast.

This is a really interesting idea. For some of my use cases, I want to update the display every hour, but that drains the battery so fast. I just tried to play around by using 2 AA batteries and it seems to work just fine. (sorry for the horrible setup, but the original red wire from the battery holder got ripped out :slight_smile: )