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 

Known issues:

1. Unable to use Tempe Visualizer or TyreWiz Data Field alongside Smart Bike Lights:
https://forums.garmin.com/developer/connect-iq/i/bug-reports/lightnetworklistener-onbikelightupdate-not-called-when-certain-data-fields-are-installed

  • Smart Bike Lights uses a 64bit number to append the missing light modes to the capable modes emitted by the light

    Ok, so this is something new for Magene (ID51-59), because in old configs I don't have this:
    267911168,0

    When I create in configurator from scratch - I get this part.
    But, if I Load old my config, and add modifications in configurator - then it is still missing this part. This is how I get this problem I guess


  • It seems that AT1200/1600 lights are emitting capable modes differently, AT1200 does emit also mode 59 based on the image from Kamil (https://github.com/maca88/SmartBikeLights/discussions/104#discussioncomment-14675854), but AT1600 does not based on the video that you shared

    Yes, like I said in previous comment, I can confirm: it will have different list of ID's - depending how many Presets I add into AT1600 Light with Magene App.

    Here example, with just 3 Presets:
    https://1drv.ms/i/c/4ccaa19b4a2ea98d/EUC6-Q2Ahw5CmrmBNXVY8P8Bg3mETPdDO-A7IYbltEzibA?e=VCCfwC

    Here example - with 10 Presets (max):
    https://1drv.ms/i/c/4ccaa19b4a2ea98d/EbciHQpghK5LhKOY318XWn4B-qwdTXObuipF7uK7DWQNSw?e=xvPZfw

    So, I guess they have almost the same firmware AT1200 & AT1600 (it have just more max lumens)

  • t will show Error 1. In the past I do remember I got value 7 (Other - Undefined light type) for See.Sense ICON2 light in certain cases and that was due to incomplete implementation of the ANT+ Lights Profile specification in the ICON2 firmware. In my case, I also saw "Other" instead of "Headlight/Taillight" in the Sensors -> Lights menu. In order to understand what kind of light type is provided by the SDK, could you sideload the LightTester application

    Yesterday, I was able to repeat this error quite steady - multiple times.
    Today - it just don't want to happen again Slight smile.
    Only one time it happens: Error 1. But, your LightTester app crash at that time: Disappointed
    https://1drv.ms/i/c/4ccaa19b4a2ea98d/EU3ZzvxylDxAm50vqOlXhIEBpNFHsSniuS71L1O7V_VNsQ?e=C6jdr9 

    This is LightTester.TXT results: (longer run, but maybe you can find where the issue happend)
    https://1drv.ms/t/c/4ccaa19b4a2ea98d/ES9yny1a1MNFsGlga676K5QBU06tvYhfPcD3xx3orSH5MA?e=IzrliV 

  • I like my remote button on my MTB Slight smile, thanks for this amazing feature !!!
    https://1drv.ms/v/c/4ccaa19b4a2ea98d/Ebfbn7wypb5IrKBpcC1H85YBW4cRqe8OUF1mIfLtaIwTng?e=knSk4d 
    Remote works - instant, very cool!. All these delays are the same like I would press on the touch screen.

  • Hi
    Thank you, but ...

    I’m trying to test ANT+ light connectivity using the LightTester.prg app on my Garmin Edge 840.

    I followed these steps:

    1. Connected the Garmin to my computer.

    2. Copied LightTester.prg into the /Garmin/Apps folder.

    3. Created LightTester.txt inside /Garmin/Apps/LOGS.

    4. Disconnected the device and powered it on.

    However, after restarting, the Edge automatically reboots, and I can’t find the LightTester widget anywhere on the device.
    When I reconnect it to my computer, the LightTester.prg file has disappeared from /Garmin/Apps.

    So it looks like the Edge crashes or removes the .prg file during startup, and I can’t access or run the Light Tester widget at all.

  • When I reconnect it to my computer, the LightTester.prg file has disappeared from /Garmin/Apps

    That is normal, the application is then moved by Edge to a different one.

    and I can’t find the LightTester widget anywhere on the device.

    I rebuild rebuild and reupload the prg file as I maybe uploaded for a different device. Can you try to download it again from the same link and see if it works? 
    The widget should be visible under Menu -> Connect IQ

  • I tried it again with the new LightTester.prg. The widget doesn’t appear under Menu → Connect IQ, but it is listed among installed Connect IQ apps.

    I was able to add it as a data field to an activity (see the attached image).
    Then I started an activity, switched to the LightTester data field, and cycled through all available modes — there are six total (three steady brightness levels and three flashing modes: fast, medium, and slow).

    After finishing, I checked the log file, which contains the following lines:

    Net ST=2 MD=1 T=239577
    Net ST=2 MD=1 T=265541
    Is this OK?

    By the way, I have a feeling you might be Czech — if so, we can also chat somewhere else in Czech if that’s easier Slight smile
  • but it is listed among installed Connect IQ apps.

    You are right, my bad. I forgot that the LightTester is actually a data field.

    Is this OK?

    Hmm, that is not okay. Did you have the LightTester data field on the current data screen while you were cycling through all available modes? If yes, what did you see on the screen? Was Updates = X always zero?

    The X value should increase with each mode change, but if it stayed at zero, then there’s probably something wrong with how Ravemen implemented the ANT+ Lights profile.

    Are you able to change modes by using the Garmin native widget?

    By the way, I have a feeling you might be Czech

    Not quite, but close :)  I am Slovenian 

  • es, the LightTester data field was on the active screen while I was cycling through the modes using the button on the light.
    The “Updates” value stayed at 0 the whole time.

    However, when I change the modes using the native Garmin light widget, I can switch between four states — brighter, dimmer, flashing, and off.
    In that case, the “Updates” value increases, and the log looks like this:

    Net ST=2 MD=1 T=239577
    Net ST=2 MD=1 T=265541
    Net ST=0 MD=null T=13467
    Net ST=0 MD=null T=13481
    Net ST=1 MD=null T=302442
    Net ST=2 MD=1 T=304167
    UPD: TY=0 ID=1 LM=4 BS=1 T=304178
    UPD: TY=0 ID=1 LM=4 BS=1 T=304931
    Net ST=0 MD=null T=12649
    Net ST=0 MD=null T=12653
    Net ST=1 MD=null T=12850
    Net ST=2 MD=1 T=18329
    UPD: TY=0 ID=1 LM=2 BS=1 T=18813
    UPD: TY=0 ID=1 LM=2 BS=1 T=19231
    Net ST=2 MD=1 T=91240
    UPD: TY=0 ID=1 LM=7 BS=1 T=139344
    UPD: TY=0 ID=1 LM=2 BS=1 T=147343
    UPD: TY=0 ID=1 LM=7 BS=1 T=175597
    UPD: TY=0 ID=1 LM=2 BS=1 T=178343
    UPD: TY=0 ID=1 LM=7 BS=1 T=189343
    UPD: TY=0 ID=1 LM=2 BS=1 T=195343
    UPD: TY=0 ID=1 LM=7 BS=1 T=198343
    UPD: TY=0 ID=1 LM=2 BS=1 T=203343
    UPD: TY=0 ID=1 LM=7 BS=1 T=205343
    UPD: TY=0 ID=1 LM=2 BS=1 T=207343
    Net ST=1 MD=null T=235799
    Net ST=0 MD=null T=235803