-
-
Notifications
You must be signed in to change notification settings - Fork 7.7k
Dim (and brighten) lights via a remote #3319
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Hopefully this one won't break everything ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do apologize for the strict formatting change requests, but I just want to make sure that all docs moving forward do not require as many changes when standards are put into place.
ha_category: Automation Examples | ||
--- | ||
|
||
This requires both a light on a dimmer, and a z-wave remote control that sends one scene when a button is held, and another when released. This ensures that the scripts (which follow) are stopped, avoiding the risks of a script that never ends. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am working on implementing a set of standards for our documentation as to provide consistency and reduce confusion, while also improving a professional appearance to our users. Part of this will include proper casing of brands, names, protocols, services, etc.
- Change "z-wave" -> "Z-Wave"
- Change "a light on a dimmer" -> "a dimmable light"
|
||
There are 2 variables that control the speed of the change for the scripts below. The first is the `step` - small steps create a smooth transition. The second is the delay, larger delays will create a slower transition. | ||
|
||
To allow flexibility, we'll use an input_slider for the step (at the time of writing this, it's not possible to template the delay when the delay uses milliseconds). We're also using a slider to set the minimum and maximum brightness, so that it's easy to tune that (or manage it through an automation). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- "we'll use an input_slider" -> "an [Input Slider](/components/input_slider/) is used"
- "We're also using a slider" -> "Two additional [Input Sliders](/components/input_slider/) are used"
entity_id: light.YOURLIGHT | ||
brightness: >- | ||
{% raw %}{% set current = (states.light.YOURLIGHT.attributes|default).brightness|default(0)|int %} | ||
{% set step = states.input_slider.light_step.states|int %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
states.input_slider.light_step.states|int
-> states('input_slider.light_step')|int
There are 5 more lines similar to this that need to be changed as well.
data_template: | ||
entity_id: light.YOURLIGHT | ||
brightness: >- | ||
{% raw %}{% set current = (states.light.YOURLIGHT.attributes|default).brightness|default(0)|int %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To help prevent confusion, please remove the default
filter from attributes
. Also, please update all occurrences of YOURLIGHT
to YOUR_LIGHT
. (May as well do this with YOURCONTROLLER
-> YOUR_REMOTE
as well)
(states.light.YOURLIGHT.attributes|default).brightness|default(0)|int
-> states.light.YOUR_LIGHT.attributes.brightness|default(0)|int
sequence: | ||
- service: light.turn_on | ||
data_template: | ||
entity_id: light.YOURLIGHT |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
YOURLIGHT
-> YOUR_LIGHT
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@DubhAd Could you please correct those?
ha_category: Automation Examples | ||
--- | ||
|
||
This requires both a a dimmable light, and a Z-Wave remote control that sends one scene when a button is held, and another when released. This ensures that the scripts (which follow) are stopped, avoiding the risks of a script that never ends. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Spelling & Grammar:
both a a dimmable light
->both a dimmable light
|
||
This requires both a a dimmable light, and a Z-Wave remote control that sends one scene when a button is held, and another when released. This ensures that the scripts (which follow) are stopped, avoiding the risks of a script that never ends. | ||
|
||
In the following automation, replace `zwave.YOUR_REMOTE` with the actual entity ID of your controller. For the controller this was written for scene ID 13 was sent when the up button was held, and 15 when released. Similarly scene 14 when the down button was held, and 16 when released. You'll need to use the scene IDs that are sent by your remote if different. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Spelling & Grammar:
- Missing comma after
Similarly
->Similarly, scene 14
entity_id: script.light_dim_pause | ||
``` | ||
|
||
There are 2 variables that control the speed of the change for the scripts below. The first is the `step` - small steps create a smooth transition. The second is the delay, larger delays will create a slower transition. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Spelling & Grammar:
- Two independent parts joined by a comma:
The second is the delay, larger delays will create a slower transition.
->The second is the delay. Larger delays will create a slower transition.
step: 1 | ||
``` | ||
|
||
Now the scripts. There are 2 pairs of scripts. The first steps the light brighter to the maximum, and the second provides the delay. These call each other until both are stopped. The second pair do the same for dimming. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Spelling & Grammar:
- Unnecessary comma:
maximum, and
->maximum and
do the same
->does the same
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hopefully this one won't break everything ;)
As per chat in the Discord, these are the scripts, automations, and input_sliders to allow a light to be dimmed and brightened by holding down the down or up button on an appropriate remote.
This has been extended to use input_sliders for the dim/brighten step, and for the minimum and maximum brightness levels. The defaults have been set based upon DariBer's experience, so they should be close to "right" for others.