# 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
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
``````

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

Any help is much appreciated.

Why are you asking me here if you do not use my component and blueprint.