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 

  • Unfortunately the Ambient Light Sensor on the edge isn't available to CIQ Apps, which would have been ideal for both of your scenarios.

    For tunnels you might be able to do it by setting up a filter that turns the light on if you have a poor GPS signal & for night time, although not ideal you could maybe set up a filter so that the light is on between sunset & sunrise

  • Hi, the problem is that you cannot use Tyrewiz data field along with Smart Bike Lights as there is a bug in CIQ where a data field that uses background services along with an ANT connection (Tyrewiz data field), breaks ANT lights API which Smart Bike Lights is using. As there are no other data fields for Tyrewiz, you have two choices:

    1. Remove either Tyrewiz or Smart Bike Lights data field

    2. Try asking Tyrewiz data field developer whether he can add an option to avoid using background services 

  • Ok. Thanks for your reply Maca88

  • I got the Edge Remote and did some testing. Unfortunately, I was not able to find a way to intercept the behavior of the blue button within the data field, but there is an alternative solution that could be implemented to preserve the original functionality, and add additional actions on top of that (e.g. set the lights to Smart mode). Smart Bike Lights treats all light mode changes that were done outside the data field (e.g. pressing the physical button on the light or Edge remote action) as an external change. When an external change happens, there are currently only two behaviors that you can choose from:
    - Put the light into Manual (M) control mode and keep the new light mode
    - If "Force Smart mode" is enabled, the light will stay in Smart mode and will revert back to the light mode that was used before the external change

    Here, it would be possible to extend Smart Bike Lights to be able to configure what should happen when an external change happens. For example, you would be able to configure to put the light into Smart mode when it is turned off by Garmin Remote (using the "Lights On/Off" action). The configuration would be very similar to Remote Controllers where you have an action (set Smart mode) and optional conditions that have to be met in order to trigger the action. As "Lights On/Off" and "Lights Change Mode" Remote actions are available only when the lights are paired with the Garmin Light Network, people using Individual Light Network won't be able to use this approach.

    The only solution to control the lights with Garmin Remote when using Individual Light Network would be to give up the native functionality (lap, change screens, ...) and pair the remote with the data field instead. With this, it would be possible to configure each button on the remote, but with the limitation that you could only do actions supported by Smart Bike Lights (play tone, change light mode or control mode, change configuration).

    I will try to implement both approaches, but it will take some time.

  • Thanks for the great feedback. It is complicated. As an Individual Light Network user, I don't even have "light actions" to talk about, unlike the other users, So I'm happy with complete takeover of ANT control. That remote doesn't even pair automatically to start with, so it does nothing most of the time. Better assign it light actions. The only useful native action "Change screens" would be greatly missed, but comprehensive control of lights and having more than one useful button is more beneficial.

  • I have 1040 with RTL515 and using Smart Lights. 515 has default settings+smart filter so it does switch on only when vehicle approaching is discovered. Now connected new UT800 (w/o any changes in Smart Lights) and cannot force it to change mode from blinking to constant when 1040 is in low light. Can there be some interference that blocked that option? ( Light Network is set to Auto and beam control to Auto.)

  • Do you changed the serial number to a new one in the configuration???

  • no. Smart Lights discovered ut800 automatically (RTL515 is same as it was). I didn't;t change anything in SL configuration, just paired new UT800 with 1040

  • If I am not mistaken UT800 has a "Auto Beam Adjustment" setting that has to be set to "Off" otherwise it will not let you switch the light mode. Try to set "Auto Beam Adjustment" to Off under "Sensors -> Lights -> Headlight" and check if it solves the problem. 

  • I've got Bontrager lights off again (no charging), and I could not apply the "reset procedure" because the tripple click on empty screen pulls notification shade. So i've had to rush to computer to reset it. Maybe intercept tripple click on the background is possible?