Watch Face : Clarity (and variations)

Clarity

This Watch Face delivers a wealth of information, available at a glance. Date and time, sun and moon data based on your latest known position, activity data and history, current elevation and UTC time/date.

*** Tested with D2 Bravo firmware 2.30 ***

*** Battery icon only displayed if charge < 50%. Sunset and Sunrise only displayed if a location is saved as last-known-location. If you reset the watch or update firmware, this data is deleted. You have to acquire position again before sunset/sunrise can be displayed. ***


Variations available:

- Clarity (this watch face - has most data displayed)
- Clarity Pilot (no activity data to declutter) https://apps.garmin.com/en-US/apps/3dee8af7-7c49-4ca6-9c14-2845f9ad718b
- Clarity Activity (no UTC time, replaced with steps count) https://apps.garmin.com/en-US/apps/369974bf-ca84-4f7c-bb03-afaf7e8ff3d2


Watch face features:

- Bluetooth status: icon only displayed when phone is connected
- Battery status: icon only displayed when level under 50%. Battery icon filled to reflect charge level. If charge under 30%, a label displaying the exact charge level in % is added. This is to declutter/improve clarity.
- Date: Displayed in your watch selected language.
- Time: Hours (black) and minutes (accent color dark red during day and dark blue during night). Minutes displayed as dash at screen border, in accent color.
- Sun and moon data: Moon icon reflects current moon cycle. Sunrise time (after sun icon) and sunset time (after moon icon) at your latest known location. Time to next sunrise/sunset.
- Move bar displayed on the left side of the graph. It appears if you don't move for too long, according to the watch Move Bar feature. In accent color.
- Histogram graph displaying steps in last 7 days (in dark grey) + today's steps slightly larger (in accent color), as counted by the watch activity monitor. Average target over 8 days is displayed as a horizontal line in accent color.
- Distance elapsed since beginning of day, as counted by the watch activity monitor.
- Calories burned since beginning of day, as counted by the watch activity monitor.
- Current altitude measured by the pressure sensor (can be set automatically with METAR if you have the D2 for best accuracy).
- UTC time ("Z" stands for "Zulu"). If the UTC date is different that the local date, UTC date is displayed too to avoid confusion. Minutes have accent color to remind the main clock.

Sunset and sunrise times

Calculation for these two items are very long (1 to 2 seconds) and are only done when necessary (watch face started, position changed significantly, sunset/sunrise just happened...), and not once per second, so as to optimize power. There should be only 3 calculations per day if the location isn't changed significantly.

Known bugs

- Power consumption is high and may drain the battery in a few days. This is due to Connect IQ framework not enabling reduction in refresh rate correctly (in my current opinion)
- Low power mode is not activated as often as I hoped. This is due to the watch firmware, not to this watch face.
- Time to next sunrise/sunset could sometimes be displayed inappropriately (e.g. 13:-05 instead of 14:55 or something similar).

Clarity
I came up with this name initially because I wanted to make a watch face that's clear. Now I added so much data that it's a little cramped and not as clear as I initially imagined. If you have suggestions to improve clarity/readability, let me know.
  • Hi! Sorry for late reply!

    using Toybox.Activity as Act;

    // later in the code:
    var actInfo = Act.getActivityInfo();
    var position = actInfo.currentLocation;


    I programmed the sunrise/sunset by myself but it's a real big pain in the a**.

    How do you get last known position inside watch face? I tried in my program but I always get a error about permissions.

    And do you calculate sunrise/sunset by your self or there is a build in function in the Connect IQ?
  • Hey Marco,

    For the moon, it's 2 lines! :)

    var moonDiff = Time.now().value() - 1439563980;
    var moonAge = ((moonDiff %2551443)/60/60/24).toNumber();


    This returns a number between 1 and 29 (or 0 and 29? I forget) and I just put the corresponding image of the moon (there's 29 of them)

    For the sun, it's really complex (takes more than 1 sec for the watch to calculate the orbits!) and I'm not ready to share the code at this time, sorry! I'm sure you can find tutorials online. I may share it later.

    Great work! How do you calculate the sunrise/sunset and moon? It would be very cool, if you could publish the source code.

    Thank you
    Marco
  • Hi! Sorry for late reply!

    using Toybox.Activity as Act;

    // later in the code:
    var actInfo = Act.getActivityInfo();
    var position = actInfo.currentLocation;


    I programmed the sunrise/sunset by myself but it's a real big pain in the a**.


    But doesn't that "go stale" if you haven't had GPS on in a while? I believe the data in Activity.info is only valid for a few hours after your last activity.
  • Hi Jim,

    I've seen this working for days without a new GPS fix. (this is actually the reason I created the Location app - to make sure the reported sun times are based on my current location)

    Very rarely, it stops working (like after 2-3 weeks) and I need to get a new GPS fix. Sometimes it actually fixes itself (but this may be due to my watch face which decides when to make a new sun time calculation).

    The last known location (with this method) definitely is lost when hard resetting or upgrading.

    But doesn't that "go stale" if you haven't had GPS on in a while? I believe the data in Activity.info is only valid for a few hours after your last activity.
  • Hi Jim,

    I've seen this working for days without a new GPS fix. (this is actually the reason I created the Location app - to make sure the reported sun times are based on my current location)

    Very rarely, it stops working (like after 2-3 weeks) and I need to get a new GPS fix. Sometimes it actually fixes itself (but this may be due to my watch face which decides when to make a new sun time calculation).

    The last known location (with this method) definitely is lost when hard resetting or upgrading.


    Why not just have user settings for lat/lon (at a known location), instead of using what could be old info from a 100 miles away if your last run was that far away? The Activity.info location can be stale in a number of ways, including being from a location that's not close to where you are.
  • For the sun, it's really complex (takes more than 1 sec for the watch to calculate the orbits!) and I'm not ready to share the code at this time, sorry! I'm sure you can find tutorials online. I may share it later.


    I made my own calculations for sunrise/sunset. I converted some javascript code to monkey c. It will only take 50ms on my fenix 3. What are you doing in 1 sec? :confused:

    Greetings
    Marco
  • Hi! Sorry for late reply!

    using Toybox.Activity as Act;

    // later in the code:
    var actInfo = Act.getActivityInfo();
    var position = actInfo.currentLocation;


    I programmed the sunrise/sunset by myself but it's a real big pain in the a**.


    It works!!! Thank you very much!!!
    About sun rise I found some code, most probably I will be able to port it to Monkey C and I will publish it here.
  • Hi Jim,

    That's definitely a possibility, but I don't use the watch for running - I use it for flying and traveling. I don't want to input manually new coordinates every time I'm in a new spot. Instead, I want to know if the sun times are trustworthy (so I check my widget with the map to ensure location is correct - if not I make a GPS update), and that's it. I wouldn't consider inputting manually coordinates every time I change location, it would be too frequent and not user friendly for this specific use.

    As you pointed out, runners may have a different use and not change location as often, so it may be better in that case to fix coordinates for a specific, unvarying location - and I will consider adding the option with a user setting. Thanks for the idea!

    Why not just have user settings for lat/lon (at a known location), instead of using what could be old info from a 100 miles away if your last run was that far away? The Activity.info location can be stale in a number of ways, including being from a location that's not close to where you are.
  • I'm calculating the orbits of mars and pluto! Just kidding - the tutorial I found was quite complex and as a result, the exec time is quite long (I have to run it 3 times to ensure a correct approximation).

    I don't know how you manage 50ms because that's the minimum time I get just to display the watch face without even considering a sun time calculation. Do you mean 50ms on the simulator or 50ms on the watch? If it's on the watch, my D2 Bravo must be very slow, or my code very inefficient (not even considering the sun calcs).

    I made my own calculations for sunrise/sunset. I converted some javascript code to monkey c. It will only take 50ms on my fenix 3. What are you doing in 1 sec? :confused:

    Greetings
    Marco
  • The way I did the sunrise/sunset calc isn't optimal at all it seems - it's very complex and long. I should take the time to find a new way to do it but I have no time :(

    It works!!! Thank you very much!!!
    About sun rise I found some code, most probably I will be able to port it to Monkey C and I will publish it here.