Smart Bike Lights (Data Field) / Bike Lights Control (Widget)

I've made two open source CIQ applications to control ANT+ lights:

- Smart Bike Lights (data field): https://apps.garmin.com/en-US/apps/0d9fd828-c932-4470-9c37-fd2828881888 

      Configurator: https://maca88.github.io/SmartBikeLights/ 

- Bike Lights Control (widget): https://apps.garmin.com/en-US/apps/fa3c2332-76e3-4ba1-8528-32a0fd617ab1 

     Configurator: https://maca88.github.io/BikeLightsControl/ 

Smart Bike Lights features:
- Automatic light control (Smart mode) based on the configured filters (sunset, sunlight, speed, ...)
- Manual light control (only for Edge devices with a touch screen or devices with CIQ 3.2 and more than 32KB memory)
- Records lights modes that are displayed in Garmin Connect

Bike Lights Control features:
- Manual light control (available to all devices)

Both applications can be installed on the same device, which can be useful for low end devices (e.g. Edge 520) where "Bike Lights Control" can be used to change light modes manually and "Smart Bike Lights" for automatic light control.

Currently registered ANT+ lights:
- Bontrager Ion Pro RT
- Bontrager Ion 200 RT
- Bontrager Flare RT
- Garmin Varia RTL500
- Garmin Varia RTL510
- Garmin Varia RTL515
- Garmin Varia HL500
- Garmin Varia UT800

in case your ANT+ light is not on the list you can help by doing the following:

1. Install Bike Lights Control
2. Pair your bike light with your Garmin device
3. Open the widget:
- Edge with a touch screen: post which numbers are displayed on the buttons and what mode each button represents when pressed
- Other devices: Select the "Light modes" menu and post which numbers are displayed in the menu and what mode each menu item represents when selected

Example for Bontrager Ion Pro RT:


1 -> High steady beam
2 -> Medium steady beam
5 -> Low steady beam
63 -> Day flash
62 -> Night flash

There are some features that could be possible to add in the future, but would require Garmin to add them to the CIQ api. In case you are interested in any of the below features, consider upvoting their feature request thread:

1. Control lights based on the ambient light sensor available on some devices:
https://forums.garmin.com/developer/connect-iq/i/bug-reports/ambient-light-sensor-api-access 

Known issues:

1. Unable to use Tempe Visualizer or TyreWiz Data Field alongside Smart Bike Lights:
https://forums.garmin.com/developer/connect-iq/i/bug-reports/lightnetworklistener-onbikelightupdate-not-called-when-certain-data-fields-are-installed

  • Did you perhaps swap the serial numbers in the configurations? Make sure that the taillight serial number set for the "AT1600 & FlareRT" matches the one for Flare RT.

  • Maybe, it could be "Mode"=Preset N, and "Button"=Low - which you can change (if you change configuration on Magene app)

    Yes, that is fine by me. I updated the Lights Configuator to have "Mode"="Preset N", and "Button"=Low" as suggested.

    It would be good, to have these at least in the list of available buttons (when you add custom button), no need I guess to have these by default. But, just in case if you would like to have default hardcoded mode - you have possibility.

    This is the current configuration for AT1200/1600:

    [
    { id: 0, name: 'Off' },
    { id: 60, name: 'Preset 10', buttonName: 'Custom 4' },
    { id: 59, name: 'Preset 9', buttonName: 'Custom 3' },
    { id: 58, name: 'Preset 8', buttonName: 'Custom 2' },
    { id: 57, name: 'Preset 7', buttonName: 'Custom 1' },
    { id: 56, name: 'Preset 6', buttonName: 'Breathing' },
    { id: 55, name: 'Preset 5', buttonName: 'Night Flash' },
    { id: 54, name: 'Preset 4', buttonName: 'Day Flash' },
    { id: 53, name: 'Preset 3', buttonName: 'High' },
    { id: 52, name: 'Preset 2', buttonName: 'Medium' },
    { id: 51, name: 'Preset 1', buttonName: 'Low' },
    { id: 1, name: 'Very High' },
    { id: 2, name: 'High' },
    { id: 3, name: 'Medium' },
    { id: 4, name: 'Medium-Low' },
    { id: 5, name: 'Low Garmin' },
    { id: 6, name: 'Slow Flash' },
    { id: 7, name: 'Strobe' }
    ];

    If something is missing let me know

  • If you see "no network" then it means that the light is not paired. You need to go to the Garmin Sensors menu and pair the light, similar as you would pair a speed/cadence/power meter sensors.

  • Looks Great for me.

    Presets / modes numbers match ANT ID’s

    And names are Magene’s factory defaults. 

    Good job!

  • To find the missing mode it would be required to sideload the Light Tester app (https://github.com/maca88/SmartBikeLights/tree/master/Source/LightTester) on your Edge. If you are willing to do so, please follow the steps described on GitHub:
    https://github.com/maca88/SmartBikeLights/tree/master/Source/LightTester#how-to-use 

    After step 10, provide the content from the LightTester.TXT file. In the file there should be records like:
    UPD: TY=0 ID=1 LM=1 BS=1 T=119853 (printed for each light mode change)
    UPD: TY=0 ID=1 LM=2 BS=1 T=137853
    UPD: TY=0 ID=1 LM=3 BS=1 T=150853
    UPD: TY=0 ID=1 LM=4 BS=1 T=165853
    UPD: TY=0 ID=1 LM=5 BS=1 T=183855

    LM is the light mode number emitted by the light. Please also provide which light mode each number represent. Example: 1 -> High, 2 -> Medium, ....

    Here you can download the LightTester.prg for Edge 850:
    https://github.com/maca88/SmartBikeLights/blob/master/Source/LightTester/build/edge850/LightTester.prg 

  • Be paried to Edge 850.

    Edge 850 basic setting is working.

    Only app setting don't working.

    Does it only work with Bluetooth settings? I'm paring to ANT now.

    And edge 530 is working same configuration.

    I think edge 850 some different.

  • Hi, Garmin Edge 850 is new for me according to UI. I copied LightTester.prg to Apps folder, created LightTester.TXT in LOGS, but after turning on, i cannot find any new widget - 6. Open the Light Tester widget . In Settings - System - Widgets, I have not any new widgets to add.

  • No worries I understood you Slight smile

    "Preset Mode" or "Custom Mode" - it doesn't matter (how vendor allows you to manipulate), they are flexible - not fixed.
    Hardcoded Modes are fixed - you have them by Garmin standard: ID1-7

    I asked Magene about that — besides the fact that these modes are listed in every spec sheet, manual, and on the packaging, they also serve as a backup.

    They need to have factory default - firmware default. When you do hard rest - you need to recover to default, otherwise if it will be empty - some users will panic and send bak to warranty Slight smile

  • Thanks - this is great! Awesome that now I can use all custom modes Slight smile

    { id: 1, name: 'Very High' },
    { id: 2, name: 'High' },
    { id: 3, name: 'Medium' },
    { id: 4, name: 'Medium-Low' },
    { id: 5, name: 'Low Garmin' },
    { id: 6, name: 'Slow Flash' },
    { id: 7, name: 'Strobe' }

    Just "Low Garmin" - seems only one left with Garmin Slight smile.
    It's up to you how you name Garmin fixed modes, I don't have preference:
    "Low" || "Low (fixed)" || "Low Garmin"

    Seems Garmin do not have good names also:
    https://developer.garmin.com/connect-iq/api-docs/Toybox/AntPlus.html#LightMode-module

  • Did you perhaps swap the serial numbers in the configurations? Make sure that the taillight serial number set for the "AT1600 & FlareRT" matches the one for Flare RT

    Now with new version of app - my old config and new config do not work Disappointed
    All these configs fails with: Error 3
    (S/N are correct, I double check)

    #16384,90382865:1,2147483647:1:#7,4!Speed:2:3:20:0C]6.66667Es0,r0!Night:2:5:60:0Es0,r0H]2!Day:2:0:60:0Er0,s0H]2!:1:0:0:0D=1#6291461,1409482753:0,889104606:1:#11,5!BreakD:3:1:5:0Er0,s0H]2A[-20!BreakN:3:5:5:0Es0,r0H]2A[-20!Day:2:8:60:0Er0,s0H]2!Night:2:63:60:0Es0,r0H]2!:1:0:0:0D=1#11,10:AT 1600:0:16777215:0!2,:-1,Off:0!1,Very High  \n1600lm-1.5h:1!1,High  \n1200lm-2h:2!1,Medium  \n800lm-3h:3!1,Medium-Low  \n600lm-4.5h:4!1,Low  \n400lm-6h:5!1,Very Low \n200lm-12h:59!1,Pulse \n 300/50lm-13.5h:60!1,Slow Flash:6!1,Fast Flash:7#8,7:Flare RT:0:16777215:0!2,:-1,Off:0!1,Day Steady  \n25lm-4.5h:1!1,Night Steady  \n5lm-13.5h:5!1,Day Flash  \n90lm-6h:7!1,All-Day Flash  \n45lm-12h:8!1,Night Flash  \n5lm-15h:63!1,:-2#0::#0:0#123!:123!#0#0#B3843#14#1#0#0

    #16384,90382865:1,2147483647:1:#5,3!Night:2:51:60:0Es0,r0H]2!Day:2:0:60:0Er0,s0H]2!:1:0:0:0D=1#6291461,1409482753:0,889104606:1:#11,5!BreakD:3:1:5:0Er0,s0H]2A[-20!BreakN:3:5:5:0Es0,r0H]2A[-20!Day:2:8:60:0Er0,s0H]2!Night:2:63:60:0Es0,r0H]2!:1:0:0:0D=1#5,4:AT 1600:0:16777215:0!2,:-1,Off:0!1,Low \n200lm-12h:51!1,Medium  \n600lm-4h:52!1,High  \n1200lm-2h:53#8,7:Flare RT:0:16777215:0!2,:-1,Off:0!1,Day Steady  \n25lm-4.5h:1!1,Night Steady  \n5lm-13.5h:5!1,Day Flash  \n90lm-6h:7!1,All-Day Flash  \n45lm-12h:8!1,Night Flash  \n5lm-15h:63!1,:-2#0::#0:0#123!:123!#0#0#B3843#14#1#0#0


    When I clear config, I see that your app combine multiple Taillights:
    FlareRT + Varia 515 = and now I see only  ID:5 & ID:7 modes (which match on both lights). Not sure if that is a problem or not? (because I specify Taillight model and S/N)

    Edit: I removed Varia 515 from sensors. I still get: Error 3
    if I clear config: I see both lights - all ID numbers I see, and if I press they work (now I just notice sometimes hang - slow respond, but after 2-7 seconds start working...).
    If I add config - I get again Error 3

    Here is Video with Error 3, slow response & fail to set mode
    1drv.ms/.../EXkkNm9aLDFNp46ANCNaNMIBs-OeKiIaA3kbbDGtIdizmQ