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 

  • I can not precisely match actually the start date of problems but it is surely much earlier than last update 17.26.

    displayed group name is updated correctly only when i start the ride.After several minutes or seconds I see either no group name or group name or some incorrect one (for example I stop but displayed group name is still HAMUJ instead of Start)

    to fix lagging in group name displaying and lights working as well I must switch back to the data screen where you data field is set up. for some shorter or longer period of time it resolves problems. Currently I did "workaround" and set Smart Bike Lights data field on data screen with lap summary that is easily accessible by pressing Di2 button, when i notice that "lights hang" I switch to data screen with Smart bike lights datafield and lights work well again

    in terms of TEMPE Sensor - I have got one but I use regular garment temperature data field, no CIQ app for this sensor.

    other installed CIQ app: Target Power, HR Slider, Power Slider, TyreWiz Data Field, WindField

    And two additional questions:

    which speed sensor is taken for fixing group name? Could my problem be connected with "mess" in speed value readings because I use Garmin speed sensor instead of GPS one?

    Can Smart bike lights data field be set up at any screen? yesterday I found somewhere information that it should be fix to first data screen.

  • I tried to reproduce the issue with Ion Pro + Flare RT and Edge 1040 without luck. My Bontrager lights after the first reset are not visible anymore on Edge as the ANT is disabled (no blue light). After resetting them the second time, the blue light is again flashing and both lights are immediately recognized again by Smart Bike Lights (using individual light network).

    If you are able to reproduce this issue, please let me know how to do it, so that I can try to reproduce it myself and fix the issue. Regarding updating the configuration, you can achieve the same thing without using Garmin Connect Mobile or Express:
    1. Tap three times on the Off button to enter the app-settings editor
    2. In the menu select a different configuration (e.g. if current is "Primary", switch to "Secondary")
    3. Go back to the light panel by tap the left arrow
    4. Tap three times on the Off button again to enter the app-settings editor
    5. In the menu select the initial configuration (e.g. from "Secondary" back to "Primary")
    6. Go back to the light panel by tap the left arrow
    7. Individual light network will be re-created which also happens when you update the configuration via Garmin Connect Mobile or Express

  • After several minutes or seconds I see either no group name or group name or some incorrect one (for example I stop but displayed group name is still HAMUJ instead of Start)

    That is not good. I will test your configuration in the following days and will report the results.

    when i notice that "lights hang" I switch to data screen with Smart bike lights datafield and lights work well again

    To me this seems like that Edge for some reason stops calling the "compute" method that is supposed to be called every seconds regardless where the data field is located in the activity. Smart Bike Lights uses the compute method to calculate the current light mode based on the configured filters and sets the new light mode if a different filter gets activated. If that is true, then that is bad as I cannot fix this. Nowhere in the documentation is said that the compute method may not be called in certain cases (e.g. high cpu). So, if this really happens, I would argue that this is a bug in the Edge firmware.

    which speed sensor is taken for fixing group name? Could my problem be connected with "mess" in speed value readings because I use Garmin speed sensor instead of GPS one?

    From what I know the currentSpeed value used in the data field will take the most accurate one. If you have a speed sensor, then it will be used for retrieving the current speed instead of GPS one.

    Can Smart bike lights data field be set up at any screen?

    Yes, it can be located on any screen as the Smart mode logic is done in the compute method that is called by Edge regardless where the data field is located. 

  • Most likely problem is solved.

    tyrewiz data field has some compatibility issue. I switched airspy sensor to tyrewiz during winter but I could not have noticed problems during turbo trainer session.

    when i uninstalled mentioned Data field problem disappeared.

    thank you!

  • Thanks for the update. I checked the "TyreWiz Data Field" and I noticed that it uses background services. To me this seems to be the same issue as it is with "Tempe Visualizer" data field. Background services and ANT+ lights do not work together for some reason (most likely a bug in CIQ).

  • Hi Maca, 

    After an update my Edge1040 to the newest version 17.26 I can not load my configuration 

    1,1!:1H]0#4587520,196641::1#4,3!NIGHT:1:2:0:0Es0,r0!DAY:2:62:0:0Er0,s0C]4.16667!:1:0:0:0D=1#0,73535488::1#5,4!NIGHT:1:4:0:0Es0,r0!BRAKE:2:4:0:0C]1.94444A[-10!RADAR:1:7:0:0I]-1]0!:1:0:0:0D=1#7,6:Ion 800 RT:0:16777215!2,:-1,Off:0!1,High:1!1,Medium:2!1,Low:5!1,Day Flash:63!1,Night Flash:62#6,5:Varia 515:0:16777215!2,:-1,Off:0!1,Solid:4!1,Peloton:5!1,Day Flash:7!1,Night Flash:6#0::#1:1#123!:123!#0#B3843#9#3#0#0 

    I’m asking You to help me because after this update something is wrong with your application. The lights doesn’t work like before and there are some lags when I want to switch between different modes. Could You verify this settings for me? Now it’s impossible to use them

    Thanks Handshake

  • Hi Maca, 

    After an update my Edge1040 to the newest version 17.26 I can not load my configuration:

    1,1!:1H]0#4587520,196641::1#4,3!NIGHT:1:2:0:0Es0,r0!DAY:2:62:0:0Er0,s0C]4.16667!:1:0:0:0D=1#0,73535488::1#5,4!NIGHT:1:4:0:0Es0,r0!BRAKE:2:4:0:0C]1.94444A[-10!RADAR:1:7:0:0I]-1]0!:1:0:0:0D=1#7,6:Ion 800 RT:0:16777215!2,:-1,Off:0!1,High:1!1,Medium:2!1,Low:5!1,Day Flash:63!1,Night Flash:62#6,5:Varia 515:0:16777215!2,:-1,Off:0!1,Solid:4!1,Peloton:5!1,Day Flash:7!1,Night Flash:6#0::#1:1#123!:123!#0#B3843#9#3#0#0 

    I’m asking You to help me because after this update something is wrong with your application. The lights doesn’t work like before and there are some lags when I want to switch between different modes. Could You verify this settings for me? Now it’s impossible to use them

    Thanks Handshake

  • Hi,

    I tested your configuration on my Edge 1040 (version 17.26) and it works fine for me. What do you mean that you cannot load the configuration, do you see an error (e.g. Error 4) on the data screen?

    Apart from upgrading to version 17.26, did you install also some new CIQ data fields on your Edge? 

  • Hi Maca,

    The problem is that after changing the lighting mode, the appropriate mode that I pressed does not illuminate and the button turns black. The lamp changes the lighting mode but does not update this fact on the screen. Only when I change the data field to the next one and come back, only then do I see the highlighted mode that I previously clicked. Recently I added the Tyrewiz data field and before that everything worked perfectly.

    https://apps.garmin.com/pl-PL/apps/d1d7fe09-0f41-4067-94f4-2f8512a14737