Site updated at 2018-01-27 05:27:50 UTC
This commit is contained in:
parent
0e5bccf933
commit
d499361ff7
853 changed files with 12458 additions and 2552 deletions
|
@ -161,6 +161,14 @@
|
|||
<span class="s">domain</span><span class="pi">:</span> <span class="s">light</span>
|
||||
</code></pre>
|
||||
</div>
|
||||
<p>You can also use event_data_template to fire an event with custom data. This could be used to pass data to another script awaiting
|
||||
an event trigger.</p>
|
||||
<div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="s">event</span><span class="pi">:</span> <span class="s">MY_EVENT</span>
|
||||
<span class="s">event_data_template</span><span class="pi">:</span>
|
||||
<span class="s">name</span><span class="pi">:</span> <span class="s">myEvent</span>
|
||||
<span class="s">customData</span><span class="pi">:</span> <span class="s2">"</span><span class="s">{{</span><span class="nv"> </span><span class="s">myCustomVariable</span><span class="nv"> </span><span class="s">}}"</span>
|
||||
</code></pre>
|
||||
</div>
|
||||
<h3><a class="title-link" name="raise-and-consume-custom-events" href="#raise-and-consume-custom-events"></a> Raise and Consume Custom Events</h3>
|
||||
<p>The following automation shows how to raise a custom event called <code class="highlighter-rouge">event_light_turned_on</code> with <code class="highlighter-rouge">entity_id</code> as the event data. The action part could be inside a script or an automation.</p>
|
||||
<div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="pi">-</span> <span class="s">alias</span><span class="pi">:</span> <span class="s">Fire Event</span>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue