Facade
A dual world time zone analog watch face for most Garmin watches.
Analog watch face with support for dual world wide time zones,
features include:
- Analog face with second hand
- Second timezone selectable from 327 countries/cities
- Day of week and day month
- Metrics can be shown in each of the 4 corners (ignoring the fact that this is a round watch face with no corners)
- Battery charge indication
- Heart rate
- Total daily step count
- Phase of the moon
- Calories expended
- Distance traveled
- Meters ascended
- Active minutes
- Rrespiration rate
- Current temperature
Note the red or green triangle on the
outer edge of the dial.
This triangle marks the hour hand position
for the second time zone (or the
first time zone if there is no
second timezone selected).
This triangle will be red to indicate
AM and green to indicate PM.
For example,
the clock face on the left shows the
local time of 10:10AM,
the clock face in the middle shows the
local time of 10:10PM,
and the clock face on the right shows the
local time of 11:33AM when it's 5:33PM
in Central European Time.
The main timzone is always
the analog clock in the center of the display
with hour, minute, and second hands. If a second
timezone is selected then the hour of that timezone is shown by
the triangle on the edge of the face.
If the second timezone is not Local then the 3-5 letter
abbreviation for that timezone is shown at the bottom
of the watch face.
Note how the triangle on the outer edge tracks the minutes
that have elapsed between the two hour markers.
This is important for timezones that don't have a
0 minute offset as you can read the time in the second
timezone just from the triangle marker
(if the second timezone has a 0 minute offset the the
analog minute hand is correct for that timezone).
Daylight Savings Time (DST) is automatically
detected for USA/CANADA/EU.
The indicated time will be moved forward
during DST and the timezone abbreviation
displayed with be the one for DST.
For other timezones there is a setting
that can be set
(using Connect IQ or Garmin Express,
this is no available on the watch itself
as it would make the watch settings too
The Main DST and Second DST
settings can be set to one of 3 different values:
- Auto - Automatic detection. Works for USA/CANADA/EU,
all others will always display standard time.
- Off - This timezone will only display standard time.
- On - This timezone will only display DST time.
Timezones
can be selected from one of 327 countries.
The user can select which metric to display
in the 4 different corners of the watch face.
You can obtain this watchface from the Connect IQ store.
or by going to
this
direct link.
Facade is licensed under the GPL V3.0.
The latest source tree is available
for browsing
here
and tarballs for the latest and older versions are located at the following links:
Configuration
The watch face can be configured from the Connect IQ store,
the Garmin Express app,
or the watch itself.
The most convenient way to configure things
is from the on device settings
(screenshots of these settings are pictured above)
on the watch itself:
- press and hold the back button
- tap on Watch Face
- tap on the pencil icon below the Facade watch face image
- finally tap on Settings
Note that there is no way to cancel changes,
the only way out of the configuration menu
is to press the back button which will save
the current settings.
Metrics
Metrics display,
at a glance,
certain information maintained
by the watch.
Most of the metrics are just
a number to represent the metric
and an icon below that number
to indicate which metric is
being display.
Each corner of the watch
can be independently configured
to show nothing or one of the
10 available metrics.
-  Battery percentage.
Shows the current battery level as a percentage
of the maximum charge.
An arc surrounds the number giving an
analog indication of the charge percentage,
going from a full circle for 100% to a half
circle for 50% to nothing for 0%
(although the whole screen will probably
be blank if the battery is truly at 0%).
Also the color of this metric changes
to indicate the level of charge going
from green (50% - 100% charge),
to yellow (25% - 50%),
and finally red (less than 25%).
-  Heart rate.
Current heart rate measured in Beats Per Minute (BPM).
-  Step count.
Steps taken since midnight.
-  Moon Phase.
This will show an icon that shows an approximation
of the moon phase.
More details about the moon phase icon are found in the
Moon Phase Indicator section.
-  Calories expended.
Calories expended during the day, measured in kCals since midnight.
-  Distance traveled.
$istance traveled throughout the day, measured in kilometers since midnight.
-  Meters ascended.
Vertical distance ascended, measured in meters since midnight.
-  Active minutes.
Time not spent lazing on the couch.
-  Respiration.
How fast you are breathing, measured in Breaths Per Minute (BPM).
-  Temperature.
Shows the cached value for the temperature as reported by the watch.
This creates two problems with the temperature metric:
- Stale cached data.
The watch only caches the last weather data from the attached phone,
which typically updates its data every 20 min
(I've heard rumors that Apple phones only
check the weather every hour).
To give some hint of how stale the
weather data is Facade will
colorize the temperature metric,
going from green
(data less that 35 min old),
to yellow
(data less that 65 min old)
to orange
(data less that 125 min old)
to red
(data greater than 125 min old).
- Locaion.
Note that the temperature reported is
not the temperature where you are standing.
Garmin gets its weather data
from the closest official
weather station.
Note the two ill defined terms in that
sentence.
Since Garmin refuses to identify which
weather station it is using you are left
to guess that the watch is showing
you the temperature somewhere,
presumably nearby.
Timezone configuration
The problem with using the watch itself
to configure timezones
is that scrolling through 327 timezone
options on a limited display is
painful in the extreme.
To alleviate this problem Facade restricts which
timezones you can select from the on device settings.
Every time you use the Connect IQ or the Garmin Express
app to set a new timezone
(either the main or secondary timezone)
the watch will store that timezone in
a timezone cache
(the cache contains no more
than 16 entries
and the same cache is used
for both the main and secondary timezone)
on the watch itself.
When setting the timezone through
the on device settings you can only
select a timezone that is in that cache.
For example,
I live in the US where we have
6 major timezones.
I use the Connect IQ app to configure
each of those timezones once and
then I can easily use the on device
settings to set any US timezone I want.
Note that you can always set any
of the 327 timezones from the
Connect IQ or Garmin Express apps,
it's only the on device settings
that are limited to the timezone cache.
Other settings
- AM/PM off
There is no AM/PM indication on the watch face
(I guess you have to look out the window and see
if the sun is shining).
- PM only
In the afternoon PM will be shown just below
the center of the watch.
- AM/PM
An AM or PM,
as appropriate,
will always be displayed just below
the center of the watch.
- Hands CCW
If set the hands of the watch will run
counter clockwise.
(I don't recommend using this all the time
unless you're a masochist that likes headaches,
it is remarkably hard to read
the time when the hands are going backward but,
as a prank, you can really mess with someone who
insists upon borrowing your watch).
- Reset TZ cache
This will reset the timezone cache
so that all entries are deleted
except one for the Local timezone,
and, as an obvious side effect, this will
set the main and secondary timzones to Local.
Moon Phase Indicator
The moon phase is displayed as one of
the above 8 different icons
going from new moon to full moon and back.
The new moon and full moon icons are in white to
distinguish them from all the other phases.
Waxing phases are in green while waning phases
are in tan.
Moon phase approximation
(Basically an apology for why Facade is only
approximately correct about moon phases.)
There are two issues that make identifying the
correct moon phase extremely hard:
- Lunar cycle
The moon completes its cycle of phases
in 29.5 days
(more precisely in 29.530588853 but who's
keeping track).
- Lunar orbit
It's an elipse rather than a circle
which means the various phases other than
a new moon can appear at slightly
different times during the lunar cycle.
This makes computing the precise
moon phase extremely difficult and
way beyond the capabilities of Facade.
Having said that,
Facade attempts to be fairly
accurate.
It calculates the current lunar
day by
comparing the current date to the
reference date of the new moon on
January 6, 2000
(I wanted to use the reference
date of Januaray 1, 1900 but the
Garmin date/time routines don't
like dates before the Unix epoch
of January 1, 1972), modulo 29.5(30588853).
This calculation seems to be fairly
accurate
(the same calculation
is certainly correct for
the 44,206 days from the new moon on
January 1, 1900
to the new moon on
January 12, 2021).
This results in a lunar day of 1 - 29
(actually, some months it turns out
to be 1-30 because of roundoff with the
lunar period).
The lunar day is then converted to
one of 8 icons (representing the moon
waxing from new moon to full moon and
then back a new moon),
each icon representing 2-3 days for that
particular moon phase.
This conversion is offset by 1 day so
that the icon appears for the
day before the phase, the actual
phase itself and then 1 day after the
phase
(give or take a day depending upon rounding errors).
Building from soure
Building from source is just a matter of installing
the source tree in Monkey C Visual Code Studio
and then do a build,
that should work just fine.
The problem comes in if you need to change
the timezone data like adding a new timezone
or deleting one.
By definition the Garmin architecture
requires at least 2 linked source files,
the settings.xml file that shows
the timezones presented to the user in the
settings app and the actual timezone data
that is encoded in an MC code
file.1
The basic design is to do just that,
the settings.xml entries have an index
that selects the appropriate entry from the
timezone data table.
There are 2 problems with this basic design:
- Having 2 different files that need to
be kept in sync is a maintenance nightmare
and devotely to be avoided.
- Keeping all the data for 327 timezones
causes memory problems on watches that
have restricted memory (using a single,
large table crashed on a Forerunner 55).
The scond problem is solved by breaking up the timezone
data into 50 entry chunks and then storing each chunk
is a separate MC file.
This way the code only has to have in memory
50 timezone entries at a time rather than 327.
The code in Tz.mc does the translation
from one of the 327 timezone indices to
an appropriate index in the appropriate TzData
file.
This unfortunately makes the first
problem
(keeping multiple files in sync)
even worse as now have to keep 7
files
(settings.xml and
6 different timezone data files)
in sync rather than just two.
The solution is to maintain a
canonical timezone data base file,
support/country.txt and
use the Pearl script support/tz.pl
to extrace everything we need from
the data file.
Running the command tz.pl support/country.txt
will generate a settings.xml file and
the 6 different TzData files.
After generating these 7 files you have to
manually
(sorry about that,
there doesn't seem to be
a way to do includes in settings
files)
add the generated lines in settings.xml
to the appropriate places in the
actual resources/settings/settings.xml file.
Then copy all of the TzData files into
source/TzInfo
and you should be ready to build.
1. What I really wanted to do was
to define a unique table of timezone data and then
have the entries in the settings.xml file
index into the appropriate entry in that table.
Since there are multiple countries that share the
same timezone this would reduce the table size
needed in the code by about a factor of 2.
Unfortunately,
that design is not possible because
arrays in the settings.xml file
have to have unique indices.