Skip to content

Commit e6ee1f5

Browse files
Phileepfabaff
authored andcommitted
Update Harmony Remote markdown (home-assistant#1662)
* Update Harmony Remote markdown Added a send_command service example * Update remote.harmony.markdown Added {% raw %} {% endraw %} around template code as requested
1 parent 86c3e7e commit e6ee1f5

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

source/_components/remote.harmony.markdown

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,3 +116,38 @@ automation:
116116
service: input_boolean.turn_off
117117
entity_id: input_boolean.notify
118118
````
119+
120+
The automation example below shows how to send a command via the harmony remote using the `send_command` service to send the 'Pause' command to the hub, which is already defined as an IR code for each device to be used via the Harmony app. It is checking for the activity name as exposed through the sensor in the harmony remote component using Jinga if statements to set the device_id, sending the correct Pause command for the given activity. This requires checking your activity list and device_id from the `harmony_REMOTENAME.conf` file created when you start the component. In this example, the harmony hub is named bedroom.
121+
```yaml
122+
automation:
123+
- alias: Harmony Pause contextual for activity
124+
trigger:
125+
# trigger happens to be from a flic button - could be any valid event
126+
platform: event
127+
event_type: flic_click
128+
event_data:
129+
button_name: flic_80e4da70bbb1
130+
click_type: double
131+
action:
132+
service: remote.send_command
133+
data_template:
134+
# using a data template to have if brances for relavant device
135+
# Always the same entity_id - the harmony hub
136+
entity_id: remote.bedroom
137+
# Always the same command - the Pause key
138+
command: Pause
139+
# select device based upon the activity being undertaken.
140+
device: >
141+
# when in WATCH TV activity, the pause key relates to a TiVo, which is device 22987101
142+
{% raw %}{% if is_state("sensor.bedroom", "WATCH TV") %}{% raw %}
143+
22987101
144+
# when in WATCH APPLE TV activity, the pause key relates to an Apple TV, which is device 23002316
145+
{% raw %}{% elif is_state("sensor.bedroom", "WATCH APPLE TV") %}{% endraw %}
146+
23002316
147+
{% raw %}{% elif is_state("sensor.bedroom", "PLEX") %}{% endraw %}
148+
23048786
149+
{% raw %}{% elif is_state("sensor.bedroom", "WATCH BLU RAY") %}{% endraw %}
150+
23043122
151+
{% raw %}{% endif %}{% endraw %}
152+
153+
````

0 commit comments

Comments
 (0)