Skip to content
Provides a means to program 3 preset brightness settings for dimmable lights
Branch: master
Clone or download
Latest commit c375495 Jan 18, 2020
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
dist Create light-brightness-preset-row.js Dec 10, 2019
README.md spelling Jan 18, 2020
ex2.gif Add files via upload Dec 10, 2019
ex3.gif Add files via upload Dec 10, 2019
hacs.json Update hacs.json Jan 12, 2020
info.md added config examples Jan 18, 2020

README.md

light-brightness-preset-row

Provides a means to program 3 preset brightness settings for dimmable lights selectable from a Lovelace button row.

This pluig-in was inspired by user @jazzyisj on the Home Assistant forum (community.home-assistant.io) as a thematically complementary plug-in for my fan control row.

Installation:

Copy the light-brightness-preset-row.js file to the appropriate folder in your Home Assistant Configuration directory (/config/www/).

Place the following in your "resources" section in your lovelace configuration (updating the localation to where you placed the above file):

  - url: /local/light-brightness-preset-row.js
    type: js

Then to use this in a card place the following in your entity card:

Options:

Name Type Required Default Description
entity String Yes none a dimmable light entity_id
type String Yes none custom:light-brightness-entity-row
name String No none A custom name for the entity in the row
customTheme Boolean No false set to true to use a custom theme
customSetpoints Boolean No false set to true to use custom brightness setpoints
IsOffColor String No '#f44c09' Sets the color of the 'Off' button if light is off
IsOnLowColor String No '#43A047' Sets the color of the 'Low' button if light is on low
IsOnMedColor String No '#43A047' Sets the color of the 'Med' button if light is on Medium
IsOnHiColor String No '#43A047' Sets the color of the 'Hi' button if light is on high
ButtonInactiveColor String No '#759aaa' Sets the color of the the buttons if that selection is not "active"
LowBrightness Integer No 43 Sets the brighness level for the "Low" button (valid range: 0 - 85)
MedBrightness Integer No 128 Sets the brighness level for the "Med" button (valid range: 86 - 170)
HiBrightness Integer No 213 Sets the brighness level for the "High" button (valid range: 171 - 255)

The values for the colors can be any valid color string in "HEX", "RGB" or by color name.

If the light brightness is changed via any other means (slider, service call, etc) the buttons will indicate which range the light brightness is in based on the "valid Range" settings noted above.

Configuration Examples:

  cards:
    - type: entities
      title: Hall Light Presets
      show_header_toggle: false
      entities:
      ## USE THIS CONFIG TO HAVE IT MATCH YOUR THEME ##
        - entity: light.hall_light
          type: custom:light-brightness-preset-row
          name: Light Not Custom Theme
          customTheme: false
      ## USE THIS CONFIG TO USE A DEFAULT CUSTOM THEME
        - entity: light.hall_light
          type: custom:light-brightness-preset-row
          name: Light Default Custom Theme
          customTheme: true
          customSetpoints: true
          LowBrightness: 30
          MedBrightness: 100
          HiBrightness: 225
      ## USE THIS CONFIG TO USE A 'CUSTOMZED' CUSTOM THEME
        - entity: light.hall_light
          type: custom:light-brightness-preset-row
          name: Light Custom Custom Theme
          customTheme: true
          IsOnLowColor: 'rgb(255, 0, 0)'
          IsOnMedColor: '#888888'
          IsOnHiColor: '#222222'
          ButtonInactiveColor: '#aaaaaa'
          IsOffColor: 'purple'
          

This is with the default Lovelace frontend theme set:

Default

This is with the "Slate" frontend theme set:

Slate

You can’t perform that action at this time.