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 

  • My exercise bike is hidden under a metal roof, so unless startLocation is somehow acquired through Bluetooth phone sync, there shouldn't be one.

  • The start location filter was added in the latest release (version 0.10.0). Here is an example that should not turn on the lights when indoor:

    1,1|:1J=1#4587520,196641#2,2|TUNNEL:1:5:1G<4|:1:63:1D=1#6291461,1409482753#3,3|TUNNEL:1:5:1G<4|STOP:1:1:1C<0.27778|:1:7:1D=1###B3558#2#1#0#0

  • Thank you, indoors it works as expected, I hope to check it outdoors in a few hours.

  • Hi. Brillant job with the app and the flexibility. Well done.

    However I have 3 issues to raise. Any help welcome.

    1. It shows error 4. I've spent 2h and I have no idea why. It seems that there is an issue with the Night Flash on the ION Flare, but I am not sure any more. The config is here:

    1,1|:1H>0#4587520,196641#3,3|DAY:1:63:1Er0,s0|NIGHT:1:62:1Es0,r0|:1:0:1D=1#6291461,1409482753#4,4|BRAKE:1:1:1A<-20|DAY:1:8:1Er0,s0|NIGHT:1:63:1Es0,r0|:1:0:1D=1###B3121#2#1#0#0

    2. Latest Garmin Express (mac) does not allow to paste the full config like this:

    1,1|:1H>0#4587520,196641#3,3|DAY:1:63:1Er0,s0|NIGHT:1:62:1Es0,r0|:1:0:1D=1#6291461,1409482753#4,4|BRAKE:1:1:1A<-20|DAY:1:8:1Er0,s0|NIGHT:1:63:1Es0,r0|:1:0:1D=1#6:ION 200 RT|Off:0|High:1|Medium:2|Low:5|Day Flash:63|Night Flash:62#6:Flare RT|Off:0|Day Steady

    cuts here. The rest (below) does not seem to fit in the configuration window :(

    :1|Night Steady:5|Day Flash:7|All-Day Flash:8|Night Flash:63#B3121#2#1#0#0

    3. IOS Garmin Connect version does not allow to paste the code as well... show a web site not found message.

  • Ok. Reseting the light and reinstalling the data field fixed error 4 Slight smile

    Now only issue 2 and 3 remains. I am uploading the short config, but I could really use adding the buttons to the data screen Slight smile

    Any clue where the issue migh be?

  • Thanks for your feedback and I do apologize for wasting your time on this. Thanks to you I discovered that Garmin Express Mac and Garmin Connect iOS have some issues that I didn't know before.
    Issue 2 is related to Garmin Express Mac and its lack of support for maxLength attribute, which I reported it here:
    https://forums.garmin.com/apps-software/mac-windows-software/f/garmin-express/258277/maxlength-attribute-for-an-app-setting-is-not-working-implemented

    Issue 3 is related to the strange behavior of Garmin Connect Mobile iOS when the setting contains some characters, which I reported here:
    https://forums.garmin.com/apps-software/mobile-apps-web/f/garmin-connect-mobile-ios/258279/alphanumeric-type-app-setting-does-not-accept-and-characters

    As mentioned here, it is very unlikely that Garmin will fix this in a near future, so the only thing that I can do is to replace the characters that do not work in Garmin Connect iOS to something else so that at least you can use Garmin Connect iOS to update the configuration. As for Garmin Express Mac, I do not know for any workaround that would allow to save a string with more than 256 characters, so the only thing to do here is wait for Garmin to resolve the issue. I will inform you when the new version with the replaced characters will be released.

  • Cool! Thanks for your feedback!

  • Hi

    I have found one additional issue.

    The smart data field looses the S mode. Each time I put Garmin to sleep, restart, after its forming the lights network the mode changes to M. I have to manually set it to S. Garmin mode: Individual.

    If Garmin mode: Auto. Same as above, but the status changes to N.

    Looks like forming light network changes the status of lights out of smart mode. Forming lights network make the lights blink once. Maybe thats the reason.

    Is there any way for the lights mode to stay S?

  • Each time I put Garmin to sleep, restart, after its forming the lights network the mode changes to M

    I was able to reproduce that, Edge before going to sleep turns off the lights, which smart data field detects it as an external change and set the control mode on M (Manual). Unfortunately there is no way to detect that the device went to sleep, so the only thing that I can do is to add a setting which will prevent external changes to switch to M when enabled. With this setting enabled, the smart mode will behave similar to the Garmin Auto mode, where even if you turn off the light by pressing the button on the light, it will be turned on again. In case you don't like the setting that I will add, there is another thing that you could do to prevent this. In your configuration you could add a filter that will turn off the lights when the timer is stopped so that the lights will be turned off by the smart mode before the device goes to sleep and this will prevent the mode to be changed to M upon waking.

    If Garmin mode: Auto. Same as above, but the status changes to N.

    I wasn't able to reproduce that, on my Edge 1000 Garmin mode Auto behave the same as Individual. This are the steps that I took to reproduce it:
    1. Set Garmin Light Mode to Auto
    2. Put the lights into the smart mode (S)
    3. Start the timer so that the lights would be turned on by smart mode
    4. Stop the activity
    5. Press the power button to put Edge to sleep
    6. Wait 30 seconds and press again the power button to wake Edge from sleep
    7. The light will be in M mode, when the light network will be formed

    Please let me know what you did different to achieve the Network mode (N) instead on Manual (M) after a sleep.

  • Hi. Sorry for a late reply. I was not able to repeat the N issue again.

    Coming back to the setting, I have currently set the filter to turn on lights if timer > ST, but the lights sometimes come back to the M mode anyway. It would be good to have a setting enforcing S mode, when activating the data field.

    My personal goal is: turn on Garmin and let the Smart mode forces S and control the lights :) The only thing I would do with the lights is to charge them Slight smile

    Anyways, thanks for the feedback and your hard work!

    PS. I set up a filter for breaking to kick in only above 10km/h. Should it be before or after acceletration filter?