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

Clock with weather and electricity price bar

On an AWTRIX display
Clock with weather and electricity price bar shown on an AWTRIX display
Clock with weather and electricity price bar · by TSA3000

On your display

Time, outdoor temperature and a weather icon, with the current electricity price as a coloured bar along the bottom row

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

Runs on

  • Runs on 32×8 (TC001 & DIY)
  • 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

Clock with weather and electricity price barAWTRIX 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

A clock app for AWTRIX NG written as a Berry script. The time comes from the clock's own NTP sync, so it keeps running if Home Assistant goes down. Outdoor temperature, weather and the electricity price arrive over MQTT.

Layout

  • Time on the left
  • Outdoor temperature, right aligned
  • 3 pixel wide weather icon on the right edge
  • Price bar on the bottom row

Price bar

One pixel for every started 25 öre/kWh, growing from the left.

  • Pixels 1-4 green, up to 100 öre
  • Pixels 5-8 orange, 100-200 öre
  • Pixels 9-32 red, over 200 öre

0 öre or less still lights one green pixel. 800 öre or more fills the whole row.

Night icons (new in v2.3)

There is now a partlycloudy-night icon, a moon behind the cloud. Home Assistant has no night variant of partlycloudy, and some weather providers (SMHI among them) never send clear-night at all, so the Home Assistant blueprint in the repo translates both when the sun is below the horizon. The icons flip at sunset and sunrise.

Setup

  1. In the AWTRIX web UI go to Scripts, create a script called ClockTemp and paste the code.
  2. Publish these MQTT topics with retain on:
  • awtrix/outdoor/temp temperature, e.g. 15
  • awtrix/outdoor/cond Home Assistant weather state, e.g. partlycloudy or partlycloudy-night
  • awtrix/elpris price in öre/kWh, e.g. 35.82
  1. Topic names and the clock, temperature and bar colours can be changed in the script settings.

Home Assistant blueprints, automations and a Node-RED flow for the MQTT feeds are in the repo: https://github.com/TSA3000/awtrix-ng-clock

No icons to install, the script draws everything itself.

At -10 degrees and colder the temperature touches the clock digits.

Tested on AWTRIX NG 1.1.0.

More scripts in Smarthome

Something wrong with this script? Report it.