Skip to content
AWTRIX Flows
Submit flow
Cryptocurrency Market shown on an AWTRIX display
Fig. 1 Cryptocurrency Market, as Avemer runs it.

Cryptocurrency Market

Displays real-time cryptocurrency prices directly on your device using the CoinGecko API.

Specifications
System AWTRIX NG Scripts
Firmware AWTRIX NG
Topic Miscellaneous
Built by Avemer
File bbq5QDWDHE8j.ax · 4.5 KB
Icons
Published 12 Aug 2026 · updated 12 Aug 2026
Downloads 1

In the 1.1 update, I will try to make the color of the numeric value of the cost appear depending on the values for the previous day.

Inspired by the work of RobG.

  • This script uses ideas and implementation approaches from RobG's original cryptocurrency price display, particularly the CoinGecko API integration, price fetching logic, and handling of cached/previous price data.
  • The current script was independently adapted and extended for this implementation, including its display logic, price comparison coloring, the ability to display the price in different currencies, user settings, and update behavior.

The script is designed to use the CoinGecko API to periodically request and real-time cryptocurrency prices directly on your device.

FEATURES

  • Supports cryptocurrencies available through the CoinGecko API. You can specify the CoinGecko Coin ID yourself.
  • Displays the cryptocurrency ticker together with its current price.
  • Supports multiple quote currencies such as USD, EUR, GBP, RUB and others.
  • Automatic green/red price coloring based on the latest received price.
  • Custom ticker and price colors.
  • Adjustable ticker length.
  • Adjustable price update interval.
  • Adjustable spacing between ticker and price.
  • Lightweight and designed for the limited resources of the ULANZI TC001.
  • Technically, you can have several such scripts that rotate each other on the clock display and show different cryptocurrencies.

!!! IMPORTANT NOTE - Data Source & Delay !!!

  • This script uses the free CoinGecko API to retrieve cryptocurrency prices directly on the watch.
  • The displayed value comes from the CoinGecko API and therefore depends on the API response time, network connection, device performance and API availability.
  • The script does not calculate or estimate the cryptocurrency price itself — it simply requests the latest value available from CoinGecko.
  • The actual time between a market price change and the value becoming available through the API can vary. Therefore, the displayed value should not be considered guaranteed real-time exchange data.
  • The script sends requests directly from the watch and does not require Home Assistant, a smart-home server, a PC or any additional setup.
  • No API token is required for the configuration shown in this script.
  • The free API is subject to CoinGecko's usage limits and availability. If requests are made too frequently, requests may fail or be temporarily limited.
  • In other words, this script prioritizes simplicity and standalone operation over guaranteed real-time market data.

SETTINGS
In the code look for the section:
====== START OF USER SETTINGS ======
!!! IMPORTANT NOTE - Settings !!!
COIN_ID must be a valid CoinGecko Coin ID. The ticker symbol itself is not used to identify the cryptocurrency.
TICKER_LETTERS must not exceed the actual length of TICKER.
For example, if TICKER = "BTC", use values from 0 to 3. Values above 3 can cause the script to fail.

1. Coin ID
self.COIN_ID = "bitcoin"
Enter the CoinGecko Coin ID.
Examples:
bitcoin
ethereum
solana
dogecoin
The Coin ID is not necessarily the same as the ticker.
For example:
Coin ID: bitcoin
Ticker: BTC

2. Ticker
self.TICKER = "BTC"
Enter the ticker displayed on the watch.
Examples:
BTC
ETH
SOL
DOGE
The ticker is only used for display; the API request uses COIN_ID.

3. Currency
self.CURRENCY = "usd"
Select the currency in which the cryptocurrency price is displayed.
Examples:
usd
eur
gbp
rub
For example:
BTC 64123
with CURRENCY = "usd" displays the Bitcoin price in USD.

4. Adjust Ticker Length
self.TICKER_LETTERS = 3
Controls how many characters of the ticker are displayed:
self.TICKER_LETTERS = 0 — hide ticker
self.TICKER_LETTERS = 1 — B
self.TICKER_LETTERS = 2 — BT
self.TICKER_LETTERS = 3 — BTC
self.TICKER_LETTERS = 4 — BTC + requires a 4-character ticker
self.TICKER_LETTERS = 5+ — full ticker
For example:
BTC + 1 → B 64123
BTC + 3 → BTC 64123

5. Ticker Color
self.TICKER_COLOR = 0xFFFFFF
Sets the ticker color using 0xRRGGBB format.
Examples:
0xFFFFFF — White
0xFF0000 — Red
0x00FF00 — Green
0x0000FF — Blue
0xFFFF00 — Yellow
0x00FFFF — Cyan
0xFF00FF — Magenta

6. Price Color Mode
self.PRICE_COLOR_MODE = 2
Controls the price color:
self.PRICE_COLOR_MODE = 0 — always white
self.PRICE_COLOR_MODE = 1 — use custom PRICE_COLOR
self.PRICE_COLOR_MODE = 2 — automatically use green/red
In automatic mode:
Green — current price is higher than the previous received price.
Red — current price is lower than the previous received price.
White — price has not changed.
The comparison is made against the previous price successfully received by the script, not against the previous day's closing price.

7. Custom Price Color
self.PRICE_COLOR = 0xFFFFFF
Used when:
PRICE_COLOR_MODE = 1
Uses the same 0xRRGGBB color format as the ticker.

8. Price Update Interval
self.UPDATE_TICKS = 30
Controls how frequently the script requests a new price.
loop() runs approximately once per second.
Examples:
self.UPDATE_TICKS = 10 — approximately every 10 seconds
self.UPDATE_TICKS = 30 — approximately every 30 seconds (recommended)

The script starts the first request immediately when possible and starts the update interval after a successful response.
Lower values mean more frequent requests but also increase network, CPU and memory usage and may increase the chance of API request errors.

9. Text Gap
self.GAP = 2
Controls the distance in pixels between the ticker and the price.
For example:
BTC 64123
The value determines the space between BTC and 114250.

TROUBLESHOOTING
If the script does not work, displays ..., fails to load values, or shows request errors:

  1. Make sure COIN_ID is a valid CoinGecko Coin ID and save the changes (Ctrl+S) (see settings 1).
  2. Make sure TICKER contains the correct number of characters for the selected TICKER_LETTERS (Ctrl+S) (see settings 2).
  3. Make sure CURRENCY is supported by the CoinGecko endpoint.
  4. Check the watch's internet connection.
  5. If requests frequently fail, increase UPDATE_TICKS to 30 or higher.
  6. Keep in mind that API response time depends on the network, CoinGecko availability and the watch itself.
  7. If many scripts are running simultaneously, the ULANZI TC001 may run low on available resources. Reducing the request frequency can help.
    8. Always consider rebooting the watch. Open the watch's web interface by entering its IP address in your browser, go to System → Maintenance → Reboot, and then press Sure?. A reboot can resolve temporary glitches, memory-related issues and other unexpected script behavior.

Vibecoded with ChatGPT, polished by Avemer. Inspired by the work of RobG.

P.S. I wrote this script for myself, and I bought the Ulanzi TC001 watch for this idea. Therefore, I tried to optimize the code as much as possible. I didn't test it much though. I hope that it will work well, but if I find errors, I will try to fix them and update this flow, create similar scripts with different functionality. The code contains explanations, that take some memory to store, if you run into troubles with that, you can always delete them and you can use it as a base for your development. If mistakes occur, do not judge strictly. And I'm a newbie. I hope this script will be useful to someone.

More flows for AWTRIX NG Scripts or Miscellaneous

Something wrong with this flow? Report it.