Lights

Related Config File Sections
lights:
light_settings:
light_player:

In MPF 0.50 all LEDs, matrix lights and GIs are configured as lights:. See “Lights” versus “LEDs” (Some LEDs are lights?!?) for details.

There are multiple types of lights (read those for specific details):

../../_images/lights_vs_leds.jpg

This is an example of for a light:

lights:
  my_led:
    number: 7   # the exact number format depends on your platform
This example is tested to be valid MPF config. However, it is not integration tested.
lights:
  my_led:
    number: 7   # the exact number format depends on your platform

For WS2812 LEDs use type: grb (WS2811 does not need this):

lights:
  my_ws2812_led:
    number: 23  # the exact number format depends on your platform
    type: grb
This example is tested to be valid MPF config. However, it is not integration tested.
lights:
  my_ws2812_led:
    number: 23  # the exact number format depends on your platform
    type: grb

You can also map individual color channels:

lights:
  rgb_led:
    type: rgb
    channels:
      red:
        number: 9-29     # the exact number format depends on your platform
      green:
        number: 9-30
      blue:
        number: 9-31
      white:
        number: 9-32
This example is tested to be valid MPF config. However, it is not integration tested.
lights:
  rgb_led:
    type: rgb
    channels:
      red:
        number: 9-29     # the exact number format depends on your platform
      green:
        number: 9-30
      blue:
        number: 9-31
      white:
        number: 9-32

Starting with MPF 0.54 there is a new syntax to chain lights:

lights:
  led_0:
    start_channel: 0-0    # the exact number format depends on your platform
    subtype: led
    type: rgb    # will use red: 0-0, green: 0-1, blue: 0-2
  led_1:
    previous: led_0
    subtype: led
    type: rgbw   # will use red: 0-3, green: 0-4, blue: 0-5, white: 0-6
  led_2:
    previous: led_1
    subtype: led
    type: rgbw   # will use red: 0-7, green: 0-8, blue: 0-9, white: 0-10
This example is tested to be valid MPF config. However, it is not integration tested.
lights:
  led_0:
    start_channel: 0-0    # the exact number format depends on your platform
    subtype: led
    type: rgb    # will use red: 0-0, green: 0-1, blue: 0-2
  led_1:
    previous: led_0
    subtype: led
    type: rgbw   # will use red: 0-3, green: 0-4, blue: 0-5, white: 0-6
  led_2:
    previous: led_1
    subtype: led
    type: rgbw   # will use red: 0-7, green: 0-8, blue: 0-9, white: 0-10

If your light is connected to a driver use this example:

coils:
  light_connected_to_a_driver:
    number: 42          # number depends on your platform
    allow_enable: true  # this will allow 100% enable without pwm
lights:
  light_on_a_driver:
    number: light_connected_to_a_driver  # map this light to a driver
    platform: drivers
This example is tested to be valid MPF config. However, it is not integration tested.
coils:
  light_connected_to_a_driver:
    number: 42          # number depends on your platform
    allow_enable: true  # this will allow 100% enable without pwm
lights:
  light_on_a_driver:
    number: light_connected_to_a_driver  # map this light to a driver
    platform: drivers

Monitorable Properties

For dynamic values and conditional events, the prefix for lights is device.lights.<name>.

brightness
The numeric value of the brightness of this light, from 0-255.
color
The current color.