Skip to content

Weather

Francesco Andreuzzi edited this page Feb 3, 2019 · 14 revisions

t-ui 6.7 introduced the new weather feature.

######## Actually this is in BETA ########

Enable

$ tuiweather -enable

Disable

$ tuiweather -disable

Troubleshooting

The weather API is busy. Trying again at...

This happens because t-ui uses a free API to gather info about the weather in your area (I can't afford a paid service). But there's a limit, 60 requests per minute. So, if the maximum amount of requests have already been reached, you'll have to wait a minute, and so on, until you find a free slot.

How can I avoid this?

  1. Open this link
  2. Sign up. You can use any email, any password, any username, you won't need them anymore
  3. Open the page "API keys" (or click on this link)
  4. Copy the first key, the alphanumeric sequence below the Key header
  5. Open t-ui, type $ tuiweather -set_key and paste your key
  6. Restart t-ui

Couldn't get your location

This happens because t-ui wasn't able to get your coords (your GPS sensor may be off or unavailable).

Fix

config -set weather_location [cityID OR coords]

  • [coords] -> latitude and longitude with a comma between (45.6,13.7)
  • [cityID] -> your city ID, which you can find here

Format

The current weather is stored with JSON. You can see an example here.

You can gather the information that you want inside t-ui with this format:
%[name]

For instance, if you want to know only the humidity level, you will change your format to:
%humidity or better Humidity: %humidity%

The second example will appear like this:
Humidity: 56%

Repeated values

Since some %name (like main) appear multiple times inside the JSON file, you can select the one you want with this format:
%[name][n]

For instance, this format selects the third main inside the file:
%main3

Replace/Color

You can replace some portions of your weather to customize them.
For instance, let's say you want to change the weather label "Rain" to "Tears from the sky". This is how you would do it:
#[Rain/Tears from the sky]%description

You can color a piece of text with this format:
Weather: %main, Temperature: #991100[%temp]

More info here.

Conversion

You can switch between Celsius and Fahrenheit using this special sequence:
Temp: %temp$(*1.8+32)