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 

  • Can you help me please, I installed the DataField last night only and still new to the exercise with my phone (setting up downstairs in the garage and sending the code through my email upstairs to my PC).

    I have a Edge 1030 that is paired with a Varia UT 800 in front and a Varia RTL 510 as taillight. This is the code I extracted from GC:

    #0,73413136##0,73404416##7,6:Varia 800!2,:-1,Off:0!1,High:2!1,

    I would like to get this:

    UT800 :
    Default light is OFF. (I guess this what other people asked as well)
    Frontlight : activate Day Flash - when Speed > 8km
    Frontlight : activate Solid Night Light - 10 minutes before sunset - when Speed > 5km
    RTL 510 :
    Default light is OFF. (again, I guess this what other people asked as well)
    Radar - activate Day Flash - when Speed > 8km - and a car is approaching from behind
    Brake - activate Solid - when speed > 7km - and I use the brakes
    Please note I put these random numbers for my learning curve if I could figure out later on my own what you will send me Slight smile
    Also, one more thing. Last night I installed this DataField and it was there in the bike computer. Today I did something unusual...I turn OFF the Edge 1030 (after many many months for first time, always was on sleep/standby), charged the battery, turned the Edge back ON, and .... the DataField was not there only a blank field screen, I had to insert from the IQ back again.
    Both my GC and the Edge FW/software is up to date.

  • Here is the configuration that matches your requirements:

    #0,73413136#4,3!NIGHT:2:3:0:0Es-600,r0C]1.38889!DAY:1:7:0:0C]2.22222!:1:0:0:0D=1#0,73404416#5,3!BRAKE:2:4:0:0C]1.94444A[-10!RADAR:2:7:0:0I]-1]0C]2.22222!:1:0:0:0D=1#7,6:Ion 800 RT!2,:-1,Off:0!1,High:2!1,Medium:2!1,Low:4!1,Day Flash:7!1,Night Flash:6#5,4:Varia RTL 510!2,:-1,OFF:0!1,DAY FLASH:7!1,NIGHT FLASH:6!1,SOLID:4#0::#0:0#123!:123!#B2713#4#2#0#0

    the DataField was not there only a blank field screen, I had to insert from the IQ back again.

    That is strange, in case the data field would crash an "IQ" icon would be displayed on the screen, a blank screen should never be displayed. If that occurred only once and you are not able to reproduce it again, then maybe Edge temporarily glitched. 

  • Thanks. Is there anywhere some (programing language) instructions/manual what these numbers means,

    or how to edit manually on the spot (instead of copy paste from email),

    instead of going to github - Lights Configurator ??? The configurator looks pretty robust and for my 62 yo eyes I need to sit in front of a larger PC screen vs just doit on droid cellphone.

  • Thanks,

    Which part of a code defines "Brake - activate Solid - when speed > 7km - and I use the brakes"

    I have seen earlier somewhere in a thread that you proposed a "Brake - activate Solid" when the speed changes let say 30% with negative value - would that be -30%  ?? where to replace it if you could just highlight that number in the code?

  • Is there anywhere some (programing language) instructions/manual what these numbers means

    The configuration value is not meant to be edit manually, for editing you need to copy the value into the "Existing configuration" input in Lights Configurator and press "Parse" button, which will load the configuration and then you can edit it.

    how to edit manually on the spot (instead of copy paste from email)

    You can edit it on PC and then use Garmin Express instead Garmin Connect Mobile to set the value, which will avoid copy pasting it from email.

    with negative value - would that be -30%  ?? where to replace it if you could just highlight that number in the code?

    The above configuration is set to -10%, but you can easily change that in Lights Configurator:

  • Thank you for explaining.

    My initial thought was that the code you gave me was a " txt " which I could just edit the specific numbers/letters inside the Garmin Connect mobile app on that specific related line/field.

    I will try the Garmin Express, my Edges 1030 is syncing on wifi when inside a house, or better I can connect it to a PC with a cable...

  • What does Error 4 mean?

  • Hi Maca88,

    I have found cause of the Smart Bike Lights data field malfunctioning: this is due to a conflict with another data field (Garmin Tempe Visualizer) I installed recently, after having purchased a Garmin Tempe sensor to remedy to unreliable Edge 1030/1030+ internal temperature readings.

    Garmin tempe sensor is always active and, unfortunately,  not natively supported by Garmin Edge devices (unexplainable, as many Garmin things !), so a specific CIQ data field is required.

    Disabling Garmin Tempe Visualizer is not enough: you need to re-pair Garmin Varia to restore Smart Bike Lights proper functioning.

    And if I re-enable Garmin Tempe Visualizer, Smart Bike Lights re-start to not working properly again.

    It would be interesting if the you and the other programmer would cooperate to understand the root cause of such this conflict; I would like to keep both, but for now I must decide which of the 2 data fields to keep and which to discard.

    Smart Bike Lights is very powerful with no doubt, but, in these days, I have realized that wrong/missed control of radar light might be quite dangerous (light switched off when instead it should be on…).

  • Error 4 means that the configuration is invalid, this can happen when using a configuration from a different device. Here you can see all error code: https://github.com/maca88/SmartBikeLights#error-codes 

  • Thank you. Fact, I used the configuration for the UT800 but changed the light to ION 200 RT and I have Error 4.
    What's wrong here:

    #4587520,196641#4,3!NIGHT:2:5:0:0Es-600,r0C]1.38889!DAY:1:63:0:0C]2.22222!:1:0:0:0D=1#0,73404416#5,3!BRAKE:2:4:0:0C]1.94444A[-10!RADAR:2:7:0:0I]-1]0C]2.22222!:1:0:0:0D=1#7,6:Ion 200 RT!2,:-1,Off:0!1,High:2!1,Medium:2!1,Low:5!1,Day Flash:63!1,Night Flash:62#5,4:Varia RTL 510!2,:-1,OFF:0!1,DAY FLASH:7!1,NIGHT FLASH:6!1,SOLID:4#0::#0:0#123!:123!#B2713#2#2#0#0