Site updated at 2015-12-19 17:29:41 UTC

This commit is contained in:
Paulus Schoutsen 2015-12-19 09:29:41 -08:00
parent 5ddb1dac36
commit 45020579c3
259 changed files with 5974 additions and 4067 deletions

View file

@ -23,7 +23,8 @@
<meta property="og:image" content="https://home-assistant.io/images/home-assistant-logo-2164x2164.png">
<meta name="twitter:card" content="summary">
<meta name="twitter:site" content="@balloob">
<meta name="twitter:site" content="@home_assistant">
<meta name="twitter:title" content="MQTT switch">
<meta name="twitter:description" content="Instructions how to integrate MQTT switches into Home Assistant.">
<meta name="twitter:image" content="https://home-assistant.io/images/home-assistant-logo-2164x2164.png">
@ -104,7 +105,9 @@
</header>
<hr class="divider">
<p>In an ideal scenario, the MQTT device will have a state topic to publish state changes. If these messages are published with RETAIN flag, the MQTT switch will receive an instant state update after subscription and will start with correct state. Otherwise, the initial state of the switch will be false/off.</p>
<p>The <code>mqtt</code> switch platform let you control your MQTT enabled light.</p>
<p>In an ideal scenario, the MQTT device will have a state topic to publish state changes. If these messages are published with RETAIN flag, the MQTT switch will receive an instant state update after subscription and will start with correct state. Otherwise, the initial state of the switch will be false/off.</p>
<p>When a state topic is not available, the switch will work in optimistic mode. In this mode, the switch will immediately change state after every command. Otherwise, the switch will wait for state confirmation from device (message from <code>state_topic</code>).</p>
@ -123,7 +126,7 @@
<span class="key">payload_on</span>: <span class="string"><span class="delimiter">&quot;</span><span class="content">ON</span><span class="delimiter">&quot;</span></span>
<span class="key">payload_off</span>: <span class="string"><span class="delimiter">&quot;</span><span class="content">OFF</span><span class="delimiter">&quot;</span></span>
<span class="key">optimistic</span>: <span class="string"><span class="content">false</span></span>
<span class="key">state_format</span>:
<span class="key">value_template</span>: <span class="string"><span class="content">'{{ value.x }}'</span></span>
</pre></div>
</div>
</div>
@ -138,7 +141,7 @@
<li><strong>payload_on</strong> (<em>Optional</em>): The payload that represents enabled state. Default is “ON”.</li>
<li><strong>payload_off</strong> (<em>Optional</em>): The payload that represents disabled state. Default is “OFF”.</li>
<li><strong>optimistic</strong> (<em>Optional</em>): Flag that defines if switch works in optimistic mode. Default is true if no state topic defined, else false.</li>
<li><strong>state_format</strong> (<em>Optional</em>): Value to parse.</li>
<li><strong>value_template</strong> (<em>Optional</em>): Defines a <a href="/getting-started/templating/">template</a> to extract a value from the payload.</li>
</ul>
<p class="note warning">
@ -251,9 +254,15 @@
<div class="grid-wrapper">
<div class="grid">
<div class="grid__item">
<p class="copyright">
<span class="credit">Powered by <a href='http://jekyllrb.com/'>Jekyll</a> and the <a href='https://github.com/coogie/oscailte'>Oscalite theme</a>. Hosted by <a href='https://pages.github.com/'>GitHub</a> and served by <a href='https://cloudflare.com'>CloudFlare</a>.</span>
</p>
<div class="copyright">
<a rel="me" href='https://twitter.com/home_assistant'><i class="icon-twitter"></i></a>
<a rel="me" href='https://github.com/balloob/home-assistant'><i class="icon-github"></i></a>
<div class="credit">
Website powered by <a href='http://jekyllrb.com/'>Jekyll</a> and the <a href='https://github.com/coogie/oscailte'>Oscalite theme</a>.<br />
Hosted by <a href='https://pages.github.com/'>GitHub</a> and served by <a href='https://cloudflare.com'>CloudFlare</a>.
</div>
</div>
</div>
</div>
</div>