Awtrix (clock) notification [Custom Component]

Hi @10der , I wonder if you could help me to understand how calculations are made ?

I’m fetching the Internet Speed of my router and showing it every X minutes on the clock. This works fine. I want to use the progress bar to show the % of max speed to this.

The math should be “current speed” / “max speed” * “100”.

Can you explain how to do this in very basic steps ? Thanks

u can’t bro. =)
Move your calculation to sensor, for example.
You can show only ready to use values, you can’t do a some calculation here.
Sorry.

From another hand, if you _already_have a value… for example you have two sensors:
1st sensor current speed
2nd sensor max speed

so. let’s play

  1. create action for current speed
  2. just choose as entity “current speed”
  3. in Additional options define value
speed_percent:
 {{ states (entity_id) / states('sensor.max_speed') * 100 }}

than

AWTRIX application options

progress: "{{speed_percent}}"
progressC: 18B04C
progressBC: "#333333"

1 Like

Thanks for the great service/blueprint!

One question: Is there an option to change the color coding of the forecast line at the bottom of the weather app? It seems the range 15° to 25° is yellow, so my bar is mostly yellow only.

I am using the weather app via the blueprint as follows:

service: awtrix.awtrix_3da3c4_weather_app
data:
weather: weather.forecast_home

weather is not supported. Weather now via blueprint

Just to follow on my attempt to improve the readibility of the weather forecast bar: I updated the following line in awtrix.py to “compress” the color scale for locations with smaller temperature ranges:

#current code:
#hue = 30 + 240 * (30 - temperature) / 60

#updated code:
#hue = 11 * (26 - temperature)

Example hue value for current / updated code:
-5°C: 170° / 341°
10°C: 110° / 176°
25°C: 50° / 11°

However, this only slightly improves the situation. When checking the live view of the clock via the awtrix webinterface I realized that the actual issue is a hardware limitation of the clock in terms of color resolution. In the live view a variety of colors between light green, yellow and light orange are shown, while on the real clock all forecast pixels are shown in the same yellow color.

1 Like

Thank you.
Right now this code is removed from component in favor AWTRIX 3 - Blueprint for creating simple apps for dummies - #24 by 10der

Thanks so far, I’m a noob, so could you explain what kind of Action I should create to do the math ?
I got 2 Sensors with the values, so this should be possible

alias: New automation_temp
description: ""
use_blueprint:
  path: 10der/awtrix-simple.yaml
  input:
    app_name: awtrix_app_temp
    entity: sensor.mikrotik_router_kib_s_received_2
    additional_options:
      speed_percent: "{{ states (entity_id) | int / states('sensor.max_speed') | int * 100 }}"
      value_template: "{{(states(entity_id) | round) ~ ' KiB/s'}}"
    user_options:
      progress: "{{speed_percent}}"
      progressC: 18B04C
      progressBC: "#333333"
      duration: 5
    awtrix_device:
      - 3135904cc76cc8342758e395c7c19c10

awtrix (22)

1 Like

Thanks for taking the time to help me here. I still can’t get my head around this.

I installed your blueprints and everything.

I’m using notify, as I would rather not push the app each time the speed changes, so I run this every 2 Minutes, which is good enough for me. (trigger in the example below is empty)

description: ""
snipp
mode: single

So the progress bar is always showing 100%. So I do not understand how to do this properly. It’s rather confusing how HA works here :frowning:

Any help is much appreciated.

Why are you asking me here if you do not use my component and blueprint.
ask about your script in other place in this case.
Sorry.

Above working example what you wish via blueprint.

Sorry, I thought it’s a quick reply. I did not expect such a long chain. I greatly appreciate your help so far.

Hey Oleg, I just discovered (and installed) your nice custom component (from a video by YouTuber BeardedTinker), and it’s really really useful with Home Assistant and my Awtrix (Ulanzi TC001)—many thanks!

Didn’t really know where to post it, but I added some mor “apps” (frames, in your terminology) to your weather app. Screenshots and code over in your GitHub issues, if anyone is interested.

I take existing data from HA’s Weather integration, notably Humidity, Wind Speed and UV Index, which will be shown own the Awtrix.

While playing around with your component, I found some minor things which you might look into if you wish:

  • In HA, the “Awtrix tools and notifiction” integration shows no icon.
  • When opening it, it gives me “no devices or entities”, but the automations are usable if one knows the name. I named my device “awtrix1” (HA still shows the sensors as “awtrix_xxxxxx…”), so maybe the lookup code should be improved. I use Awtrix 3, v0.96, and HA Core 2024.10.3.
  • Your Blueprints don’t work for the same reason—no device found.
  • I couldn’t find out how to add my own “effects” (actually just 32x8 GIFs playing for a certain duration). Are these effects or icons? And can I use the device as storage (tried ICONS folder, but only managed to crash Awtrix), or how does this work? Could you put an example on your GitHub maybe?

Otherwise, thanks again—this is sadly rather unknown, but a real good addition if one uses Awtrix devices!

1 Like

Weather command is not supported right now :frowning:
You can use blueprint
Sorry

Update blueprint.

here is the last CLICK

1 Like

Can you explain? I know it’s experimental, but it works nicely.

yes. do not update custom_components - feature was removed

Thanks! Can confirm this detects & shows my awtrix device correctly.

Oops! Why? It was (for me) the most useful feature for my Awtrix yet (and the reason why I installed your component, and added to it). I actually called up some friends, and all were delighted, and even bought new Ulanzi clocks just for this feature. Yeah, experimental, I know… still would love if it stayed, or came back.

Will it come back? (Please…)

I am preparing source code to integrate to HASS instead of custom_components.
Please use blueprint it’s very useful and easy to customize.
I wouldn’t to add specific code to component, please understand me right. All what doing right now weather command (more than!) covered by awtrix-simple.yaml

Thanks for your reply, and letting us know what is coming! Much appreciated! And a HASS integration would be just awesome.

Just wanted to let you know that your component gets appreciation, and is so nice to check for outdoor activities, gardening, knowing the roads might be icy at night, etc.

So I will play with the blueprint for the time being, and let my friends have copies of how I did it. And of course let them know that there is more and better things to come. :slight_smile:

Btw, liked how you integrated the icons, so “normal users” wouldn’t have to fiddle with uploading them, but still have the option.

1 Like