Skip to content

Commit 856a5d7

Browse files
authored
initial commit
1 parent 77df8d0 commit 856a5d7

1 file changed

Lines changed: 73 additions & 0 deletions

File tree

info.md

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
Provides a means to program a Lovelace button row to control any binary entity (lights, switches, input booleans, etc) that have the state as either on or off. This will also work for fans and dimmable lights that you would only ever like to switch on & off with a single speed or brightness setting (set outside the configuration for this plugin)
2+
3+
This plug-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 & light brightness preset row.
4+
5+
Installation:
6+
7+
Copy the binary-control-button-row.js file to the appropriate folder in your Home Assistant Configuration directory (/config/www/).
8+
9+
Place the following in your "resources" section in your lovelace configuration (updating the localation to where you placed the above file):
10+
11+
```
12+
- url: /local/binary-control-button-preset-row.js
13+
type: js
14+
```
15+
16+
Then to use this in a card place the following in your entity card:
17+
18+
19+
<b>Options:</b>
20+
21+
| Name | Type | Required | Default | Description |
22+
| --- | --- | --- | --- | --- |
23+
| entity | String | Yes | none | any binary (on/off) entity_id |
24+
| type | String | Yes | none | custom:binary-control-button-row |
25+
| name | String | No | none | A custom name for the entity in the row |
26+
| customTheme | Boolean | No | false | set to true to use a custom theme |
27+
| IsOffColor | String | No | '#f44c09' | Sets the color of the 'Off' button if entity is off |
28+
| IsOnColor | String | No | '#43A047' | Sets the color of the 'Low' button if entity is on low |
29+
| ButtonInactiveColor | String | No | '#759aaa' | Sets the color of the the buttons if that selection is not "active" |
30+
31+
The values for the colors can be any valid color string in "HEX", "RGB" or by color name.
32+
33+
<b>Configuration Examples:</b>
34+
35+
```
36+
cards:
37+
- type: entities
38+
title: Binary Buttons
39+
show_header_toggle: false
40+
entities:
41+
## USE THIS CONFIG TO HAVE IT MATCH YOUR THEME ##
42+
- type: custom:binary-control-button-row
43+
name: Basement Bath Default Button Row
44+
entity: light.sengled_e11g13_03070a4c_1
45+
customTheme: false
46+
## USE THIS CONFIG TO USE A DEFAULT CUSTOM THEME
47+
- type: custom:binary-control-button-row
48+
name: Basement Bath Custom Button Row
49+
entity: light.basement_bath_light
50+
customTheme: true
51+
## USE THIS CONFIG TO USE A 'CUSTOMZED' CUSTOM THEME
52+
- type: custom:binary-control-button-row
53+
name: Basement Bath Customized Button Row
54+
entity: light.sengled_e11g13_03070a4c_1
55+
customTheme: true
56+
IsOnColor: 'rgb(255, 0, 0)'
57+
IsOffColor: 'purple'
58+
ButtonInactiveColor: '#aaaaaa'
59+
60+
```
61+
62+
This is with the default Lovelace frontend theme set:
63+
64+
![Default](button-row-default-example.gif)
65+
66+
67+
This is with the "Slate" frontend theme set:
68+
69+
![Slate](button-row-example.gif)
70+
71+
this is how this plugin looks with the Fan control & Light Brightness Rows:
72+
73+
![Slate-Compare](button-row-example-compare.gif)

0 commit comments

Comments
 (0)