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 your help.

    Done the above procedure and the "ConnectIQ Fields" does not show after holding the Back/Menu (B) button. Only "Stop Live Tracking", "Navigation" and  "Bike Settings".

    I also tried to start the activity without the Live Tracking, maybe there's a limit of options but then there was just "Navigation", "Bike Settings" (and the settings wheel at the bottom).

    Sooo, how to report that bug to Garmin? And is there any workaround for me (with the widget?) to switch to Smart mode?

    Thanks - BR, Robert

  • Sooo, how to report that bug to Garmin?

    I opened a bug report for it: https://forums.garmin.com/developer/connect-iq/i/bug-reports/appbase-getsettingsview-does-not-work-for-venu-2 

    And is there any workaround for me (with the widget?) to switch to Smart mode?

    The widget does not have a Smart mode so that is not an option. You can try to do the following:
    1. Uninstall Smart Bike Lights data field and then install it again
    2. Use Garmin Express or Garmin Connect Mobile to set the "Lights Configuration" app settings
    3. Set the data field in your bike activity

    By setting "Lights Configuration" app settings before adding the field to the activity, it should initialize the light in "Smart mode". As there is no way to return back to Smart mode in case you would accidentally switch the light mode by using the physical button on the light, you can update the configuration by ticking the "Force Smart mode" checkbox. Configuration with "Force Smart mode":

    2,2!:1H]2!:1C]1.38889###0,73535488#5,4!BREMSE:1:7:0:0A[-20!NIGHT:1:6:0:0Es-2700,r2700!TAG:2:7:0:0Er2700,s-2700I[200]0!:1:0:0:0D=1##5:Varia 515!Off:0!Solid:4!Peloton:5!Day Flash:7!Night Flash:6#0::#0:1#B3703##3#0#0

    This will prevent from switching to Manual or Network control mode.

  • Hello maca88,

    awesome - thanks for the help and opening the bug ticket!

    The workaround works! Thanks.

    Let's hope that Garmin sorts out the problem with the ConnectIQ Fields on the Venu 2.

    Thanks - BR, Robert


  • ---
    Error: Unhandled Exception
    Time: 2022-06-09T17:27:55Z
    Part-Number: 006-B2713-00
    Firmware-Version: '13.40'
    Language-Code: dan
    ConnectIQ-Version: 4.1.2
    Store-Id: 0d9fd828-c932-4470-9c37-fd2828881888
    Store-Version: 26
    Filename: C4MA5901
    Appname: Smart Bike Lights
    Stack:
    - pc: 0x10003039
    - pc: 0x100028f3
    - pc: 0x10000067
    - pc: 0x30002947

  • Within a last two weeks time I have initiated two datafields but only yesterday was a time to ride:

    - vehicle count for the radar,

    - smart lights

    And the yesterdays 3 hrs ride drained the rear radar/light almost completely (but honestly it was working well with S mart mode). I can agree with that the radar/light sensors communicating with the Edge 1030 and that will reflect to a battery usage (lights toggling on-and-off all the time the vehicles are passing), but I am planning some longer rides as well and I need your Help to preserve as much battery life possible.

    I can live without the vehicle count and most likely I will disable that datafield.

    Is there any trick or good advise how to set the radar S mart light more battery friendly? W/o this datafield that radar lasted me many many days btw. Including for review:

     #0,73413136#4,3!NIGHT:2:3:0:0Es-600,r0C]1.38889!DAY:1:7:0:0C]2.22222!:1:0:0:0D=1#0,73404416#5,3!BRAKE:2:4:0:0C]1.94444A[-10!RADAR:2:7:0:0I]-1]0C]2.22222!:1:0:0:0D=1#7,6:Ion 800 RT!2,:-1,Off:0!1,High:2!1,Medium:2!1,Low:4!1,Day Flash:7!1,Night Flash:6#5,4:Varia RTL 510!2,:-1,OFF:0!1,DAY FLASH:7!1,NIGHT FLASH:6!1,SOLID:4#0::#0:0#123!:123!#B2713#4#2#0#0 

  • Thanks for providing the error info. Based on the stack addresses I can see that you stumble upon a bug that was fixed with version 0.19.0 (you are currently using version 0.18.0). Please update the data field to the latest version (0.21.0) and this error should not happen anymore.

  • Based on you current configuration the only thing to optimize the battery level would be to remove the "BRAKE" filter which triggers every time you slow down or to decrease the braking sensitivity (from -10 to -20 or -30).
    As the data field records the light modes during the activity, you can see in Garmin Connect how much time the light was in each mode by checking the "Taillight mode" graph. In the graph:
    - "4 Mode" represents the "Solid" light mode (BRAKE filter)
    - "7 Mode" represents the "Day Flash" light mode (RADAR filter)

  • At and around my place the traffic is pretty high, 444 was a vehicle count last time two days ago, and that was an average day - mixed low and high traffic roads on my 46Km trip.

    I will remove the "BRAKE" filter to test but really not many times maybe 10-15x activated on the entire trip (back country roads and not really traffic lights).

    Also I stopped two times for brake on the side of the road, the radar was beeping but no blinking on light.

    Do you have a "filter" not to turn off when not in motion (but the activity still alive in the background)? I mean tun ON the function at the activity Start and remained ON until the activity complete End?

  • hello,

    i am using this great application for a while by now. I have the varia 515 and 800 lights. Rexently i upgraded my bike with a di2 transmission. those shifters have the hidden hood buttons. These buttons can be programmed to many function on the garmin edge. Can we make, somehow, those buttons to change the smartlight application mode? They can be programmed to change the garmin light modes and lights on/off, but i woul like to change the modes on the smartlight app because that is the app i am useing for my lights.

    thank you 

    george

  • Do you have a "filter" not to turn off when not in motion (but the activity still alive in the background)? I mean tun ON the function at the activity Start and remained ON until the activity complete End?

    Yes, you can use the Timer filter (Timer state > Recording) as a global filter and remove the Speed filter, which currently prevents the light from being turned on when stopping for a break.
    Here is the modified configuration with the removed Speed filters for both lights and also with the global filter that will turn off the lights when the activity is not running:
    1,1!:1H]0#0,73413136#3,3!NIGHT:1:3:0:0Es-600,r0!DAY:1:7:0:0Er0,s-600!:1:0:0:0D=1#0,73404416#4,3!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!2,:-1,Off:0!1,High:2!1,Medium:2!1,Low:4!1,Day Flash:7!1,Night Flash:6#5,4:Varia RTL 510!2,:-1,OFF:0!1,DAY FLASH:7!1,NIGHT FLASH:6!1,SOLID:4#0::#0:0#123!:123!#B2713#4#2#0#0