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 

  • The Pages “Smart Bike Light” has disappeared now 3 times during an activity. There is only a small box on the Pages with “IQ” logo ? I won’t help by switching the 515 on/off. I have to completely turn the edge 1030 on/off but that’s not an option during an activity. What can cause this problem ?

  • There is only a small box on the Pages with “IQ” logo ?

    This means that the data field crashed, but unfortunately I don't see any exception in ERA (Error Reporting tool) for your Edge 1030. Could you please provide the content from file /GARMIN/APPS/LOGS/CIQ_LOG.YML stored on your Edge, so that I can see where it crashed and try to fix the issue?

  • Hello maca88,

    really nice CIQ apps. I just seem to have either done something or may not understand to do it correctly.

    I have a Garmin Venu 2 and the Garmin Varia 515 and I defined some global filters and special filters and configured like this:

    Smart Bike Lights:

    2,2!:1H]2!:1C]1.38889###0,73535488#5,4!BREMSE:1:7:0:0A[-20!NIGHT:1:6:0:0Es-2700,r2700!TAG:2:7:0:0Er2700,s-2700I[200]0!:1:6:0:0D=1##5:Varia 515!Off:0!Solid:4!Peloton:5!Day Flash:7!Night Flash:6#0::#0:0#B3703##3#0#0

    Smart Bike Lights Control:

    2,2!:1C]1.38889!:1H]2###0,73535488#4,4!BREMSE:1:7:0:0A[-10!NIGHT:1:6:0:0Es-2700,r2700!TAG:1:7:0:0Er2700,s-2700!:1:6:0:0D=1##6:Varia 515!Off:0!Solid:4!Peloton:5!Day Flash:7!Night Flash:6!null:-1#0::#0:0#B3703##3#0#0

    What I want to achieve is the following:

    - after starting a ride on my Venu 2 I want the Varia activated and with the global filters only active when recording and/or the speed is > 5km/h.

    If this is true than it should act like this:

    when decelerating -> Day Flash, when nighttime -> Night Flash, on daytime only Day Flash when car is approaching.

    At the moment the problem is that the Smart mode is not starting when I record a ride but the data field shows an "N" status and "INDV".

    When switching to the Smart Bike Lights Control it shows an Error 3.

    What am I doing wrong or what should I do that this works for me?

    Big thanks in advance! BR, Robert

  • Hi,

    When switching to the Smart Bike Lights Control it shows an Error 3.

    The second configuration is faulty as it contains "null:-1" that is why you get Error 3. If you know how to create a configuration that contains "null:-1" please let me know as this happened before (https://github.com/maca88/SmartBikeLights/issues/27), but I am not able to reproduce it.

    Your first configuration was very close to what you want to achieve, the only thing that I modified is the "Default mode" to "Off", so that on daytime, the light will be off when no car is approaching you. Here is the modified version:

    2,2!:1H]2!:1C]1.38889###0,73535488#5,4!BREMSE:1:7:0:0A[-20!NIGHT:1:6:0:0Es-2700,r2700!TAG:2:7:0:0Er2700,s-2700I[200]0!:1:0:0:0D=1##5:Varia 515!Off:0!Solid:4!Peloton:5!Day Flash:7!Night Flash:6#0::#0:0#B3703##3#0#0

    Smart Bike Lights Control:

    Are you also using Bike Lights Control widget? If so, the configuration that you provided is not valid for the widget, you need to use a different Configurator: https://maca88.github.io/BikeLightsControl/

    As your device supports CIQ 3.2, there is no need to have the widget installed as you can manually change light modes also with the data field.

  • Hey,

    big thanks for the fast reply and the help! Awesome support! (btw, is there a way to support you with a donation?)

    The second configuration is faulty as it contains "null:-1" that is why you get Error 3. If you know how to create a configuration that contains "null:-1" please let me know as this happened before (https://github.com/maca88/SmartBikeLights/issues/27), but I am not able to reproduce it.

    Ok, maybe I'm the problem here. This configuration was set up via "Lights Configurator (Bike Lights Control)" and was intended to be used as a config vor the widget. But I could reproduce thus "null:-1" in this way:

    https://maca88.github.io/BikeLightsControl/

    Device: Venu 2
    Taillight: Garmin Varia RTL515
    + Add Button: Light mode --> Control mode

    The last step will introduce the "null:-1" in the configuration.



    2,2!:1H]2!:1C]1.38889###0,73535488#5,4!BREMSE:1:7:0:0A[-20!NIGHT:1:6:0:0Es-2700,r2700!TAG:2:7:0:0Er2700,s-2700I[200]0!:1:0:0:0D=1##5:Varia 515!Off:0!Solid:4!Peloton:5!Day Flash:7!Night Flash:6#0::#0:0#B3703##3#0#0

    Oh, perfect. Big thanks!!

    As your device supports CIQ 3.2, there is no need to have the widget installed as you can manually change light modes also with the data field.

    Hmm ok, how should this work? I tried to interact with the data field on my Venu 2 but it seems there's no way to change anything from the data filed view with any button or touch interaction.

    Big thanks - BR, Robert

     

  • btw, is there a way to support you with a donation?

    Currently there is none, maybe I will add an option in the future.

    But I could reproduce thus "null:-1" in this way:

    Thanks! I will fix this asap so that it won't happen again.

    Hmm ok, how should this work?

    You should be able to open a special menu by holding the "Up" button when being on the data screen that contains the data field. Then in the menu you should be able to select "Smart Bike Lights" -> "Light modes". In the same menu you can also set the control mode. Make sure that the light is in the Smart "S" control mode for the filters to work.

  • Currently there is none, maybe I will add an option in the future.

    Would be great!

    You should be able to open a special menu by holding the "Up" button when being on the data screen that contains the data field. Then in the menu you should be able to select "Smart Bike Lights" -> "Light modes". In the same menu you can also set the control mode. Make sure that the light is in the Smart "S" control mode for the filters to work.

    Ok, to be honest - I'm not really sure if it works with the Venu 2. With your config:

    2,2!:1H]2!:1C]1.38889###0,73535488#5,4!BREMSE:1:7:0:0A[-20!NIGHT:1:6:0:0Es-2700,r2700!TAG:2:7:0:0Er2700,s-2700I[200]0!:1:0:0:0D=1##5:Varia 515!Off:0!Solid:4!Peloton:5!Day Flash:7!Night Flash:6#0::#0:0#B3703##3#0#0

    when starting a bike ride the data field states "N" mode and "INDV". 

    How to get it to start/activate the Smart mode?

    The Venu 2 has no "Up" button and I'm not sure how to enter the menu to select the light modes.

    Thanks, Robert

  • The Venu 2 has no "Up" button and I'm not sure how to enter the menu to select the light modes.

    You are right, I didn't noticed that before. Could you try to hold the Back (Menu) button on the data screen where the data field is located to see if any menu is opened? I posted a question in the "Discussion" section (https://forums.garmin.com/developer/connect-iq/f/discussion/297334/venu-2-on-device-settings-view) and in case it does not support it, I will need to modify the Venu 2 code, so that you will be able to use the Smart mode without the on-device settings view.

  • Holding the Back/Menu button while an active activity and the Smart Bike Light data field active will oben a submenu showing "Stop Live Tracking", "Navigation" and  "Bike Settings" and the settings wheel at the bottom to get main watch settings.

  • I tested on my forerunner and I see the following menu items when pressing the "Up" button in the Bike activity: "Bike settings", "Training", "Navigation" and "ConnectIQ Fields". For some reason on your Venu 2 the "ConnectIQ Fields" menu item is missing. In order to test whether this is a Venu 2 issue or an issue with Smart Bike Lights data field, I modified a simple data field to support on-device settings. Could you please try it by following these steps:
    1. Download the grade data field: https://github.com/maca88/SmartBikeLights/blob/test/venu2-settings/Source/GradeDataField/build/venu2/GradeDataField.prg
    2. Copy the prg file into folder "/GARMIN/APPS" on your Venu 2
    3. Add the grade data field (GradeDataFieldApp) on your bike activity
    4. Go back to the main screen and then go back to bike activity. I couldn't see "ConnectIQ Fields" right after adding the data field, I had to re-open the activity to see it
    4. Hold the Back/Menu button and check if you see "ConnectIQ Fields" menu item

    In case you don't see the "ConnectIQ Fields" then I think it is a Venu 2 bug that needs to be reported to Garmin.