Skip to content

Template Light Platform documentation#2661

Merged
emlove merged 6 commits into
home-assistant:nextfrom
cribbstechnologies:light-template
May 24, 2017
Merged

Template Light Platform documentation#2661
emlove merged 6 commits into
home-assistant:nextfrom
cribbstechnologies:light-template

Conversation

@cribbstechnologies
Copy link
Copy Markdown
Contributor

Description:
The Light platform analog to the Template Switch

Pull request in home-assistant (if applicable): home-assistant/core#7657

theater_volume:
friendly_name: 'Receiver Volume'
value_template: >-
{%- if is_state("media_player.receiver", "on") -%}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

To avoid render of the template, use {% raw %}{{your_template}}{% endraw %}.

To enable Template lights in your installation, add the following to your `configuration.yaml` file:

```yaml
# Example configuration.yaml entry
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This example doesn't seem to have anything todo with lights?


The `template` platform creates lights that combine components.

For example, if you have a garage door with a toggle switch that operates the motor and a sensor that allows you know whether the door is open or closed, you can combine these into a switch that knows whether the garage door is open or closed. If your garage door also has the ability to where you can set its position, you can bind the `set_level` command to a script or service and capture the brightness variable and manipulate it before sending it to your script or service.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Template light and example is for a garage door?


```yaml
# Example configuration.yaml entry
light:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

A simpler example for users getting started could be preferable and having the advanced one as an option after the configuration variables.

@Landrash Landrash added the new-integration This PR adds documentation for a new Home Assistant integration label May 19, 2017
Copy link
Copy Markdown
Contributor

@Landrash Landrash left a comment

Choose a reason for hiding this comment

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

Looks good and can be merged when parent PR is merged.


The `template` platform creates lights that combine components.

This provides pretty much the same functionality as a [template switch](/components/switch.template/) with the exception is that you can pass brightness commands through.
Copy link
Copy Markdown
Contributor

@emlove emlove May 22, 2017

Choose a reason for hiding this comment

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

I'd rewrite this paragraph assuming the user hasn't yet read about template switches. Just describe what this platform will do here. You can keep a link at the end, or in a see also section, but this page should stand alone.

- **turn_off** (*Required*): Defines an [action](/getting-started/automation/) to run when the light is turned off.
- **set_level** (*Optional*): Defines an [action](/getting-started/automation/) to run when the light is given a brightness command.
- **level_template** (*Optional): Defines a [template](/topics/templating/) to get the brightness of the light. If not provided the component defaults to optimisitc brightness determination.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

entity_id is missing here. It can be copied from the template switch docs.

@cribbstechnologies
Copy link
Copy Markdown
Contributor Author

cribbstechnologies commented May 24, 2017 via email

@emlove emlove merged commit 264fe45 into home-assistant:next May 24, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

new-integration This PR adds documentation for a new Home Assistant integration

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants