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 

  • That is really strange... the only thing that I can do to fix this is to add an additional setting which will not let an external change switch the mode to M when in Smart mode. Similar to how the Garmin Auto mode work, if you manually turn off the light by using the button on the light, the Auto mode will turn it on again. Would such setting be ok for you?

  • Yes please, that would be appreciated.

  • hi maca88,
    Thanks for your work on this.
    I'm trying to test a configuration of bike radar turning on my rear light when the radar detects traffic.
    I've got an Edge 130 plus, Varia RVR 315 and a Bontrager Flare RT rear light.

    Using your lightsconfigurator page however I can't set a radar profile - I'm assuming the "edge 130 plus" with radar filter isn't a valid combination? even though the edge 130 plus is a supported device: developer.garmin.com/.../BikeRadar.html

    I can validate an existing profile listed in one of your "radar" configs in another thread eg
    "1,1|:1H]0###0,73535488#2,2|RADAR:1:7:1I]-1]0|:1:0:1D=1##5,4:Varia 510|2,:-1,Off:0|1,Solid:4|1,Day Flash:7|1,Night Flash:6#0::#B3122##3#0#0"

    and then modify that, changing computer to edge 130 plus and then flare RT rear light - which produces the following:
    "1,1|:1H]0###6291461,1409482753#2,2|RADAR:1:7:1I]-1]0|:1:0:1D=1###0::#B3558##1#0#0"

    It appears I can download to edge 130 plus via Lights Configuration datafield app which loads OK - but I'm not having success in getting the rear light to flash on when the radar detects cars - however I need to fully test it when its dry outside and go for a proper ride rather than just testing on the pavement!

    I know the light is in S mode as I've added the lights as a datapage when riding and can see the small "S" for smart mode.

    So my main question is - am I barking up the wrong tree completely by trying to get the radar filter working on an edge 130 plus? or should this work in theory?
    Thanks.

  • So my main question is - am I barking up the wrong tree completely by trying to get the radar filter working on an edge 130 plus?

    Unfortunately yes, Edge 130 Plus has only 32KB memory and the radar filter is supported only for devices with more than 32KB memory. I didn't add the radar filter as the data field reaches the 32KB memory limit, when using two lights and having multiple filters configured. I may evaluate it again to see how much memory would it cost to add the radar filter and if there are any memory optimizations that I could apply to save some memory. I will let you know in case I will be able to add the filter for your device.

  • Thanks maca88 for the comprehensive explanation & possibly  looking at memory optimization options.

  • The "Force Smart mode" setting was added in the version 0.13.0. You need to update the data field to the latest version and update the existing configuration by checking "Force Smart mode" in the light configuration. The following configuration is the same as the last one, but with the new setting enabled:

    1,1|:1H]0###0,73535488#2,2|RADAR:1:7:1I]-1]0|:1:0:1D=1##5,4:Varia 510|2,:-1,Off:0|1,Solid:4|1,Day Flash:7|1,Night Flash:6#0::#0:1#B3122##3#0#0

  • Thank you for the help.

    I can't get v 0.13.0 to install.

    I've checked Garmin Express on PC. I've downloaded it through that heap of s**t, but it hasn't updated from "12".

    I've tried Connect IQ phone app. It says it's installing, but then goes back to a queued app waiting to be installed.

    Multiple syncs and reboots don't help either.

    Typical Garmin f***** s***

  • Yea unfortunately sometimes can be quite tricky to update an IQ app, try to do the following:
    1. Connect Edge with your phone via bluetooth
    2. Install/Update the IQ app by using Garmin Connect Mobile
    3. If after one minute the IQ app is still not installed restart Edge and don't do anything after restart on it (don't open any menus, activities etc)
    4. After the Edge is again connected to your phone, open "Data Fields" menu in Garmin Connect Mobile every 10-20 seconds until the IQ app is updated/installed (it should not take more than 3 retries)

    the following is how I am able to update IQ apps on my Edge 1000 and also how I updated to version 0.13.0. I think that the key is in the third point, as a restart will unload all IQ apps from memory, but that is just my guess.

  • Thank you. That worked, I'm now on v0.13.0. and have added the new code line.

    Can you please explain about this: "update the existing configuration by checking "Force Smart mode" in the light configuration"?

    I can't find it in the menus.

    Thanks.

  • Hi Maca,

    after several weeks and several hundreds of kilometers I am back with a piece of experience. I was using alternately your sophisticated DF and my simple DF, both in the individual network mode. From the lights perspective both worked finally as desired. However, I noticed sometimes strange variations in speed value, especially in places with obstructed sky view. First I thought the speed sensor has weak battery, so I replaced it. But the did not seem to change. Then I used another sensor of the same type (SIGMA) from my gravel bike. It also did not change.


    It seems that while individual network is used the communication with speed sensor is negatively influenced, but not destroyed completely. Garmin still says (all the time) the sensor is connected but for some reason in certain moment after starting a ride it gives up using data from the sensor and defaults to GPS data.

    I was thinking about possible collisions at the radio link level.. but I do not know how exactly the access to the radio link is synchronized.

    Don't you have some experiences in this regard?

    Thanks, Jan.

    P.S. At this moment I had to switch back to using Garmin's light network with only the rear light and control the front light manually, which is stupid when I consider that the ability to control the light from the computer was one of major buying factors :-(.