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’ll pay attention so I can answer these questions next time. I think it just turns off, and I’m not necessarily sure when it switches. 

    I’ll try the force option, sounds like it was meant for this. I was just confused because it never happened on my 830. 

    thank you!

  •  Thank you for this useful data field!  Can you comment on the profile name filter?  It looks like I can setup different filters within a configuration based on which Edge profile I have selected?  This sounds useful so I can have daylight flash on whenever timer is on while in commute profile but only on when a vehicle is approaching when in gravel profile.  Is this correct?

    EDIT: It seems that this is exactly what this filter does, excellent! I added a filter to check if profile = COMMUTE and to have day flash on when timer is > paused between sunrise and sunset.  I made this the first filter following my brakelight one.  Following that is my prior setup of day flash if vehicle approaching between sunrise and sunset and night flash between sunset and sunrise when timer > paused.  Device behaved as I had hoped, while timer was on during daylight hours and when profile was not commute it did not have day flash unless I approached from behind and set off a radar alert.  When I switched profile to commute, the day flash turned on and it alerted as expected when I approached from behind, then returned to daylight flash.  Very cool!

  • thanks ! I'd like to understand these parameters. How can I put this configuration to see what it will do ?

  • You can copy the configuration and load it in the configurator: https://maca88.github.io/SmartBikeLights/ by using the "Load" button. For understanding the basic on how filters and filter groups works you can check the documentation on GitHub: https://github.com/maca88/SmartBikeLights/wiki/Lights-Configurator 

  • Thanks you @maca88. Last thing, when I modify configuration on network lights, next activity will retrieve your or last configuration settings ?

  • If "configuration on network lights" refers to the lights control mode (Smart, Manual, Network) then yes, I will retrieve the last control mode even after restarting Edge.

  • Oops, next time, I will not try any other configuration during my ride ^^.

  • Hi! I hope for some pointers, because I can't get it to work.

    I have:  Garmin Edge 530 and Varia 515.

    In order to conserve battery power for long rides, I want:

    No threat detected:  Varia radar light off

    Threat detected: Varia light on (flashing perfectly fine).

    I tried to configure this with the Data Field app and this config string:

    ###0,73535488::1#2,2!RADAR:1:7:0:0I]-1]0!:1:0:0:0D=1##5:Varia 515!Off:0!Solid:4!Peloton:5!Day Flash:7!Night Flash:6#0::#0:0#0#0#B3121##3#0#0

    Nothing seems to happen at all:   Varia light continuously on when no threat is detected.

    Do I need the widget?

    Is what I want at all possible with 515 varia version?

    Please help Slight smile

    Tom

  • I'm no expert but  think there are some errors in the logic. Here is a copy of my 510 version for the 1030, which I've changed for the 515 on the 530. The only difference is that the smart function is only active when the timer is running but if you didn't want that you can always import it into the configurator to delete the filter and copy the new configuration string to your edge 

    You have probably already done this but you must also assign the data field to a screen on the edge activity profile for it to work

    ###0,73535488::1#3,2!ON:2:7:1:0H]1I]-1]0!:1:0:0:0D=1##5:Varia 515!Off:0!Solid:4!Peloton:5!Day Flash:7!Night Flash:6#0::#0:0#0#0#B3121##3#0#0

  • Thanks!

    I put your config string on my Edge, and I tested sitting in a chair....

    Radar 515 light is off, and it appears to detect threats; when Edge beeps for a threat, light stays off.
    Maybe it is because Edge detects zero speed (I am in a chair after all).

    Test it on the bike next.

    Meanwhile, all input is appreciated!