Home Home Assistant : Lights
Post
Cancel
Preview Image

Home Assistant : Lights

Lights in our house come in several forms:

  • Philips Hue LED lamps
  • Innr LED lamps
  • LED strip uplights & LED lights switched by Sonoff Basic modules
  • Twig lights plugged into smart plugs

Change Switch to a Light (Switch as X)

Grouping lights (see next item) is useful to be able to issue one command, e.g. “Alexa all lights off”, rather than doing elements individually. We also wanted to switch other light items off, but these were actually set on/off by switches, and were identified in Home Assistant as a switch. The Switch as X helper allows a switch to be re-categorised as a light so it can be added to a light group.

  • Changing an entity type (switch becomes a light) [guide]
    • Go to Settings -> Devices & Services, click Helpers tab
    • Click +Create Helper, select Switch as X from list
    • Select entity, e.g. kitchen_leds_relay, select Light as new type, click Submit
    • The switch version of the entity will be hidden, the light version created
    • The entity can then be used as a light

Group Lights as Single Entity

  • Go to Settings -> Devices & Services, click Helpers tab
  • Click +Create Helper, select Group from list, select Light group from list
  • Enter new entity name, e.g. All lights
  • Add each entity required to members
  • Click Submit

Dashboard Light Buttons

The current dashboard uses custom-button cards to provide a toggle function with a visual indication of the lights state. The underlying YAML code is as follows:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
type: custom:button-card
entity: light.lounge
state:
  - value: 'off'
    icon: mdi:lightbulb-outline
    color: gray
  - value: 'on'
    icon: mdi:lightbulb-on
    color: orange
size: 50%
style: |
  ha-card {
    font-size: 1em !important;
    }

and a blank light (not yet assigned) is configured as:

1
2
3
4
5
6
7
8
9
type: custom:button-card
name: blank
icon: mdi:lightbulb-off-outline
color: gray
size: 50%
style: |
  ha-card {
    font-size: 1em !important;
    }
This post is licensed under CC BY 4.0 by the author.
Recently Updated
Trending Tags
Contents
Trending Tags