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 

  • You could put an example configuration for a set of lights (no matter what lamps - changing to a different light and choosing modes is not a problem) back / front, because actually fully understanding it is "slightly" complicated.

    The sample configuration should include:
    - Timer state: OFF - lights off.
    - Timer state: On:
    Day from sunrise to sunset +10 minutes: front / rear lights on in Flash mode

    Night from sunset +10 minutes to sunrise: front / rear lights on continuously

    Alternatively, if you can press in both modes, the ability to detect negative acceleration and change the mode to a stronger one, it would be nice (you can always remove additional filters).

    Of course, if the above is possible to implement;)

    Thank you in advance ;)

  • Sure, here is the configuration:

    1,1|:1H>0#0,67121681#4,4|BRAKE:1:2A<-20|DAY:1:7Er0,s600|NIGHT:1:3Es600,r0|:1:0D=1#0,73404416#4,4|BRAKE:1:7A<-20|DAY:1:7Er0,s600|NIGHT:1:6Es600,r0|:1:0D=1#7,6:Varia 500|2,:-1,Off:0|1,Overdrive:1|1,High:2|1,Medium:3|1,Low:4|1,Flash:7#5,4:Varia 510|2,:-1,Off:0|1,Soild:4|1,Day Flash:7|1,Night Flash:6#B3570#3#2#0#0

    In this case additional filters like deceleration, must be defined before DAY and NIGHT filter groups as the first filter group that evaluates to true will be used. The default light mode can be set to whatever as it will never be used due to the DAY and NIGHT filter groups spanning thought the whole day.

  • Thank you, you are really great!
    Maybe I can provide sample configurations so that users can choose? ;)
    By the way - changing the Garmin <-> Bontrager headlight cleans the page. Can you do something about it?

  • > Maybe I can provide sample configurations so that users can choose? ;)

    That would be great, I can put them on the top of the configurator page :)

    > Can you do something about it?

    Fixed.

  • The widget is now published (https://apps.garmin.com/en-US/apps/fa3c2332-76e3-4ba1-8528-32a0fd617ab1) but due to the different lifecycle of widgets, the smart mode is not included. The problem of widgets is that they can be terminated at any time when they are not displayed which would stop the calculation logic from calculating the current light mode. Because of this limitation the widget was designed to work alongside the data field so that both can be installed and used at the same time. As CIQ applications cannot share data, the control mode (Manual, Network) displayed on the widget may not be the same. The control mode on the widget is used only to bring the light under the control of whichever light network mode has been chosen by the user (Auto/Individual/High Visibility).
    In case a light mode is changed by using the widget while the data field (Smart Bike Lights) is in Smart mode, the data field will behave the same way as when pressing the physical button on the light to change the mode, which will change the control mode to Manual. In order to efficiently switch back to Smart mode the data field now has a new setting "Control mode only" that is available for Edge devices with touch screen, which allows to switch back to Smart mode by tapping once on the light icon.

  • Cool! I think that this solution should be sufficient and an alternative to the garmin widget. I'll check in the evening. Thanks!

  • Fenix 6X Pro: No network   

    ###0,73404416###4:Varia510|Off:0|Soild:4|Day Flash:7|Night Flash:6#B3291##2#0#0

  • "No Network" usually means either that the light is not paired or the it is out of range. Did you pair the light using the Garmin sensor menu? If yes, are you able to see the light battery and mode within the Garmin menu?

  • Heh, only Radar visible in Sensors 

  • That is very strange as fenix 6 should support ANT+ lights as it is listed in supported devices for Varia 510: https://buy.garmin.com/en-US/US/p/601468#devices. Try the following steps: https://www8.garmin.com/manuals/webhelp/variartl510/EN-US/GUID-F54A2340-8932-4380-8D66-70EFFBC2F001.html it uses "Search All" option. Please let me know whether it works, so that I can update the installation process for fenix devices.