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 

  • I just quick check if there is something to capture Di2 buttons press...
    I found only:
    https://developer.garmin.com/connect-iq/api-docs/Toybox/AntPlus/ShiftingListener.html (which seems do not capture DI2 D-Fly button)
    Other way maybe is to capture Light Mode change:
    https://developer.garmin.com/connect-iq/api-docs/Toybox/AntPlus/LightNetworkListener.html#onBikeLightUpdate-instance_function


    Maybe if you pair Di2 shifters to the app, maybe you can get D-Fly buttons messages Slight smile, maybe not...
    https://developer.garmin.com/connect-iq/core-topics/pairing-wireless-devices/

    I'm not Garmin developers, so it's just quick look Slight smile

  • https://developer.garmin.com/connect-iq/api-docs/Toybox/AntPlus/LightNetworkListener.html#onBikeLightUpdate-instance_function

    Maybe with this Class, we could implement this Logic:

    1. When I "Single Press" Di2 D-Fly button (Lights Change Mode) = we capture LIGHT_MODE_... FLASH or ST (first mode in Light Network: Flash), and if "Smart Bike Lights" App on Manual: don't do anything, but if "Smart"- then replace Lights Mode to some other by automations (because we know that "Lights Change Mode" was pressed). For Example: "Single Press" Di2 D-Fly button (Lights Change Mode) - it will cycle selected Modes (pairs - for Headlight and Taillight), select light intensity for both lights, and automation (e.g. Day Flash or Night Flash depending on sunset).
    2. When I "Double Press" Di2 D-Fly button (Lights On/Off) = we capture LIGHT_MODE_OFF, "Smart Bike Lights" app toggle "Manual" or "Smart" mode.
  • Apologized for the late reply

    > So, maybe your app can expose trigger, which I can select on Di2 button? (for now I see only default list)

    Unfortunately, that is not possible with CIQ as there is no API for this.

    > these default numbers (modes), are fixed for specific light model? or I can list somehow all available? (when I create custom mode, is it going to create new number?)

    Yes, usually the numbers are fixed for a specific light model by the light manufacturer. I never seen a light where the mode numbers change based on the settings. You can see all light modes the light emits by clearing the "Lights Configuration" app setting and using the 1 Field Layout. Each number in a button represents the light mode emitted by the light.

    > What I note: it seems there is a conflict with your app, when I select Smart mode, because Di2 buttons sends Light Network signals - it will work, but it will switch back to Smart mode after a few seconds.

    Yes, that is correct. When you change the light mode by using the Di2 buttons, Smart Bike Lights will detect this as an external light mode change. Based on described behavior, you checked the option "Force Smart mode", which will override the mode that was caused by the external change (Di2 button). If you uncheck the force option, then the mode change made by Di2 button will not be overridden and the Smart Bike Light mode will switch to Manual (M)

    > If we stuck with Garmin action list for Di2 buttons. Can your app capture when Di2 button press and send to Light Network command:

    Currently, it is not possible to fine tune the external light mode change behavior, but I think it should be possible to implement it.

    > they change mode, and it will stay in selected mode until I switch my Garmin datascreen where is your app - then your app will switch back to Smart. This is correct, right?

    That is odd, if you are using "Force Smart mode", then the light mode change should be overridden by the Smart mode regardless on which data screen the data field is located

    Maybe with this Class, we could implement this Logic:

    I will keep in mind this when I will have time to implement the customization for the external light mode change.

  • That is odd, if you are using "Force Smart mode", then the light mode change should be overridden by the Smart mode regardless on which data screen the data field is located

    I can verify this again...

    I will keep in mind this when I will have time to implement the customization for the external light mode change.

    That would be awesome Slight smile
    I really need just quick way to signal other drivers or people on the road - at some sections where I want attention (turn on crossing, etc..) - the fastest way for me:
    use remote buttons, in my case Di2 (on my Gravel), or Bontrager Remote (on my MTB, just ordered, can check later how it works).
    When I press single time I want Flash (Headlight, Taillight, Helmet light or all of them, would be awesome option to choose)
    And when I'm finish turn or out of danger section, I want to quick back to previous mode: double click Di2 button - and it will get back to Smart mode.

    All other options - like changing other modes, is nice to have, but not required for me, because I can change them from Garmin

    Thanks for quick feedback, your app is game changer! Slight smile

  • Hi maca 

    some years ago we were speaking about incompatibility of smart bike lights app with other ones using “services”. At that time tyrewiz app caused smart bike lights app not working properly.

    is there any chance that the things got better?

  • I messaged via connect IQ, but asking here as well so other see it. Would you be able to add support for the new Wahoo Trackr radar? Let me know if there's anything I can do to help, if so. Thanks!

  • I have TyreWiz 2.0, but not sure if I noticed any issues. What is the problem? Would be interesting to see if I have the same