mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-16 22:06:50 +00:00
show a template switch example for harmony (#1548)
* show a template switch example * Update remote.harmony.markdown
This commit is contained in:
parent
6a334dc008
commit
afdaee8f57
@ -60,6 +60,22 @@ Supported services:
|
||||
|
||||
### {% linkable_title Examples %}
|
||||
|
||||
A template switch can be used to display and control the state of an activity in the frontend.
|
||||
|
||||
```yaml
|
||||
switch:
|
||||
- platform: template
|
||||
switches:
|
||||
tv:
|
||||
value_template: "{% raw %}{% if is_state('remote.family_room', 'on') %}on{% else %}off{% endif %}{% endraw %}"
|
||||
turn_on:
|
||||
service: remote.turn_on
|
||||
entity_id: remote.family_room
|
||||
turn_off:
|
||||
service: remote.turn_off
|
||||
entity_id: remote.family_room
|
||||
```
|
||||
|
||||
Template sensors can be utilized to display current activity in the frontend.
|
||||
|
||||
```yaml
|
||||
|
Loading…
x
Reference in New Issue
Block a user