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 

  • Hi adamkuras,

    You cannot replace anything from the configuration I've sent. You have to create your own configuration using the Lights Configurator(Smart Bike Lights) where you have to choose and set the right devices in the configuration.

    Anyway, I have tried to generate a configuration for Edge 830 and Varia RTL 515, so try this one, I hope this will help:

    ###0,73535488#3,3!CAR:1:7:1:0I]-1]0!BRAKE:1:4:0:0A[-10!:1:0:0:0D=1##6,5:Varia 515!2,:-1,Off:0!1,Solid:4!1,Peloton:5!1,Day Flash:7!1,Night Flash:6#0::#0:0#123!:123!#B3122##3#0#0

  • Hi,

    You can turn off the light when pressing the stop button by adding a "Timer state" filter. I've modified the configuration that you provided by adding the "Timer state" filter into a global filter group:

    1,1!:1H]1###0,73535488#3,3!CAR:1:7:1:0I]-1]0!BRAKE:1:4:0:0A[-10!:1:0:0:0D=1##6,5:Varia 515!2,:-1,Off:0!1,Solid:4!1,Peloton:5!1,Day Flash:7!1,Night Flash:6#0::#0:0#123!:123!#B3570##3#0#0

    Regarding silencing the alert tone, unfortunately it is not possible to silence the alert tone with a CIQ application, so you will need to do it manually.

  • is it possible to turn the Varia 515 on/off when I turn the edge on/off or do I need to push the on/off button ?

    Unfortunately it is not possible as there is no way to detect when Edge is turning on/off with a CIQ application.

    s it possible that the 515 can start in "S" mode when I turn it on ?

    I suspect that you don't have a global filter that will turn off the light after the activity is completed and when you turn off your Edge, the light will be also turned off by Edge and Smart Bike Lights will detect this as an external change and will switch the control mode from S to M right before Edge is turned off. You can fix this by adding a "Timer state" global filter that will turn off the light after an activity is completed so that Edge won't need to turn off the light when shutting down. An alternative solution would be to tick the "Force Smart mode" checkbox, which will prevent external light mode changes to switch from Smart to Manual mode.

    I also discovered that if I turn off my edge for a short while and leave the Varia on, and turn on my Edge again the smart bike light page is gone ?

    What you do mean that the light page is gone, are you referring the the light panel that has the buttons for each light mode? By gone, you mean that "No network" or "Error X" is displayed?

    What will you suggest of smart configuration so iI the optimal out of the Varia 515

    The only thing that I suggest when creating a configuration is to add a global filter that will turn on the lights only when an activity is running (e.g. Timer state > Not recording). This will prevent the issues that you are facing with constantly switching from Smart to Manual mode after restarting Edge. Other that that, it is up to personal preferences what filters and which light modes to set.

  • Hi maca88,

    thank you very much for the answer and the new configuration with the filter "Timer state". I will replace my configuration with this one.

  • Thank you very much. I changed a few more things like the names and order of the lighting modes and it seems to me that it works very well now. thanks again for your help

  • I was very satisfied with the data field (as well as the widget too), but my configuration below (which worked always very well) now is not more properly working with new release 0.20.0 of the data field.

    To be honest, I have no idea of what’s happening with new release…but overall result is that:

    1. Filters seem now not working anymore
    2. Display of filter string and light icon is totally out-of-sync with Varia real light mode
    3. Sometimes the filter string is even not displayed (and this should not occur, given the filters I set).

    If I switch to another data page and then go back, so to refresh the data field, it seems the correct string and icon are restored, but only temporary.

    Where am I wrong ? Or is it a bug (introduced with new release) ?

    String config (I have removed Brake filters to make it even simpler):

    1,1!REC:1H]0###0,73404416#6,6!LOWBAT:1:0:0:0B]4!RADAR:1:7:1:0I]-1]0!TUNNEL:1:6:0:0G[4!NIGHT:1:6:0:0Es0,r0!DAY:1:0:0:0Er0,s0!:1:0:0:0D=1##5,4:Varia RTL 510!2,:-1,OFF:0!1,DAY FLASH:7!1,NIGHT FLASH:6!1,SOLID:4#0::#0:1#123!:12!#B2713##2#0#0

  • Your configuration is fine and it works on my Edge 1000 and Varia with the latest version of the data field (0.20.0). I tested with the TUNEL and DAY filter by going indoor to simulate a tunnel and outdoor to restore to DAY filter. The light icon along with the filter name were correctly changed every time the GPS signal was lost without going out of sync. I also tried in the simulator for Edge 1030 and there also works, so I am not really sure what is going on with your Edge. Based on your description, it seems like that the callback (onBikeLightUpdate) that is supposed to be called when the light mode is changed was not called and therefore the light icon and the text didn't changed. I would suggest you to try the following:
    1. Re-pair the Varia light
    2. Re-install Smart Bike Lights data field

    if none of the above fixed the issue, then I would assume that something was broken with the latest Edge 1030 firmware. Which firmware version do you have on your Edge?

  • Thank you for prompt reply.

    I already performed step 2 you suggested (before my previous message), not step 1 since Varia RTL 510 is correctly paired when switched on (and no Varia FW upgrade released since lot of time). I’m quite skeptical about.

    Edge 1030 FW is the latest available (13.40), released by Garmin at the end of April; I would exclude this since the issues appeared only in the recent days (end of May).

    I own Edge 1030 plus too, and I’ll check if occurring with it too.

    What I can add is that I’m using 10 CIQ data fields in 3 data pages, and some of these seems CPU intensive (timer skips seconds sometimes…). However, I was using the same data fields before, with no issue in Smart Bike Lights one.

    So, the only event that seems correlated to the start of the issues seems to be CIQ upgrade to 0.20.0.

    Would it be possible to downgrade it ? Has the configurator been upgraded too with 0.20.0 ?

  • Would it be possible to downgrade it ?

    From what I know, the only way to install an older version is by side loading it as a separate data field. I created a 0.19.0 version for Edge 1030, which you can download from the following link:
    https://github.com/maca88/SmartBikeLights/blob/test/edge-1030/Build/Edge1030/SmartBikeLights.prg

    as you cannot configure side loaded application, the configuration that you provided was hardcoded into the code:
    https://github.com/maca88/SmartBikeLights/commit/32991cf56b46356023dc6f3568b5895001dc2b77#diff-3a18950fa9f830639a6af00405a77ccf6d0952f907209a158c18156f0847cbfdR1736

    In order to install the above "prg" file, copy it into the "/Garmin/Apps" folder on your Edge. Then replace the current "Smart Bike Lights" data field with "Smart Bike Lights T" on your activity profile and see whether it works correctly with the older version.

    Has the configurator been upgraded too with 0.20.0 ?

    Yes, with 0.20.0 a new section was added for configuring tap light icon behavior. This is the configuration that was created by 0.19.0 version:
    1,1!REC:1H]0###0,73404416#6,6!LOWBAT:1:0:0:0B]4!RADAR:1:7:1:0I]-1]0!TUNNEL:1:6:0:0G[4!NIGHT:1:6:0:0Es0,r0!DAY:1:0:0:0Er0,s0!:1:0:0:0D=1##5,4:Varia RTL 510!2,:-1,OFF:0!1,DAY FLASH:7!1,NIGHT FLASH:6!1,SOLID:4#0::#0:1#B2713##2#0#0

    the difference is in "123!:12!#" value, which is not present in 0.19.0

  • Great. Thank you so much.

    I'll try it in my next ride and revert back to you.