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 

  • Thanks for sharing how you solved the issue, it may help others that are dealing with similar issues.

    I will update the widget this week, most likely on the weekend. I will let you know when the new version will be released.

  • The widget was updated (version 0.8.0) with the features that were recently added to Smart Bike Lights, so now you can set multiple configuration also for it.

  • Thank you very much for upgrading widget too.

    I tried for the moment (only with Garmin Edge 1000) both data field and widget with primary=RTL510 and secondary=RTL500.

    It works fine … but only if I change primary to secondary (and viceversa) with Garmin Express (for Windows), while if I change using Garmin Connect Mobile (for Android) it seems configuration is getting corrupted, and neither widget nor data Field are more working (widget shows button numbers instead of strings, while data filed is not even loaded - ! symbol).

  • I have re-configured it to use only one Smart Bike Lights data field. I have primary ION Pro head light and ION 200  as secondary configuration. ION Pro is OK, but ION 200 causes Error 4. I used both configurations before without issues in two data field configuration. What could be wrong here? 

    My configurations: 

    #4587520,196641:1,175179543#14,8|Tunnel:1:62:1G[2|Night1:3:1:1B[3C]9.72222Es2700,r-2700|Night2:3:2:1B[4C]5.55556Es900,r-900|Night3:2:5:1C]1.38889Es0,r0|Night4:1:62:1Es0,r0|Day1:2:63:1Er0,s0H]2|Day2:1:0:1Er0,s0|:1:0:1D=1#0,73404416#7,5|Tunnel:1:6:1G[2|Night:1:6:1Es-900,r0|Day1:3:7:1Er0,s0H]1I]-1]0|Day2:1:0:1Er0,s0|:1:0:1D=1#7,6:Ion Pro RT|2,:-1,Off:0|1,High:1|1,Medium:2|1,Low:5|1,Day Flash:63|1,Night Flash:62#5,4:Varia 510|2,:-1,Off:0|1,Solid:4|1,Day Flash:7|1,Night Flash:6#0::#0:0#B3122#1#2#0#0


    #4587520,196641:1,1784236394#14,8|Tunnel:1:62:1G[2|Night1:3:1:1B[3C]9.72222Es2700,r-2700|Night2:3:2:1B[4C]5.55556Es900,r-900|Night3:2:5:1C]1.38889Es0,r0|Night4:1:62:1Es0,r0|Day1:2:63:1Er0,s0H]2|Day2:1:0:1Er0,s0|:1:0:1D=1#0,73404416#7,5|Tunnel:1:6:1G[2|Night:1:6:1Es-900,r0|Day1:3:7:1Er0,s0H]1I]-1]0|Day2:1:0:1Er0,s0|:1:0:1D=1#7,6:Ion 200 RT|2,:-1,Off:0|1,High:1|1,Medium:2|1,Low:5|1,Day Flash:63|1,Night Flash:62#5,4:Varia 510|2,:-1,Off:0|1,Solid:4|1,Day Flash:7|1,Night Flash:6#0::#0:0#B3122#2#2#0#0


     

  • but only if I change primary to secondary (and viceversa) with Garmin Express (for Windows), while if I change using Garmin Connect Mobile (for Android) it seems configuration is getting corrupted

    I tried to reproduce the issue, but on my Edge 1000 I am able to change all settings with Garmin Connect Mobile (for Android) without issues. Which software did you use to install the data field and widget, Garmin Express or Garmin Connect Mobile? If you used Garmin Express, you can try to uninstall and use Garmin Connect Mobile for installing them, this is what I used to install.

    while data filed is not even loaded - ! symbol)

    Can you please share the error by going into folder "Garmin\Apps\LOGS" of your Edge and copy the last error from "CIQ_LOG.TXT" file?

  • I used both configurations before without issues in two data field configuration. What could be wrong here? 

    Both configuration are valid and working on my Edge 1000, so I am not really sure that is going on. I also tried to simulate 2 headlights, but it still worked. Did you try to set the second configuration (For ION 200) as the first configuration ("Lights Configuration" app setting)? If not, please try it. In case it only works when any of the configuration is set as first and don't work when moved to secondary or tertiary, try to reinstall the data field.

  • I installed using Garmin Express...

    Regarding last error from "CIQ_LOG.TXT" file:

    ERROR: Array Out Of Bounds Error
    DETAILS: Failed invoking <symbol>
    STORE_ID: 0d9fd828c93244709c37fd2828881888
    CALLSTACK:
        @PC = 0x10003d12
        @PC = 0x100037ef
        @PC = 0x10000324
        @PC = 0x100002c3
        @PC = 0x10000116

  • Thanks, the error seems to occur when parsing filters from the configuration, but I was not able to reproduce it. I noticed when trying to update the settings in Garmin Express, the new settings are for some reason missing (secondary and tertiary) and when I updated the primary lights configuration, the data field displayed error 4. Then just by opening the settings with Garmin Connect Mobile and saving them as they are, the error is gone. It seems like that Garmin Connect Mobile and Garmin Express are not compatible regarding application settings and it is better to use only one of them to avoid problems.

  • I had tried to swap config strings - primary worked.

    I re-install data field, but I still get Error 4 when I switch from primary to secondary. 

    Error 4 persist when switching 1st or 2nd config string...

    It looks I have to go back for two data fields screens.

  • Sorry for late reply, but only recently I found out what the issue was. It turned out that with the latest version of Connect IQ Store 2.12, they removed support for some characters (opened a bug), where one of them was used by the data field (character |). The issue is now fixed with the latest version 0.15.1, but you will need to update your configurations by using the Light Configurator so that the character | is replaced to !.

    Updated configuration from above:

    #4587520,196641:1,175179543#14,8!Tunnel:1:62:1G[2!Night1:3:1:1B[3C]9.72222Es2700,r-2700!Night2:3:2:1B[4C]5.55556Es900,r-900!Night3:2:5:1C]1.38889Es0,r0!Night4:1:62:1Es0,r0!Day1:2:63:1Er0,s0H]2!Day2:1:0:1Er0,s0!:1:0:1D=1#0,73404416#7,5!Tunnel:1:6:1G[2!Night:1:6:1Es-900,r0!Day1:3:7:1Er0,s0H]1I]-1]0!Day2:1:0:1Er0,s0!:1:0:1D=1#7,6:Ion Pro RT!2,:-1,Off:0!1,High:1!1,Medium:2!1,Low:5!1,Day Flash:63!1,Night Flash:62#5,4:Varia 510!2,:-1,Off:0!1,Solid:4!1,Day Flash:7!1,Night Flash:6#0::#0:0#B3122#1#2#0#0

    #4587520,196641:1,1784236394#14,8!Tunnel:1:62:1G[2!Night1:3:1:1B[3C]9.72222Es2700,r-2700!Night2:3:2:1B[4C]5.55556Es900,r-900!Night3:2:5:1C]1.38889Es0,r0!Night4:1:62:1Es0,r0!Day1:2:63:1Er0,s0H]2!Day2:1:0:1Er0,s0!:1:0:1D=1#0,73404416#7,5!Tunnel:1:6:1G[2!Night:1:6:1Es-900,r0!Day1:3:7:1Er0,s0H]1I]-1]0!Day2:1:0:1Er0,s0!:1:0:1D=1#7,6:Ion 200 RT!2,:-1,Off:0!1,High:1!1,Medium:2!1,Low:5!1,Day Flash:63!1,Night Flash:62#5,4:Varia 510!2,:-1,Off:0!1,Solid:4!1,Day Flash:7!1,Night Flash:6#0::#0:0#B3122#2#2#0#0