Skip to content

Dim (and brighten) lights via a remote #3309

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

Merged
merged 3 commits into from
Sep 5, 2017
Merged

Dim (and brighten) lights via a remote #3309

merged 3 commits into from
Sep 5, 2017

Conversation

DubhAd
Copy link
Contributor

@DubhAd DubhAd commented Sep 4, 2017

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.

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.
Copy link
Member

@dale3h dale3h left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The configuration appears that it would work, but I have requested a few minor changes to keep things politically correct.

entity_id: zwave.YOURCONTROLLER
action:
- service: script.turn_on
data_template:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please change to data: since data_template: is not required here.

entity_id: zwave.YOURCONTROLLER
action:
- service: script.turn_off
data_template:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

data_template is not required here either.

data_template:
entity_id: script.light_bright
- service: script.turn_off
data_template:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nor here.

entity_id: zwave.YOURCONTROLLER
action:
- service: script.turn_on
data_template:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Annnnd here.

entity_id: zwave.YOURCONTROLLER
action:
- service: script.turn_off
data_template:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here.

data_template:
entity_id: script.light_dim
- service: script.turn_off
data_template:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And I think this is the last one :)

entity_id: light.YOURLIGHT
brightness: >
{% set current = states.light.YOURLIGHT.attributes.brightness | int %}
{% set step = states.input_slider.light_step.state |int %}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For consistency, please either remove the spaces around | characters (my personal preference), or add a single space after this one.

Replacing pointless data_templates with just data, complying with preferred formatting standards ;)
Copy link
Member

@dale3h dale3h left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think these are the last two changes!

@@ -115,11 +115,11 @@ script:
data_template:
entity_id: light.YOURLIGHT
brightness: >
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a hyphen/minus (-) after the > here to tell YAML to trim leading and trailing whitespace.

@@ -141,11 +141,11 @@ script:
data_template:
entity_id: light.YOURLIGHT
brightness: >
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a hyphen/minus (-) after the > here to tell YAML to trim leading and trailing whitespace.

More fixes ;)
@dale3h dale3h merged commit 21ca7ad into home-assistant:current Sep 5, 2017
@dale3h
Copy link
Member

dale3h commented Sep 5, 2017

This PR is currently causing Travis CI to fail on rebuild of the website:

Liquid Exception: Liquid syntax error (line 106): Unknown tag 'set' in /home/travis/build/home-assistant/home-assistant.github.io/source/_cookbook/dim_and_brighten_lights.markdown

@dale3h
Copy link
Member

dale3h commented Sep 5, 2017

Reverting until a solution is found.

dale3h added a commit that referenced this pull request Sep 5, 2017
dale3h added a commit that referenced this pull request Sep 5, 2017
* Revert "Remove "Changing the icon" (#3305)"

This reverts commit 6ae0daf.

* Revert "Minor clarification in USPS component (#3316)"

This reverts commit 3c6ff37.

* Revert "Update rss_feed_template.markdown (#3314)"

This reverts commit 6e154db.

* Revert "Dim (and brighten) lights via a remote (#3309)"

This reverts commit 21ca7ad.
@dale3h
Copy link
Member

dale3h commented Sep 6, 2017

@DubhAd Will you please wrap the templates with {% raw %}Your template {{ stuff }}{% endraw %} and submit a new PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants