AWTRIX 3 - Blueprint for creating simple apps for dummies

can you read RTFM instead of asking me.

thank you!

1 Like

Hi Oleg, awesome work! Is there by any chance an option to use toggle helpers to enable / disable the apps?

1 Like

HI,

I started playing but I see an error that I cannot identify.

Below my automation config:

alias: Awtrix Previsioni
description: ''
use_blueprint:
  path: 10der/awtrix-simple.yaml
  input:
    awtrix_device:
      - 3b368916b6bc5254d0cc97e577806f44
    app_name: awtrix_app_forecast
    app_icon: a2282
    entity: weather.pirateweather
    pre_actions:
      - target:
          entity_id:
            - weather.pirateweather
        data:
          type: hourly
        response_variable: forecast
        action: weather.get_forecasts
    value_template:
      text: >-
        {{forecast['weather.pirateweather'].forecast |  selectattr('datetime',
        'gt', now().timestamp() | timestamp_custom('%Y-%m-%dT%H:00:00+00:00',
        false)) |  map(attribute='temperature') |  first | round}}
      icon: >-
        {{user_data.icons[forecast['weather.pirateweather'].forecast | 
        selectattr('datetime', 'gt', now().timestamp() |
        timestamp_custom('%Y-%m-%dT%H:00:00+00:00', false)) | 
        map(attribute='condition') |  first]}}
    additional_options:
      icons:
        clear-night: a12181
        cloudy: a2283
        exceptional: a2364
        fog: '17056'
        hail: a2441
        lightning: a630
        lightning-rainy: a49299
        partlycloudy: a2286
        pouring: a49300
        rainy: a2284
        snowy: a2289
        snowy-rainy: a49301
        sunny: a2282
        windy: a15618
        windy-variant: a15618
        full_moon: '2314'
        waning_gibbous: '2315'
        last_quarter: '2316'
        waning_crescent: '2317'
        new_moon: '2318'
        waxing_crescent: '2320'
        first_quarter: '2320'
        waxing_gibbous: '36234'
        home: '96'
        sunrise: '485'
        sunset: '486'
        unavailable: '52176'
      colors:
        '0': '#00ff7f'
        '5': '#00ff2a'
        '10': '#2aff00'
        '15': '#7fff00'
        '20': '#d4ff00'
        '25': '#ffd400'
        '30': '#ff7f00'
        '-15': '#007fff'
        '-10': '#00d4ff'
        '-5': '#00ffd4'
    suffix_text: °C
    user_options:
      duration: 5
      color: |-
        {{user_data.colors[(user_data.colors.items() | 
            map(attribute='0') |  
            map('int') |  
            sort | select('>=', value_template.text) | 
            first) | string]}}

error is

Errore: UndefinedError: 'str object' has no attribute 'text'

use case please…

btw:

if you toggle helper with name “test” your app will disappear

yes. no text. probably old example.

here is the last one

alias: AWTRIX - OUTDOORS TEMPERATURE (EXT)
description: ""
use_blueprint:
  path: 10der/awtrix-simple.yaml
  input:
    entity: sensor.easyweatherv1_6_4_outdoor_temperature
    awtrix_device:
      - 3135904cc76cc8342758e395c7c19c10
      - cba036557ec6a93c46e1772448fac471
    app_icon: "2355"
    additional_action:
      - variables:
          icons:
            clear-night: a12181
            cloudy: a2283
            exceptional: a2364
            fog: "17056"
            hail: a2441
            lightning: a630
            lightning-rainy: a49299
            partlycloudy: a2286
            pouring: a49300
            rainy: a2284
            snowy: a2289
            snowy-rainy: a49301
            sunny: a2282
            windy: a15618
            windy-variant: a15618
            unavailable: "52176"
    user_options:
      duration: 5
      pos: 0
      text: ""
      icon: "{{icons[states('weather.forecast_home')]}}"
      draw: |
        {%- macro draw_forecast_lines() %}
          {%- set hours = 24 %}
          {%- for hour in range(hours) %}
            {"dp": [{{8 + hour}}, 7, "{{colors[(colors.items() | map(attribute='0') |
         map('int') | sort | select('>=', forcast_temp[hour]) | first) | string]}}"]}
            {%- if hour+1 != hours %},{%endif%}
          {%- endfor %}
        {%- endmacro %} [
          {{draw_forecast_lines()}},
          {"dt": ["{{13 if value_template > 9 else 15}}", 1, "{{'+' if value_template > 0}}{{value_template}}°", "{{color}}"]}
        ]
    additional_options:
      icons:
        clear-night: a12181
        cloudy: a2283
        exceptional: a2364
        fog: "17056"
        hail: a2441
        lightning: a630
        lightning-rainy: a49299
        partlycloudy: a2286
        pouring: a49300
        rainy: a2284
        snowy: a2289
        snowy-rainy: a49301
        sunny: a2282
        windy: a15618
        windy-variant: a15618
        full_moon: "2314"
        waning_gibbous: "2315"
        last_quarter: "2316"
        waning_crescent: "2317"
        new_moon: "2318"
        waxing_crescent: "2320"
        first_quarter: "2320"
        waxing_gibbous: "36234"
        home: "96"
        sunrise: "485"
        sunset: "486"
        unavailable: "52176"
      colors:
        "0": "#00ff7f"
        "5": "#00ff2a"
        "10": "#2aff00"
        "15": "#7fff00"
        "20": "#d4ff00"
        "25": "#ffd400"
        "30": "#ff7f00"
        "35": "#ff5000"
        "40": "#ff2000"
        "-15": "#007fff"
        "-10": "#00d4ff"
        "-5": "#00ffd4"
      value_template: "{{states(entity_id) | round}}"
      color: |-
        {{colors[(colors.items() | map(attribute='0') |
         map('int') | sort | select('>=', value_template) | first) | string]}}
      forcast_temp: |-
        {{(forecast[forecast.keys() | first]).forecast | 
          map(attribute="temperature") | 
          map('round') |
          list}}
    pre_actions:
      - target:
          entity_id:
            - weather.forecast_home
        data:
          type: hourly
        response_variable: forecast
        action: weather.get_forecasts
    prefix_text: "{{ '+' if value_template > 0 }}"
    suffix_text: °
1 Like

Thank you, works like a charm. May I ask if you could also share the other weather blueprints from the beginning of the thread? I can’t get it to work properly e.g. with night temperature and moon status. Seems I am too stupid to adapt all the changes & when playing around one little mistake and all the code is gone :disappointed: would be much appreciated. (I used to use the old weather component from you for simple reasons, but stopped working a time ago)

1 Like
alias: AWTRIX - NIGHT_TEMERATURE
description: ""
use_blueprint:
  path: 10der/awtrix-simple.yaml
  input:
    awtrix_device:
      - 3135904cc76cc8342758e395c7c19c10
      - cba036557ec6a93c46e1772448fac471
    app_name: awtrix_app_night
    entity: weather.forecast_home
    pre_actions:
      - target:
          entity_id:
            - weather.forecast_home
        data:
          type: daily
        response_variable: forecast
        action: weather.get_forecasts
    user_options:
      duration: 5
      icon: "{{user_data.icons[states('sensor.moon_phase')]}}"
      text: "{{ '+' if value > 0 }}{{value}}°"
      pos: 1
      color: |-
        {{user_data.colors[(user_data.colors.items() | 
            map(attribute='0') |  
            map('int') |  
            sort | select('>=', value) | 
            first) | string]}}
    additional_options:
      icons:
        clear-night: a12181
        cloudy: a2283
        exceptional: a2364
        fog: "17056"
        hail: a2441
        lightning: a630
        lightning-rainy: a49299
        partlycloudy: a2286
        pouring: a49300
        rainy: a2284
        snowy: a2289
        snowy-rainy: a49301
        sunny: a2282
        windy: a15618
        windy-variant: a15618
        full_moon: "2314"
        waning_gibbous: "2315"
        last_quarter: "2316"
        waning_crescent: "2317"
        new_moon: "2318"
        waxing_crescent: "2320"
        first_quarter: "2320"
        waxing_gibbous: "36234"
        home: "96"
        sunrise: "485"
        sunset: "486"
        unavailable: "52176"
      colors:
        "0": "#00ff7f"
        "5": "#00ff2a"
        "10": "#2aff00"
        "15": "#7fff00"
        "20": "#d4ff00"
        "25": "#ffd400"
        "30": "#ff7f00"
        "-15": "#007fff"
        "-10": "#00d4ff"
        "-5": "#00ffd4"
      value: >-
        {{forecast['weather.forecast_home'].forecast |  map(attribute='templow')
        |  first | round}}
    prefix_text: {}
1 Like

I’ve installed the HACS component from GitHub, I’ve added awtrix: to my configuration.yml, and I’ve imported the blueprint - but it can’t find any device

I added it through the devices menu but nothing is available:

Did I miss a step?

the same here!

hey! @10der what the heck?
:))))

that’s OK cuz now this version of custom_components based on exists (sic!) MQTT devices.

so, feel free to check here:
developer-tools/action

NB to ALL. About plans.
the next version of custom_components will:

3 Likes

Ah! Didn’t realize you had to setup MQTT, thanks! working now :slight_smile:

1 Like

Hello, please help. I use the standard weather supplier, before everything worked for me, but after the updates it broke.
This is my old config:

alias: Weather
description: ""
use_blueprint:
  path: 10der/awtrix-simple.yaml
  input:
    awtrix_device:
      - 67e1441ba82d754a19ee1855ec04c124
      - b9d47ac236b6ca5ba2f85536e42ec71d
    app_name: awtrix_app_forecast
    app_icon: a2282
    entity: weather.forecast_home_assistant
    pre_actions:
      - data:
          type: hourly
        response_variable: forecast
        target:
          entity_id: weather.forecast_home_assistant
        action: weather.get_forecasts
    value_template:
      text: >-
        {{forecast['weather.forecast_home_assistant'].forecast | 
        selectattr('datetime', 'gt', now().timestamp() |
        timestamp_custom('%Y-%m-%dT%H:00:00+00:00', false)) | 
        map(attribute='temperature') |  first | round}}
      icon: >-
        {{user_data.icons[forecast['weather.forecast_home_assistant'].forecast
        |  selectattr('datetime', 'gt', now().timestamp() |
        timestamp_custom('%Y-%m-%dT%H:00:00+00:00', false)) | 
        map(attribute='condition') |  first]}}
    additional_options:
      icons:
        clear-night: a12181
        cloudy: a2283
        exceptional: a2364
        fog: "17056"
        hail: a2441
        lightning: a630
        lightning-rainy: a49299
        partlycloudy: a2286
        pouring: a49300
        rainy: a2284
        snowy: a2289
        snowy-rainy: a49301
        sunny: a2282
        windy: a15618
        windy-variant: a15618
        full_moon: "2314"
        waning_gibbous: "2315"
        last_quarter: "2316"
        waning_crescent: "2317"
        new_moon: "2318"
        waxing_crescent: "2320"
        first_quarter: "2320"
        waxing_gibbous: "36234"
        home: "96"
        sunrise: "485"
        sunset: "486"
        unavailable: "52176"
      colors:
        "0": "#00ff7f"
        "5": "#00ff2a"
        "10": "#2aff00"
        "15": "#7fff00"
        "20": "#d4ff00"
        "25": "#ffd400"
        "30": "#ff7f00"
        "-15": "#007fff"
        "-10": "#00d4ff"
        "-5": "#00ffd4"
    suffix_text: °C
    user_options:
      duration: 5
      color: |-
        {{user_data.colors[(user_data.colors.items() | 
            map(attribute='0') |  
            map('int') |  
            sort | select('>=', value_template.text) | 
            first) | string]}}

Tell me how to fix it. The error is also as a pair of posts higher: “Errore: undefinederror: ‘Str Object’ Has No Attribute ‘Text’”.
I do not want to remain in debt if there is where to transfer funds, I will do it.

value_template: "{{ state_attr('weather.forecast_home_assistant', 'temperature') | round }}"

Weather forecast WITHOUT external temperature sensor
as main entity, please use Home Assistant weather entity!

alias: AWTRIX - OUTDOORS TEMPERATURE (DEL ME)
description: ""
use_blueprint:
  path: 10der/awtrix-simple.yaml
  input:
    entity: weather.forecast_home
    awtrix_device: []
    app_icon: "2355"
    additional_action:
      - variables:
          icons:
            clear-night: a12181
            cloudy: a2283
            exceptional: a2364
            fog: "17056"
            hail: a2441
            lightning: a630
            lightning-rainy: a49299
            partlycloudy: a2286
            pouring: a49300
            rainy: a2284
            snowy: a2289
            snowy-rainy: a49301
            sunny: a2282
            windy: a15618
            windy-variant: a15618
            unavailable: "52176"
    user_options:
      duration: 5
      pos: 0
      text: ""
      icon: "{{icons[states(entity_id)]}}"
      draw: |
        {%- macro draw_forecast_lines() %}
          {%- set hours = 24 %}
          {%- for hour in range(hours) %}
            {"dp": [{{8 + hour}}, 7, "{{colors[(colors.items() | map(attribute='0') |
         map('int') | sort | select('>=', forcast_temp[hour]) | first) | string]}}"]}
            {%- if hour+1 != hours %},{%endif%}
          {%- endfor %}
        {%- endmacro %} [
          {{draw_forecast_lines()}},
          {"dt": ["{{13 if value_template > 9 else 15}}", 1, "{{'+' if value_template > 0}}{{value_template}}°", "{{color}}"]}
        ]
    additional_options:
      icons:
        clear-night: a12181
        cloudy: a2283
        exceptional: a2364
        fog: "17056"
        hail: a2441
        lightning: a630
        lightning-rainy: a49299
        partlycloudy: a2286
        pouring: a49300
        rainy: a2284
        snowy: a2289
        snowy-rainy: a49301
        sunny: a2282
        windy: a15618
        windy-variant: a15618
        full_moon: "2314"
        waning_gibbous: "2315"
        last_quarter: "2316"
        waning_crescent: "2317"
        new_moon: "2318"
        waxing_crescent: "2320"
        first_quarter: "2320"
        waxing_gibbous: "36234"
        home: "96"
        sunrise: "485"
        sunset: "486"
        unavailable: "52176"
      colors:
        "0": "#00ff7f"
        "5": "#00ff2a"
        "10": "#2aff00"
        "15": "#7fff00"
        "20": "#d4ff00"
        "25": "#ffd400"
        "30": "#ff7f00"
        "35": "#ff5000"
        "40": "#ff2000"
        "-15": "#007fff"
        "-10": "#00d4ff"
        "-5": "#00ffd4"
      value_template: "{{ state_attr(entity_id, 'temperature') | round }}"
      color: |-
        {{colors[(colors.items() | map(attribute='0') |
         map('int') | sort | select('>=', value_template) | first) | string]}}
      forcast_temp: |-
        {{(forecast[forecast.keys() | first]).forecast | 
          map(attribute="temperature") | 
          map('round') |
          list}}
    pre_actions:
      - target:
          entity_id: "{{entity_id}}"
        data:
          type: hourly
        response_variable: forecast
        action: weather.get_forecasts
    prefix_text: "{{ '+' if value_template > 0 }}"
    suffix_text: °
1 Like

Thanks, with this config it works with the built-in weather provider:

alias: AWTRIX - OUTDOORS TEMPERATURE
description: ""
use_blueprint:
  path: 10der/awtrix-simple.yaml
  input:
    entity: weather.forecast_home_assistant
    awtrix_device:
      - 67e1441ba82d754a19ee1855ec04c124
      - b9d47ac236b6ca5ba2f85536e42ec71d
    app_icon: "2355"
    additional_action:
      - variables:
          icons:
            clear-night: a12181
            cloudy: a2283
            exceptional: a2364
            fog: "17056"
            hail: a2441
            lightning: a630
            lightning-rainy: a49299
            partlycloudy: a2286
            pouring: a49300
            rainy: a2284
            snowy: a2289
            snowy-rainy: a49301
            sunny: a2282
            windy: a15618
            windy-variant: a15618
            unavailable: "52176"
    user_options:
      duration: 5
      pos: 0
      text: ""
      icon: "{{icons[states(entity_id)]}}"
      draw: |
        {%- macro draw_forecast_lines() %}
          {%- set hours = 24 %}
          {%- for hour in range(hours) %}
            {"dp": [{{8 + hour}}, 7, "{{colors[(colors.items() | map(attribute='0') |
         map('int') | sort | select('>=', forcast_temp[hour]) | first) | string]}}"]}
            {%- if hour+1 != hours %},{%endif%}
          {%- endfor %}
        {%- endmacro %} [
          {{draw_forecast_lines()}},
          {"dt": ["{{13 if value_template > 9 else 15}}", 1, "{{'+' if value_template > 0}}{{value_template}}°", "{{color}}"]}
        ]
    additional_options:
      icons:
        clear-night: a12181
        cloudy: a2283
        exceptional: a2364
        fog: "17056"
        hail: a2441
        lightning: a630
        lightning-rainy: a49299
        partlycloudy: a2286
        pouring: a49300
        rainy: a2284
        snowy: a2289
        snowy-rainy: a49301
        sunny: a2282
        windy: a15618
        windy-variant: a15618
        full_moon: "2314"
        waning_gibbous: "2315"
        last_quarter: "2316"
        waning_crescent: "2317"
        new_moon: "2318"
        waxing_crescent: "2320"
        first_quarter: "2320"
        waxing_gibbous: "36234"
        home: "96"
        sunrise: "485"
        sunset: "486"
        unavailable: "52176"
      colors:
        "0": "#00ff7f"
        "5": "#00ff2a"
        "10": "#2aff00"
        "15": "#7fff00"
        "20": "#d4ff00"
        "25": "#ffd400"
        "30": "#ff7f00"
        "35": "#ff5000"
        "40": "#ff2000"
        "-15": "#007fff"
        "-10": "#00d4ff"
        "-5": "#00ffd4"
      value_template: "{{ state_attr(entity_id, 'temperature') | round }}"
      color: |-
        {{colors[(colors.items() | map(attribute='0') |
         map('int') | sort | select('>=', value_template) | first) | string]}}
      forcast_temp: |-
        {{(forecast[forecast.keys() | first]).forecast | 
          map(attribute="temperature") | 
          map('round') |
          list}}
    pre_actions:
      - target:
          entity_id: "{{entity_id}}"
        data:
          type: hourly
        response_variable: forecast
        action: weather.get_forecasts
    prefix_text: "{{ '+' if value_template > 0 }}"
    suffix_text: °C
    app_name: awtrix_app_temperature
1 Like

First off, amazing work with your integration and blueprint! Got a block yesterday for christmas and i’m loving using it!

Has anyone used an entity’s attribute for a message? I had a quick look at the base yaml template and it’s directly pulling the state for an entity.

I want to pull the message attribute from my calendar entity to tell me if it’s Bin or Recycling day

Thanks for the prompt reply Oleg! What I’m after is to have the attribute displayed on the clock itself.

calendar.calendar has the attribute message which is currently “bin day”. I want to display “bin day” on the awtrix to remind myself.