You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Update Harmony Remote markdown
Added a send_command service example
* Update remote.harmony.markdown
Added {% raw %} {% endraw %} around template code as requested
Copy file name to clipboardExpand all lines: source/_components/remote.harmony.markdown
+35Lines changed: 35 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -116,3 +116,38 @@ automation:
116
116
service: input_boolean.turn_off
117
117
entity_id: input_boolean.notify
118
118
````
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 %}
0 commit comments