Skip to content

New Share your ideas with the AWTRIX community. Keep your creations together in your account.

Sign in

Which AWTRIX do you have? Choose it once and the Hub shows what runs on it.

ScriptAWTRIX NG

Solar Clock

On an AWTRIX display
Solar Clock shown on an AWTRIX display
Solar Clock · by martinh87

On your display

Dynamic 52×16 solar clock featuring an astronomical day/night horizon, real-time sun tracking, and adaptive ambient sky lighting.

Which AWTRIX do you have? See below where it runs, or choose your device.
Topic
Miscellaneous
Includes
Script

Runs on

  • Does not run on 32×8 (TC001 & DIY) Made for 52×16 (TC002).
  • Runs on 52×16 (TC002)
  • Does not run on 32×8 with AWTRIX 3 (TC001 & DIY) Made for AWTRIX NG.

Choose your display in the next step.

Send to AWTRIX

Choose your AWTRIX

Solar ClockAWTRIX NG script

Install this script on your AWTRIX NG. Its icons and sounds are installed with it.

Your AWTRIX’s local address, for example 192.168.178.39 or awtrix.local.

The name shown in your AWTRIX script list. Use letters, digits, hyphens or underscores.

Connection & device login

Connect your phone or computer to the same network as your AWTRIX. Allow local network access if your browser asks.

Use the device’s IP address, without a page path such as /#/apps.

If your AWTRIX requires a login, the username and password fields will appear when you connect.

Sign in to the Hub to install scripts. Attached files are installed separately.

Script description

SolarClock

A clock for 52×16 panels that shows the whole day as a sky. The time is drawn with custom-built digits. Behind it, a soft sky gradient and a 3-pixel horizon bar show how the sky changes from night to dawn, day, dusk and back to night. A small pulsing sun marks the current time.

Everything is calculated on the clock from your coordinates and the clock's time. There is no internet access, no Home Assistant and no MQTT involved.

Features

  • Custom digits: 8×11 pixel digits with rounded corners, drawn by the script itself
  • 24 h sky horizon: the 52 columns are the 24 hours of your local day, from midnight on the left to midnight on the right. Each column shows the sky colour at that time of day
  • Ambient sky background: a vertical gradient above the horizon in the same colours (can be switched off)
  • Sun marker: a small plus-shaped sun on the horizon bar shows "now" and pulses gently
  • Digit colour follows the sun: cool blue at night, soft peach around sunrise and sunset, warm yellow during the day
  • Pulsing colon: breathes with a 2 s cycle (or steady, or off)
  • 12 h / 24 h with an AM/PM indicator, optional leading zero

Requirements

  • AWTRIX NG on a 52×16 panel, for example the Ulanzi TC002. The layout is built for exactly 52×16 pixels, so it does not fit a 32×8 clock such as the TC001.
  • The clock needs a valid time (NTP). Until then the display stays empty.

Setup

  1. Open the web UI of your clock and go to the Scripts tab.
  2. Create a new script named SolarClock and paste the code (or install it from the Hub).
  3. Save. The script appears in the app rotation.
  4. Go to the Apps tab, click the ⚙ button next to SolarClock and enter your latitude and longitude. The defaults are for Vienna and will be wrong for most places.
  5. The time zone comes from your clock's system settings.

Settings

Setting Default Description
Time format 24 24 or 12 (12 h mode shows AM/PM)
Leading zero 1 1 shows a leading zero (07:05), 0 hides it
Colon 1 0 off, 1 pulse, 2 solid
Ambient sky 1 1 shows the sky background, 0 black background
Latitude 48.2082 Your latitude in decimal degrees
Longitude 16.3738 Your longitude in decimal degrees (east is positive)

How the sky is coloured

The sun's elevation above the horizon decides the colour:

Sun elevation Sky
below -18° night
-18° to -6° deep blue (astronomical and nautical twilight)
-6° to -2° blue to violet
-2° to 2° violet to peach (sunrise / sunset)
2° to 8° peach to gold
8° to 20° gold to bright day yellow
above 20° day

Because the bar covers a whole day, you also see how long the days are right now. In summer the bright part is wide, in winter it is narrow.

More scripts in Miscellaneous

Something wrong with this script? Report it.