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 

  • Garmin Varia 510

    Data for Garmin edge 830

    4 ->  Steady beam

    7 ->  Day flash

    6  -> Night flash

  • Thanks Jarek! I've added the required mappings and it is now available in the Lights Configurator: https://maca88.github.io/SmartBikeLights/

    In case you still don't see it, please clear the browser cache. 

  • Thank you for adding Varia 510 to the configurator. 

    For Bontrager ION 200 RT Headlight, the numbers are the same as for the ION PRO RT

    1 -> High steady beam 2 -> Medium steady beam 5 -> Low steady beam 63 -> Day flash 62 -> Night flash

  • Hi. Garmin Edge 1030, Varia HL 500:
    Overdrive - 1
    High - 2 (default auto mode)
    Medium - 3
    Low - 4
    Flashing - 7

    Problem - no option to select Hi / Low mode - manually or automatically, as it is in the Garmin widget.
    I use Beam Angle to adjust the headlight beam angle automatically based on the rate of speed. Higher beam angles are used at high speeds, and lower beam angles are used at low speeds.


    I checked in the room by simulating a higher speed by spinning the wheel and giving a speed signal from the trainer, but it does not seem to me that the automatic shifting from short to high beam was done with an active light field, even with the "N" setting. Perhaps a GPS signal is required, unfortunately I cannot check it at the moment.
    Is it possible to add a Low / Hi / auto mode width switch? These are also some codes, because the garmina widget allows you to switch the beam width or allow automatic control.

    If it was possible to control the two LEDs separately, i.e. hi / low, it would be great. Now, in Low mode, it is true that you can select all light power levels for the wide / near beam, and the long-range light LED lights only at the lowest power level.

    Oh yeah - could you compile the field as a widget? This would replace the garmine widget, which is not entirely useful, e.g. I can't quickly choose any light power, but only choose between continuous / blinking / off, and the beam width (although I usually choose auto here).

  • Jarek: thanks also for the RT 200 mapping, I've added it to the configurator.

    Prozorowicz:

    hi, first thanks for the HL500 mapping, I've added it to the configurator.

    > giving a speed signal from the trainer, but it does not seem to me that the automatic shifting from short to high beam

    The application uses currentSpeed property to get the current speed, which works by using the GPS. I am not sure whether it is possible to retrieve the speed from a trainer.

    > Is it possible to add a Low / Hi / auto mode width switch?

    Unfortunately it is not as Connect IQ does not provide an API for it.

    > could you compile the field as a widget?

    Never tried, but I think I can. But as the "Beam Adjustment" menu cannot be implemented in Connect IQ, would you still replace it? Wouldn't it be better to have this data field as the second data screen so the garmin widget could be accessed when swiping left from the primary (first) data screen and this data field when swiping right?

  • In fact, GPS speed is required (friends confirmed;)).
    Yes, I'd still rather have it as a widget - much more accessible than digging through a few active screens. On the other hand, I also have a few widgets, but it's easier to have the one most needed to slide off and use.


    From what my friend reports, using the Ion Pro lamp in auto mode and in parallel with your field does not remove the auto mode when it comes to adjusting the lighting strength, there is no change of the mode from "auto" to "user", but it is possible to choose the lighting power mode from Your lamp field. It suits us the most, if it is also confirmed in the Varia HL500, then the garmin widget will not be needed, because I would set the light width adjustment mode to auto, and I would set the rest from the field, e.g. switching from flashing to continuous light after sunset (now switches the light sensor much too early), or switching on the light after acceleration, etc.


    And that's right - is it possible to use the braking mode? It is true that in radar 510 I do not see much sense, because there are only 3 lighting modes (unless it would switch from flashing to continuous light during the day, and at night it would turn on the night flashing mode, and stronger braking would turn on flashing, etc.), but maybe someone such a solution would be useful?
    If so, how to implement it?

  • > Yes, I'd still rather have it as a widget

    Ok, I will look into that and report when it will be published.

    > using the Ion Pro lamp in auto mode and in parallel with your field does not remove the auto mode when it comes to adjusting the lighting strength, there is no change of the mode from "auto" to "user"

    If you are referring to the "Auto mode" displayed on top of the garmin widget, this cannot be changed with a Connect IQ application. When pressing a button on the data field, the control mode button, which is the button that displays either "N", "S" or "M" will be changed. So when pressing a button on the data field, the control mode button will display "M", which means manual mode. When in manual mode the garmin "Auto mode" it not active anymore, even if it is displayed in the garmin widget. To again activate the garmin "Auto mode", you need to press on the control mode button until it displays "N", which means network mode (Auto/Individual/Trail/High Visibility).

    > I would set the rest from the field, e.g. switching from flashing to continuous light after sunset (now switches the light sensor much too early), or switching on the light after acceleration, etc

    Instead of manually pressing buttons on the data field you can configure "Timespan", "Acceleration" and "Speed" filters available in the Lights configurator, so that the data field will automatically set the mode for you.

    > is it possible to use the braking mode?

    You can use the "Acceleration" filter by setting a negative value to achieve that. Note that the filters defined in the configurator will only work when in Smart mode, which means that the control mode button must display the "S" character.


    > If so, how to implement it?

    Copy the below string to the "Existing configuration" in https://maca88.github.io/SmartBikeLights/ and click "Parse"

    1,1|NIGHT:1Es1800,r0###0,73404416#2,2|BREAK:1:7A<-30|:1:6D=1##5,4:Varia 510|2,:-1,Off:0|1,Steady Beam:4|1,Day Flash:7|1,Night Flash:6#B2713##2#0#0

    The configuration will turn on the light to "Night Flash" mode 30 minutes after sunset and it will switch to "Day Flash" when decelerating 30% per seconds. This is just an example, set the values to your needs.

  • Thank you for your very helpful explanations! I'm waiting for the widget;)

  • Hi,

    For Garmin Varia RTL515 (with peleton mode) code is:

    4 -  Steady beam

    5 -  Moderate (Peleton mode)

    7 -  Day flash

    6  - Night flash

  • Thanks for the mapping! I've added it to the configurator.