Site updated at 2018-01-27 19:39:56 UTC

This commit is contained in:
Travis CI 2018-01-27 19:39:56 +00:00
parent 50afaf1c94
commit 53a7f38cfc
28 changed files with 121 additions and 67 deletions

View file

@ -4,7 +4,7 @@
<title><![CDATA[Home Assistant]]></title> <title><![CDATA[Home Assistant]]></title>
<link href="https://home-assistant.io/atom.xml" rel="self"/> <link href="https://home-assistant.io/atom.xml" rel="self"/>
<link href="https://home-assistant.io/"/> <link href="https://home-assistant.io/"/>
<updated>2018-01-27T17:19:32+00:00</updated> <updated>2018-01-27T19:30:30+00:00</updated>
<id>https://home-assistant.io/</id> <id>https://home-assistant.io/</id>
<author> <author>
<name><![CDATA[Home Assistant]]></name> <name><![CDATA[Home Assistant]]></name>

View file

@ -4,7 +4,7 @@
<title><![CDATA[Category: Announcements | Home Assistant]]></title> <title><![CDATA[Category: Announcements | Home Assistant]]></title>
<link href="https://home-assistant.io/blog/categories/announcements/atom.xml" rel="self"/> <link href="https://home-assistant.io/blog/categories/announcements/atom.xml" rel="self"/>
<link href="https://home-assistant.io/"/> <link href="https://home-assistant.io/"/>
<updated>2018-01-27T17:19:32+00:00</updated> <updated>2018-01-27T19:30:30+00:00</updated>
<id>https://home-assistant.io/</id> <id>https://home-assistant.io/</id>
<author> <author>
<name><![CDATA[Home Assistant]]></name> <name><![CDATA[Home Assistant]]></name>

View file

@ -4,7 +4,7 @@
<title><![CDATA[Category: Community | Home Assistant]]></title> <title><![CDATA[Category: Community | Home Assistant]]></title>
<link href="https://home-assistant.io/blog/categories/community/atom.xml" rel="self"/> <link href="https://home-assistant.io/blog/categories/community/atom.xml" rel="self"/>
<link href="https://home-assistant.io/"/> <link href="https://home-assistant.io/"/>
<updated>2018-01-27T17:19:32+00:00</updated> <updated>2018-01-27T19:30:30+00:00</updated>
<id>https://home-assistant.io/</id> <id>https://home-assistant.io/</id>
<author> <author>
<name><![CDATA[Home Assistant]]></name> <name><![CDATA[Home Assistant]]></name>

View file

@ -4,7 +4,7 @@
<title><![CDATA[Category: Device-Tracking | Home Assistant]]></title> <title><![CDATA[Category: Device-Tracking | Home Assistant]]></title>
<link href="https://home-assistant.io/blog/categories/device-tracking/atom.xml" rel="self"/> <link href="https://home-assistant.io/blog/categories/device-tracking/atom.xml" rel="self"/>
<link href="https://home-assistant.io/"/> <link href="https://home-assistant.io/"/>
<updated>2018-01-27T17:19:32+00:00</updated> <updated>2018-01-27T19:30:30+00:00</updated>
<id>https://home-assistant.io/</id> <id>https://home-assistant.io/</id>
<author> <author>
<name><![CDATA[Home Assistant]]></name> <name><![CDATA[Home Assistant]]></name>

View file

@ -4,7 +4,7 @@
<title><![CDATA[Category: ESP8266 | Home Assistant]]></title> <title><![CDATA[Category: ESP8266 | Home Assistant]]></title>
<link href="https://home-assistant.io/blog/categories/esp8266/atom.xml" rel="self"/> <link href="https://home-assistant.io/blog/categories/esp8266/atom.xml" rel="self"/>
<link href="https://home-assistant.io/"/> <link href="https://home-assistant.io/"/>
<updated>2018-01-27T17:19:32+00:00</updated> <updated>2018-01-27T19:30:30+00:00</updated>
<id>https://home-assistant.io/</id> <id>https://home-assistant.io/</id>
<author> <author>
<name><![CDATA[Home Assistant]]></name> <name><![CDATA[Home Assistant]]></name>

View file

@ -4,7 +4,7 @@
<title><![CDATA[Category: How-To | Home Assistant]]></title> <title><![CDATA[Category: How-To | Home Assistant]]></title>
<link href="https://home-assistant.io/blog/categories/how-to/atom.xml" rel="self"/> <link href="https://home-assistant.io/blog/categories/how-to/atom.xml" rel="self"/>
<link href="https://home-assistant.io/"/> <link href="https://home-assistant.io/"/>
<updated>2018-01-27T17:19:32+00:00</updated> <updated>2018-01-27T19:30:30+00:00</updated>
<id>https://home-assistant.io/</id> <id>https://home-assistant.io/</id>
<author> <author>
<name><![CDATA[Home Assistant]]></name> <name><![CDATA[Home Assistant]]></name>

View file

@ -4,7 +4,7 @@
<title><![CDATA[Category: iBeacons | Home Assistant]]></title> <title><![CDATA[Category: iBeacons | Home Assistant]]></title>
<link href="https://home-assistant.io/blog/categories/ibeacons/atom.xml" rel="self"/> <link href="https://home-assistant.io/blog/categories/ibeacons/atom.xml" rel="self"/>
<link href="https://home-assistant.io/"/> <link href="https://home-assistant.io/"/>
<updated>2018-01-27T17:19:32+00:00</updated> <updated>2018-01-27T19:30:30+00:00</updated>
<id>https://home-assistant.io/</id> <id>https://home-assistant.io/</id>
<author> <author>
<name><![CDATA[Home Assistant]]></name> <name><![CDATA[Home Assistant]]></name>

View file

@ -4,7 +4,7 @@
<title><![CDATA[Category: Internet-of-Things | Home Assistant]]></title> <title><![CDATA[Category: Internet-of-Things | Home Assistant]]></title>
<link href="https://home-assistant.io/blog/categories/internet-of-things/atom.xml" rel="self"/> <link href="https://home-assistant.io/blog/categories/internet-of-things/atom.xml" rel="self"/>
<link href="https://home-assistant.io/"/> <link href="https://home-assistant.io/"/>
<updated>2018-01-27T17:19:32+00:00</updated> <updated>2018-01-27T19:30:30+00:00</updated>
<id>https://home-assistant.io/</id> <id>https://home-assistant.io/</id>
<author> <author>
<name><![CDATA[Home Assistant]]></name> <name><![CDATA[Home Assistant]]></name>

View file

@ -4,7 +4,7 @@
<title><![CDATA[Category: IoT-Data | Home Assistant]]></title> <title><![CDATA[Category: IoT-Data | Home Assistant]]></title>
<link href="https://home-assistant.io/blog/categories/iot-data/atom.xml" rel="self"/> <link href="https://home-assistant.io/blog/categories/iot-data/atom.xml" rel="self"/>
<link href="https://home-assistant.io/"/> <link href="https://home-assistant.io/"/>
<updated>2018-01-27T17:19:32+00:00</updated> <updated>2018-01-27T19:30:30+00:00</updated>
<id>https://home-assistant.io/</id> <id>https://home-assistant.io/</id>
<author> <author>
<name><![CDATA[Home Assistant]]></name> <name><![CDATA[Home Assistant]]></name>

View file

@ -4,7 +4,7 @@
<title><![CDATA[Category: Media | Home Assistant]]></title> <title><![CDATA[Category: Media | Home Assistant]]></title>
<link href="https://home-assistant.io/blog/categories/media/atom.xml" rel="self"/> <link href="https://home-assistant.io/blog/categories/media/atom.xml" rel="self"/>
<link href="https://home-assistant.io/"/> <link href="https://home-assistant.io/"/>
<updated>2018-01-27T17:19:32+00:00</updated> <updated>2018-01-27T19:30:30+00:00</updated>
<id>https://home-assistant.io/</id> <id>https://home-assistant.io/</id>
<author> <author>
<name><![CDATA[Home Assistant]]></name> <name><![CDATA[Home Assistant]]></name>

View file

@ -4,7 +4,7 @@
<title><![CDATA[Category: Merchandise | Home Assistant]]></title> <title><![CDATA[Category: Merchandise | Home Assistant]]></title>
<link href="https://home-assistant.io/blog/categories/merchandise/atom.xml" rel="self"/> <link href="https://home-assistant.io/blog/categories/merchandise/atom.xml" rel="self"/>
<link href="https://home-assistant.io/"/> <link href="https://home-assistant.io/"/>
<updated>2018-01-27T17:19:32+00:00</updated> <updated>2018-01-27T19:30:30+00:00</updated>
<id>https://home-assistant.io/</id> <id>https://home-assistant.io/</id>
<author> <author>
<name><![CDATA[Home Assistant]]></name> <name><![CDATA[Home Assistant]]></name>

View file

@ -4,7 +4,7 @@
<title><![CDATA[Category: Micropython | Home Assistant]]></title> <title><![CDATA[Category: Micropython | Home Assistant]]></title>
<link href="https://home-assistant.io/blog/categories/micropython/atom.xml" rel="self"/> <link href="https://home-assistant.io/blog/categories/micropython/atom.xml" rel="self"/>
<link href="https://home-assistant.io/"/> <link href="https://home-assistant.io/"/>
<updated>2018-01-27T17:19:32+00:00</updated> <updated>2018-01-27T19:30:30+00:00</updated>
<id>https://home-assistant.io/</id> <id>https://home-assistant.io/</id>
<author> <author>
<name><![CDATA[Home Assistant]]></name> <name><![CDATA[Home Assistant]]></name>

View file

@ -4,7 +4,7 @@
<title><![CDATA[Category: MQTT | Home Assistant]]></title> <title><![CDATA[Category: MQTT | Home Assistant]]></title>
<link href="https://home-assistant.io/blog/categories/mqtt/atom.xml" rel="self"/> <link href="https://home-assistant.io/blog/categories/mqtt/atom.xml" rel="self"/>
<link href="https://home-assistant.io/"/> <link href="https://home-assistant.io/"/>
<updated>2018-01-27T17:19:32+00:00</updated> <updated>2018-01-27T19:30:30+00:00</updated>
<id>https://home-assistant.io/</id> <id>https://home-assistant.io/</id>
<author> <author>
<name><![CDATA[Home Assistant]]></name> <name><![CDATA[Home Assistant]]></name>

View file

@ -4,7 +4,7 @@
<title><![CDATA[Category: Organization | Home Assistant]]></title> <title><![CDATA[Category: Organization | Home Assistant]]></title>
<link href="https://home-assistant.io/blog/categories/organization/atom.xml" rel="self"/> <link href="https://home-assistant.io/blog/categories/organization/atom.xml" rel="self"/>
<link href="https://home-assistant.io/"/> <link href="https://home-assistant.io/"/>
<updated>2018-01-27T17:19:32+00:00</updated> <updated>2018-01-27T19:30:30+00:00</updated>
<id>https://home-assistant.io/</id> <id>https://home-assistant.io/</id>
<author> <author>
<name><![CDATA[Home Assistant]]></name> <name><![CDATA[Home Assistant]]></name>

View file

@ -4,7 +4,7 @@
<title><![CDATA[Category: OwnTracks | Home Assistant]]></title> <title><![CDATA[Category: OwnTracks | Home Assistant]]></title>
<link href="https://home-assistant.io/blog/categories/owntracks/atom.xml" rel="self"/> <link href="https://home-assistant.io/blog/categories/owntracks/atom.xml" rel="self"/>
<link href="https://home-assistant.io/"/> <link href="https://home-assistant.io/"/>
<updated>2018-01-27T17:19:32+00:00</updated> <updated>2018-01-27T19:30:30+00:00</updated>
<id>https://home-assistant.io/</id> <id>https://home-assistant.io/</id>
<author> <author>
<name><![CDATA[Home Assistant]]></name> <name><![CDATA[Home Assistant]]></name>

View file

@ -4,7 +4,7 @@
<title><![CDATA[Category: Presence-Detection | Home Assistant]]></title> <title><![CDATA[Category: Presence-Detection | Home Assistant]]></title>
<link href="https://home-assistant.io/blog/categories/presence-detection/atom.xml" rel="self"/> <link href="https://home-assistant.io/blog/categories/presence-detection/atom.xml" rel="self"/>
<link href="https://home-assistant.io/"/> <link href="https://home-assistant.io/"/>
<updated>2018-01-27T17:19:32+00:00</updated> <updated>2018-01-27T19:30:30+00:00</updated>
<id>https://home-assistant.io/</id> <id>https://home-assistant.io/</id>
<author> <author>
<name><![CDATA[Home Assistant]]></name> <name><![CDATA[Home Assistant]]></name>

View file

@ -4,7 +4,7 @@
<title><![CDATA[Category: Public-Service-Announcement | Home Assistant]]></title> <title><![CDATA[Category: Public-Service-Announcement | Home Assistant]]></title>
<link href="https://home-assistant.io/blog/categories/public-service-announcement/atom.xml" rel="self"/> <link href="https://home-assistant.io/blog/categories/public-service-announcement/atom.xml" rel="self"/>
<link href="https://home-assistant.io/"/> <link href="https://home-assistant.io/"/>
<updated>2018-01-27T17:19:32+00:00</updated> <updated>2018-01-27T19:30:30+00:00</updated>
<id>https://home-assistant.io/</id> <id>https://home-assistant.io/</id>
<author> <author>
<name><![CDATA[Home Assistant]]></name> <name><![CDATA[Home Assistant]]></name>

View file

@ -4,7 +4,7 @@
<title><![CDATA[Category: Release-Notes | Home Assistant]]></title> <title><![CDATA[Category: Release-Notes | Home Assistant]]></title>
<link href="https://home-assistant.io/blog/categories/release-notes/atom.xml" rel="self"/> <link href="https://home-assistant.io/blog/categories/release-notes/atom.xml" rel="self"/>
<link href="https://home-assistant.io/"/> <link href="https://home-assistant.io/"/>
<updated>2018-01-27T17:19:32+00:00</updated> <updated>2018-01-27T19:30:30+00:00</updated>
<id>https://home-assistant.io/</id> <id>https://home-assistant.io/</id>
<author> <author>
<name><![CDATA[Home Assistant]]></name> <name><![CDATA[Home Assistant]]></name>

View file

@ -4,7 +4,7 @@
<title><![CDATA[Category: Survey | Home Assistant]]></title> <title><![CDATA[Category: Survey | Home Assistant]]></title>
<link href="https://home-assistant.io/blog/categories/survey/atom.xml" rel="self"/> <link href="https://home-assistant.io/blog/categories/survey/atom.xml" rel="self"/>
<link href="https://home-assistant.io/"/> <link href="https://home-assistant.io/"/>
<updated>2018-01-27T17:19:32+00:00</updated> <updated>2018-01-27T19:30:30+00:00</updated>
<id>https://home-assistant.io/</id> <id>https://home-assistant.io/</id>
<author> <author>
<name><![CDATA[Home Assistant]]></name> <name><![CDATA[Home Assistant]]></name>

View file

@ -4,7 +4,7 @@
<title><![CDATA[Category: Talks | Home Assistant]]></title> <title><![CDATA[Category: Talks | Home Assistant]]></title>
<link href="https://home-assistant.io/blog/categories/talks/atom.xml" rel="self"/> <link href="https://home-assistant.io/blog/categories/talks/atom.xml" rel="self"/>
<link href="https://home-assistant.io/"/> <link href="https://home-assistant.io/"/>
<updated>2018-01-27T17:19:32+00:00</updated> <updated>2018-01-27T19:30:30+00:00</updated>
<id>https://home-assistant.io/</id> <id>https://home-assistant.io/</id>
<author> <author>
<name><![CDATA[Home Assistant]]></name> <name><![CDATA[Home Assistant]]></name>

View file

@ -4,7 +4,7 @@
<title><![CDATA[Category: Technology | Home Assistant]]></title> <title><![CDATA[Category: Technology | Home Assistant]]></title>
<link href="https://home-assistant.io/blog/categories/technology/atom.xml" rel="self"/> <link href="https://home-assistant.io/blog/categories/technology/atom.xml" rel="self"/>
<link href="https://home-assistant.io/"/> <link href="https://home-assistant.io/"/>
<updated>2018-01-27T17:19:32+00:00</updated> <updated>2018-01-27T19:30:30+00:00</updated>
<id>https://home-assistant.io/</id> <id>https://home-assistant.io/</id>
<author> <author>
<name><![CDATA[Home Assistant]]></name> <name><![CDATA[Home Assistant]]></name>

View file

@ -4,7 +4,7 @@
<title><![CDATA[Category: User-Stories | Home Assistant]]></title> <title><![CDATA[Category: User-Stories | Home Assistant]]></title>
<link href="https://home-assistant.io/blog/categories/user-stories/atom.xml" rel="self"/> <link href="https://home-assistant.io/blog/categories/user-stories/atom.xml" rel="self"/>
<link href="https://home-assistant.io/"/> <link href="https://home-assistant.io/"/>
<updated>2018-01-27T17:19:32+00:00</updated> <updated>2018-01-27T19:30:30+00:00</updated>
<id>https://home-assistant.io/</id> <id>https://home-assistant.io/</id>
<author> <author>
<name><![CDATA[Home Assistant]]></name> <name><![CDATA[Home Assistant]]></name>

View file

@ -4,7 +4,7 @@
<title><![CDATA[Category: Video | Home Assistant]]></title> <title><![CDATA[Category: Video | Home Assistant]]></title>
<link href="https://home-assistant.io/blog/categories/video/atom.xml" rel="self"/> <link href="https://home-assistant.io/blog/categories/video/atom.xml" rel="self"/>
<link href="https://home-assistant.io/"/> <link href="https://home-assistant.io/"/>
<updated>2018-01-27T17:19:32+00:00</updated> <updated>2018-01-27T19:30:30+00:00</updated>
<id>https://home-assistant.io/</id> <id>https://home-assistant.io/</id>
<author> <author>
<name><![CDATA[Home Assistant]]></name> <name><![CDATA[Home Assistant]]></name>

View file

@ -4,7 +4,7 @@
<title><![CDATA[Category: Website | Home Assistant]]></title> <title><![CDATA[Category: Website | Home Assistant]]></title>
<link href="https://home-assistant.io/blog/categories/website/atom.xml" rel="self"/> <link href="https://home-assistant.io/blog/categories/website/atom.xml" rel="self"/>
<link href="https://home-assistant.io/"/> <link href="https://home-assistant.io/"/>
<updated>2018-01-27T17:19:32+00:00</updated> <updated>2018-01-27T19:30:30+00:00</updated>
<id>https://home-assistant.io/</id> <id>https://home-assistant.io/</id>
<author> <author>
<name><![CDATA[Home Assistant]]></name> <name><![CDATA[Home Assistant]]></name>

View file

@ -76,7 +76,7 @@
<hr class="divider"> <hr class="divider">
<p>The <code class="highlighter-rouge">mqtt</code> binary sensor platform uses an MQTT message payload to set the binary sensor to one of two states: <code class="highlighter-rouge">on</code> or <code class="highlighter-rouge">off</code>.</p> <p>The <code class="highlighter-rouge">mqtt</code> binary sensor platform uses an MQTT message payload to set the binary sensor to one of two states: <code class="highlighter-rouge">on</code> or <code class="highlighter-rouge">off</code>.</p>
<p>The binary sensor state will be updated only after a new message is published on <code class="highlighter-rouge">state_topic</code> matching <code class="highlighter-rouge">payload_on</code> or <code class="highlighter-rouge">payload_off</code>. If these messages are published with the <code class="highlighter-rouge">retain</code> flag set, the binary sensor will receive an instant state update after subscription and Home Assistant will display the correct state on startup. Otherwise, the initial state displayed in Home Assistant will be <code class="highlighter-rouge">unknown</code>.</p> <p>The binary sensor state will be updated only after a new message is published on <code class="highlighter-rouge">state_topic</code> matching <code class="highlighter-rouge">payload_on</code> or <code class="highlighter-rouge">payload_off</code>. If these messages are published with the <code class="highlighter-rouge">retain</code> flag set, the binary sensor will receive an instant state update after subscription and Home Assistant will display the correct state on startup. Otherwise, the initial state displayed in Home Assistant will be <code class="highlighter-rouge">unknown</code>.</p>
<p>The <code class="highlighter-rouge">mqtt</code> binary sensor platform optionally supports an <code class="highlighter-rouge">availability_topic</code> to receive online and offline messages (birth and LWT messages) from the MQTT device. During normal operation, if the MQTT cover device goes offline (i.e. publishes <code class="highlighter-rouge">payload_not_available</code> to <code class="highlighter-rouge">availability_topic</code>), Home Assistant will display the binary sensor as <code class="highlighter-rouge">unavailable</code>. If these messages are published with the <code class="highlighter-rouge">retain</code> flag set, the binary sensor will receive an instant update after subscription and Home Assistant will display the correct availability state of the binary sensor when Home Assistant starts up. If the <code class="highlighter-rouge">retain</code> flag is not set, Home Assistant will display the binary sensor as <code class="highlighter-rouge">unavailable</code> when Home Assistant starts up. If no <code class="highlighter-rouge">availability_topic</code> is defined, Home Assistant will consider the MQTT device to be available.</p> <p>The <code class="highlighter-rouge">mqtt</code> binary sensor platform optionally supports an <code class="highlighter-rouge">availability_topic</code> to receive online and offline messages (birth and LWT messages) from the MQTT device. During normal operation, if the MQTT cover device goes offline (i.e., publishes <code class="highlighter-rouge">payload_not_available</code> to <code class="highlighter-rouge">availability_topic</code>), Home Assistant will display the binary sensor as <code class="highlighter-rouge">unavailable</code>. If these messages are published with the <code class="highlighter-rouge">retain</code> flag set, the binary sensor will receive an instant update after subscription and Home Assistant will display the correct availability state of the binary sensor when Home Assistant starts up. If the <code class="highlighter-rouge">retain</code> flag is not set, Home Assistant will display the binary sensor as <code class="highlighter-rouge">unavailable</code> when Home Assistant starts up. If no <code class="highlighter-rouge">availability_topic</code> is defined, Home Assistant will consider the MQTT device to be available.</p>
<p>To use an MQTT binary sensor in your installation, add the following to your <code class="highlighter-rouge">configuration.yaml</code> file:</p> <p>To use an MQTT binary sensor in your installation, add the following to your <code class="highlighter-rouge">configuration.yaml</code> file:</p>
<div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="c1"># Example configuration.yaml entry</span> <div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="c1"># Example configuration.yaml entry</span>
<span class="s">binary_sensor</span><span class="pi">:</span> <span class="s">binary_sensor</span><span class="pi">:</span>
@ -135,6 +135,9 @@
</dd> </dd>
</dl> </dl>
</div> </div>
<h2><a class="title-link" name="examples" href="#examples"></a> Examples</h2>
<p>In this section, you will find some real-life examples of how to use this sensor.</p>
<h3><a class="title-link" name="full-configuration" href="#full-configuration"></a> Full configuration</h3>
<p>To test, you can use the command line tool <code class="highlighter-rouge">mosquitto_pub</code> shipped with <code class="highlighter-rouge">mosquitto</code> or the <code class="highlighter-rouge">mosquitto-clients</code> package to send MQTT messages. To set the state of the binary sensor manually:</p> <p>To test, you can use the command line tool <code class="highlighter-rouge">mosquitto_pub</code> shipped with <code class="highlighter-rouge">mosquitto</code> or the <code class="highlighter-rouge">mosquitto-clients</code> package to send MQTT messages. To set the state of the binary sensor manually:</p>
<div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="gp">$ </span>mosquitto_pub -h 127.0.0.1 -t home-assistant/window/contact -m <span class="s2">"OFF"</span> <div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="gp">$ </span>mosquitto_pub -h 127.0.0.1 -t home-assistant/window/contact -m <span class="s2">"OFF"</span>
</code></pre> </code></pre>
@ -155,6 +158,24 @@
<span class="s">value_template</span><span class="pi">:</span> <span class="s1">'</span><span class="s">{{</span><span class="nv"> </span><span class="s">value.x</span><span class="nv"> </span><span class="s">}}'</span> <span class="s">value_template</span><span class="pi">:</span> <span class="s1">'</span><span class="s">{{</span><span class="nv"> </span><span class="s">value.x</span><span class="nv"> </span><span class="s">}}'</span>
</code></pre> </code></pre>
</div> </div>
<h3><a class="title-link" name="get-the-state-of-a-device-with-espeasy" href="#get-the-state-of-a-device-with-espeasy"></a> Get the state of a device with ESPEasy</h3>
<p>Assuming that you have flashed your ESP8266 unit with <a href="https://github.com/letscontrolit/ESPEasy">ESPEasy</a>. Under “Config” is a name (“Unit Name:”) set for your device (here its “bathroom”). A configuration for a “Controller” for MQTT with the protocol “OpenHAB MQTT” is present and the entries (“Controller Subscribe:” and “Controller Publish:”) are adjusted to match your needs. In this example, the topics are prefixed with “home”. Also, add a “Switch Input” in the “Devices” tap with the name “switch” and “button” as value.</p>
<p>As soon as the unit is online, you will get the state of the attached button.</p>
<div class="language-bash highlighter-rouge"><pre class="highlight"><code>home/bathroom/status Connected
...
home/bathroom/switch/button 1
</code></pre>
</div>
<p>The configuration will look like the example below:</p>
<div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="c1"># Example configuration.yml entry</span>
<span class="s">binary_sensor</span><span class="pi">:</span>
<span class="pi">-</span> <span class="s">platform</span><span class="pi">:</span> <span class="s">mqtt</span>
<span class="s">name</span><span class="pi">:</span> <span class="s">Bathroom</span>
<span class="s">state_topic</span><span class="pi">:</span> <span class="s2">"</span><span class="s">home/bathroom/switch/button"</span>
<span class="s">payload_on</span><span class="pi">:</span> <span class="s2">"</span><span class="s">1"</span>
<span class="s">payload_off</span><span class="pi">:</span> <span class="s2">"</span><span class="s">0"</span>
</code></pre>
</div>
</article> </article>
</div> </div>
<aside id="sidebar" class="grid__item one-third lap-one-whole palm-one-whole"> <aside id="sidebar" class="grid__item one-third lap-one-whole palm-one-whole">

View file

@ -144,7 +144,7 @@
<div class="language-bash highlighter-rouge"><pre class="highlight"><code>owntracks/tablet/tablet <span class="o">{</span><span class="s2">"_type"</span>:<span class="s2">"location"</span>,<span class="s2">"lon"</span>:7.21,<span class="s2">"t"</span>:<span class="s2">"u"</span>,<span class="s2">"batt"</span>:92,<span class="s2">"tst"</span>:144995643,<span class="s2">"tid"</span>:<span class="s2">"ta"</span>,<span class="s2">"acc"</span>:27,<span class="s2">"lat"</span>:46.12<span class="o">}</span> <div class="language-bash highlighter-rouge"><pre class="highlight"><code>owntracks/tablet/tablet <span class="o">{</span><span class="s2">"_type"</span>:<span class="s2">"location"</span>,<span class="s2">"lon"</span>:7.21,<span class="s2">"t"</span>:<span class="s2">"u"</span>,<span class="s2">"batt"</span>:92,<span class="s2">"tst"</span>:144995643,<span class="s2">"tid"</span>:<span class="s2">"ta"</span>,<span class="s2">"acc"</span>:27,<span class="s2">"lat"</span>:46.12<span class="o">}</span>
</code></pre> </code></pre>
</div> </div>
<p>Thus the trick is extract the battery level from the payload.</p> <p>Thus the trick is extracting the battery level from the payload.</p>
<div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="c1"># Example configuration.yml entry</span> <div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="c1"># Example configuration.yml entry</span>
<span class="s">sensor</span><span class="pi">:</span> <span class="s">sensor</span><span class="pi">:</span>
<span class="pi">-</span> <span class="s">platform</span><span class="pi">:</span> <span class="s">mqtt</span> <span class="pi">-</span> <span class="s">platform</span><span class="pi">:</span> <span class="s">mqtt</span>
@ -178,6 +178,22 @@
<span class="s">value_template</span><span class="pi">:</span> <span class="s1">'</span><span class="s">{{</span><span class="nv"> </span><span class="s">value_json.humidity</span><span class="nv"> </span><span class="s">}}'</span> <span class="s">value_template</span><span class="pi">:</span> <span class="s1">'</span><span class="s">{{</span><span class="nv"> </span><span class="s">value_json.humidity</span><span class="nv"> </span><span class="s">}}'</span>
</code></pre> </code></pre>
</div> </div>
<h3><a class="title-link" name="get-sensor-value-from-a-device-with-espeasy" href="#get-sensor-value-from-a-device-with-espeasy"></a> Get sensor value from a device with ESPEasy</h3>
<p>Assuming that you have flashed your ESP8266 unit with <a href="https://github.com/letscontrolit/ESPEasy">ESPEasy</a>. Under “Config” set a name (“Unit Name:”) for your device (here its “bathroom”). A “Controller” for MQTT with the protocol “OpenHAB MQTT” is present and the entries (“Controller Subscribe:” and “Controller Publish:”) are adjusted to match your needs. In this example the topics are prefixed with “home”. Also, add a sensor in the “Devices” tap with the name “analog” and “brightness” as value.</p>
<p>As soon as the unit is online, you will get the state of the sensor.</p>
<div class="language-bash highlighter-rouge"><pre class="highlight"><code>home/bathroom/status Connected
...
home/bathroom/analog/brightness 290.00
</code></pre>
</div>
<p>The configuration will look like the example below:</p>
<div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="c1"># Example configuration.yml entry</span>
<span class="s">sensor</span><span class="pi">:</span>
<span class="pi">-</span> <span class="s">platform</span><span class="pi">:</span> <span class="s">mqtt</span>
<span class="s">state_topic</span><span class="pi">:</span> <span class="s1">'</span><span class="s">home/bathroom/analog/brightness'</span>
<span class="s">name</span><span class="pi">:</span> <span class="s">Brightness</span>
</code></pre>
</div>
</article> </article>
</div> </div>
<aside id="sidebar" class="grid__item one-third lap-one-whole palm-one-whole"> <aside id="sidebar" class="grid__item one-third lap-one-whole palm-one-whole">

View file

@ -168,7 +168,24 @@ Make sure that your topic matches exactly. <code class="highlighter-rouge">some-
</code></pre> </code></pre>
</div> </div>
<p>For a check you can use the command line tools <code class="highlighter-rouge">mosquitto_pub</code> shipped with <code class="highlighter-rouge">mosquitto</code> to send MQTT messages. This allows you to operate your switch manually:</p> <p>For a check you can use the command line tools <code class="highlighter-rouge">mosquitto_pub</code> shipped with <code class="highlighter-rouge">mosquitto</code> to send MQTT messages. This allows you to operate your switch manually:</p>
<div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="gp">$ </span>mosquitto_pub -h 127.0.0.1 -t home/bedroom/switch1 -m <span class="s2">"ON"</span> <div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="gp">$ </span>mosquitto_pub -h 127.0.0.1 -t home/bedroom/switch1 -m <span class="s2">"ON"</span>
</code></pre>
</div>
<h3><a class="title-link" name="set-the-state-of-a-device-with-espeasy" href="#set-the-state-of-a-device-with-espeasy"></a> Set the state of a device with ESPEasy</h3>
<p>Assuming that you have flashed your ESP8266 unit with <a href="https://github.com/letscontrolit/ESPEasy">ESPEasy</a>. Under “Config” is a name (“Unit Name:”) set for your device (here its “bathroom”). A configuration for a “Controller” for MQTT with the protocol “OpenHAB MQTT” is present and the entries (“Controller Subscribe:” and “Controller Publish:”) are adjusted to match your needs. In this example the topics are prefixed with “home”. There is no further configuration needed as the <a href="https://www.letscontrolit.com/wiki/index.php/GPIO">GPIOs</a> can be controlled with MQTT directly.</p>
<p>Manually you can set pin 13 to high with <code class="highlighter-rouge">mosquitto_pub</code> or another MQTT tool:</p>
<div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="gp">$ </span>mosquitto_pub -h 127.0.0.1 -t home/bathroom/gpio/13 -m <span class="s2">"1"</span>
</code></pre>
</div>
<p>The configuration will look like the example below:</p>
<div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="c1"># Example configuration.yml entry</span>
<span class="s">switch</span><span class="pi">:</span>
<span class="pi">-</span> <span class="s">platform</span><span class="pi">:</span> <span class="s">mqtt</span>
<span class="s">name</span><span class="pi">:</span> <span class="s">bathroom</span>
<span class="s">state_topic</span><span class="pi">:</span> <span class="s2">"</span><span class="s">home/bathroom/gpio/13"</span>
<span class="s">command_topic</span><span class="pi">:</span> <span class="s2">"</span><span class="s">home/bathroom/gpio/13"</span>
<span class="s">payload_on</span><span class="pi">:</span> <span class="s2">"</span><span class="s">1"</span>
<span class="s">payload_off</span><span class="pi">:</span> <span class="s2">"</span><span class="s">0"</span>
</code></pre> </code></pre>
</div> </div>
</article> </article>

View file

@ -3974,7 +3974,7 @@
</url> </url>
<url> <url>
<loc>https://home-assistant.io/components/switch.hook/</loc> <loc>https://home-assistant.io/components/switch.hook/</loc>
<lastmod>2018-01-27T17:19:32+00:00</lastmod> <lastmod>2018-01-27T19:30:30+00:00</lastmod>
</url> </url>
<url> <url>
<loc>https://home-assistant.io/cookbook/automation_for_rainy_days/</loc> <loc>https://home-assistant.io/cookbook/automation_for_rainy_days/</loc>
@ -4658,99 +4658,99 @@
</url> </url>
<url> <url>
<loc>https://home-assistant.io/docs/autostart/init.d/</loc> <loc>https://home-assistant.io/docs/autostart/init.d/</loc>
<lastmod>2018-01-27T17:19:32+00:00</lastmod> <lastmod>2018-01-27T19:30:30+00:00</lastmod>
</url> </url>
<url> <url>
<loc>https://home-assistant.io/docs/ecosystem/appdaemon/</loc> <loc>https://home-assistant.io/docs/ecosystem/appdaemon/</loc>
<lastmod>2018-01-27T17:19:32+00:00</lastmod> <lastmod>2018-01-27T19:30:30+00:00</lastmod>
</url> </url>
<url> <url>
<loc>https://home-assistant.io/docs/ecosystem/appdaemon/api/</loc> <loc>https://home-assistant.io/docs/ecosystem/appdaemon/api/</loc>
<lastmod>2018-01-27T17:19:32+00:00</lastmod> <lastmod>2018-01-27T19:30:30+00:00</lastmod>
</url> </url>
<url> <url>
<loc>https://home-assistant.io/docs/ecosystem/appdaemon/configuration/</loc> <loc>https://home-assistant.io/docs/ecosystem/appdaemon/configuration/</loc>
<lastmod>2018-01-27T17:19:32+00:00</lastmod> <lastmod>2018-01-27T19:30:30+00:00</lastmod>
</url> </url>
<url> <url>
<loc>https://home-assistant.io/docs/ecosystem/appdaemon/example_apps/</loc> <loc>https://home-assistant.io/docs/ecosystem/appdaemon/example_apps/</loc>
<lastmod>2018-01-27T17:19:32+00:00</lastmod> <lastmod>2018-01-27T19:30:30+00:00</lastmod>
</url> </url>
<url> <url>
<loc>https://home-assistant.io/docs/ecosystem/appdaemon/installation/</loc> <loc>https://home-assistant.io/docs/ecosystem/appdaemon/installation/</loc>
<lastmod>2018-01-27T17:19:32+00:00</lastmod> <lastmod>2018-01-27T19:30:30+00:00</lastmod>
</url> </url>
<url> <url>
<loc>https://home-assistant.io/docs/ecosystem/appdaemon/operation/</loc> <loc>https://home-assistant.io/docs/ecosystem/appdaemon/operation/</loc>
<lastmod>2018-01-27T17:19:32+00:00</lastmod> <lastmod>2018-01-27T19:30:30+00:00</lastmod>
</url> </url>
<url> <url>
<loc>https://home-assistant.io/docs/ecosystem/appdaemon/reboot/</loc> <loc>https://home-assistant.io/docs/ecosystem/appdaemon/reboot/</loc>
<lastmod>2018-01-27T17:19:32+00:00</lastmod> <lastmod>2018-01-27T19:30:30+00:00</lastmod>
</url> </url>
<url> <url>
<loc>https://home-assistant.io/docs/ecosystem/appdaemon/running/</loc> <loc>https://home-assistant.io/docs/ecosystem/appdaemon/running/</loc>
<lastmod>2018-01-27T17:19:32+00:00</lastmod> <lastmod>2018-01-27T19:30:30+00:00</lastmod>
</url> </url>
<url> <url>
<loc>https://home-assistant.io/docs/ecosystem/appdaemon/tutorial/</loc> <loc>https://home-assistant.io/docs/ecosystem/appdaemon/tutorial/</loc>
<lastmod>2018-01-27T17:19:32+00:00</lastmod> <lastmod>2018-01-27T19:30:30+00:00</lastmod>
</url> </url>
<url> <url>
<loc>https://home-assistant.io/docs/ecosystem/appdaemon/updating/</loc> <loc>https://home-assistant.io/docs/ecosystem/appdaemon/updating/</loc>
<lastmod>2018-01-27T17:19:32+00:00</lastmod> <lastmod>2018-01-27T19:30:30+00:00</lastmod>
</url> </url>
<url> <url>
<loc>https://home-assistant.io/docs/ecosystem/appdaemon/windows/</loc> <loc>https://home-assistant.io/docs/ecosystem/appdaemon/windows/</loc>
<lastmod>2018-01-27T17:19:32+00:00</lastmod> <lastmod>2018-01-27T19:30:30+00:00</lastmod>
</url> </url>
<url> <url>
<loc>https://home-assistant.io/docs/ecosystem/certificates/</loc> <loc>https://home-assistant.io/docs/ecosystem/certificates/</loc>
<lastmod>2018-01-27T17:19:32+00:00</lastmod> <lastmod>2018-01-27T19:30:30+00:00</lastmod>
</url> </url>
<url> <url>
<loc>https://home-assistant.io/docs/ecosystem/hadashboard/</loc> <loc>https://home-assistant.io/docs/ecosystem/hadashboard/</loc>
<lastmod>2018-01-27T17:19:32+00:00</lastmod> <lastmod>2018-01-27T19:30:30+00:00</lastmod>
</url> </url>
<url> <url>
<loc>https://home-assistant.io/docs/ecosystem/hass-configurator/</loc> <loc>https://home-assistant.io/docs/ecosystem/hass-configurator/</loc>
<lastmod>2018-01-27T17:19:32+00:00</lastmod> <lastmod>2018-01-27T19:30:30+00:00</lastmod>
</url> </url>
<url> <url>
<loc>https://home-assistant.io/docs/ecosystem/ios/</loc> <loc>https://home-assistant.io/docs/ecosystem/ios/</loc>
<lastmod>2018-01-27T17:19:32+00:00</lastmod> <lastmod>2018-01-27T19:30:30+00:00</lastmod>
</url> </url>
<url> <url>
<loc>https://home-assistant.io/docs/ecosystem/nginx/</loc> <loc>https://home-assistant.io/docs/ecosystem/nginx/</loc>
<lastmod>2018-01-27T17:19:32+00:00</lastmod> <lastmod>2018-01-27T19:30:30+00:00</lastmod>
</url> </url>
<url> <url>
<loc>https://home-assistant.io/docs/ecosystem/notebooks/</loc> <loc>https://home-assistant.io/docs/ecosystem/notebooks/</loc>
<lastmod>2018-01-27T17:19:32+00:00</lastmod> <lastmod>2018-01-27T19:30:30+00:00</lastmod>
</url> </url>
<url> <url>
<loc>https://home-assistant.io/docs/ecosystem/scenegen/</loc> <loc>https://home-assistant.io/docs/ecosystem/scenegen/</loc>
<lastmod>2018-01-27T17:19:32+00:00</lastmod> <lastmod>2018-01-27T19:30:30+00:00</lastmod>
</url> </url>
<url> <url>
<loc>https://home-assistant.io/docs/ecosystem/synology/</loc> <loc>https://home-assistant.io/docs/ecosystem/synology/</loc>
<lastmod>2018-01-27T17:19:32+00:00</lastmod> <lastmod>2018-01-27T19:30:30+00:00</lastmod>
</url> </url>
<url> <url>
<loc>https://home-assistant.io/docs/tools/</loc> <loc>https://home-assistant.io/docs/tools/</loc>
<lastmod>2018-01-27T17:19:32+00:00</lastmod> <lastmod>2018-01-27T19:30:30+00:00</lastmod>
</url> </url>
<url> <url>
<loc>https://home-assistant.io/docs/tools/dev-tools/</loc> <loc>https://home-assistant.io/docs/tools/dev-tools/</loc>
<lastmod>2018-01-27T17:19:32+00:00</lastmod> <lastmod>2018-01-27T19:30:30+00:00</lastmod>
</url> </url>
<url> <url>
<loc>https://home-assistant.io/docs/tools/hass/</loc> <loc>https://home-assistant.io/docs/tools/hass/</loc>
<lastmod>2018-01-27T17:19:32+00:00</lastmod> <lastmod>2018-01-27T19:30:30+00:00</lastmod>
</url> </url>
<url> <url>
<loc>https://home-assistant.io/docs/tools/scripts/</loc> <loc>https://home-assistant.io/docs/tools/scripts/</loc>
<lastmod>2018-01-27T17:19:32+00:00</lastmod> <lastmod>2018-01-27T19:30:30+00:00</lastmod>
</url> </url>
<url> <url>
<loc>https://home-assistant.io/faq/after-upgrading/</loc> <loc>https://home-assistant.io/faq/after-upgrading/</loc>
@ -5905,62 +5905,62 @@
</url> </url>
<url> <url>
<loc>https://home-assistant.io/demo/frontend.html</loc> <loc>https://home-assistant.io/demo/frontend.html</loc>
<lastmod>2018-01-27T17:18:38+00:00</lastmod> <lastmod>2018-01-27T19:29:48+00:00</lastmod>
</url> </url>
<url> <url>
<loc>https://home-assistant.io/demo/index.html</loc> <loc>https://home-assistant.io/demo/index.html</loc>
<lastmod>2018-01-27T17:18:38+00:00</lastmod> <lastmod>2018-01-27T19:29:48+00:00</lastmod>
</url> </url>
<url> <url>
<loc>https://home-assistant.io/demo/panels/ha-panel-dev-event.html</loc> <loc>https://home-assistant.io/demo/panels/ha-panel-dev-event.html</loc>
<lastmod>2018-01-27T17:18:38+00:00</lastmod> <lastmod>2018-01-27T19:29:48+00:00</lastmod>
</url> </url>
<url> <url>
<loc>https://home-assistant.io/demo/panels/ha-panel-dev-info.html</loc> <loc>https://home-assistant.io/demo/panels/ha-panel-dev-info.html</loc>
<lastmod>2018-01-27T17:18:38+00:00</lastmod> <lastmod>2018-01-27T19:29:48+00:00</lastmod>
</url> </url>
<url> <url>
<loc>https://home-assistant.io/demo/panels/ha-panel-dev-service.html</loc> <loc>https://home-assistant.io/demo/panels/ha-panel-dev-service.html</loc>
<lastmod>2018-01-27T17:18:38+00:00</lastmod> <lastmod>2018-01-27T19:29:48+00:00</lastmod>
</url> </url>
<url> <url>
<loc>https://home-assistant.io/demo/panels/ha-panel-dev-state.html</loc> <loc>https://home-assistant.io/demo/panels/ha-panel-dev-state.html</loc>
<lastmod>2018-01-27T17:18:38+00:00</lastmod> <lastmod>2018-01-27T19:29:48+00:00</lastmod>
</url> </url>
<url> <url>
<loc>https://home-assistant.io/demo/panels/ha-panel-dev-template.html</loc> <loc>https://home-assistant.io/demo/panels/ha-panel-dev-template.html</loc>
<lastmod>2018-01-27T17:18:38+00:00</lastmod> <lastmod>2018-01-27T19:29:48+00:00</lastmod>
</url> </url>
<url> <url>
<loc>https://home-assistant.io/demo/panels/ha-panel-history.html</loc> <loc>https://home-assistant.io/demo/panels/ha-panel-history.html</loc>
<lastmod>2018-01-27T17:18:38+00:00</lastmod> <lastmod>2018-01-27T19:29:48+00:00</lastmod>
</url> </url>
<url> <url>
<loc>https://home-assistant.io/demo/panels/ha-panel-iframe.html</loc> <loc>https://home-assistant.io/demo/panels/ha-panel-iframe.html</loc>
<lastmod>2018-01-27T17:18:38+00:00</lastmod> <lastmod>2018-01-27T19:29:48+00:00</lastmod>
</url> </url>
<url> <url>
<loc>https://home-assistant.io/demo/panels/ha-panel-logbook.html</loc> <loc>https://home-assistant.io/demo/panels/ha-panel-logbook.html</loc>
<lastmod>2018-01-27T17:18:38+00:00</lastmod> <lastmod>2018-01-27T19:29:48+00:00</lastmod>
</url> </url>
<url> <url>
<loc>https://home-assistant.io/demo/panels/ha-panel-map.html</loc> <loc>https://home-assistant.io/demo/panels/ha-panel-map.html</loc>
<lastmod>2018-01-27T17:18:38+00:00</lastmod> <lastmod>2018-01-27T19:29:48+00:00</lastmod>
</url> </url>
<url> <url>
<loc>https://home-assistant.io/googlef4f3693c209fe788.html</loc> <loc>https://home-assistant.io/googlef4f3693c209fe788.html</loc>
<lastmod>2018-01-27T17:18:38+00:00</lastmod> <lastmod>2018-01-27T19:29:48+00:00</lastmod>
</url> </url>
<url> <url>
<loc>https://home-assistant.io/static/fonts/roboto/DESCRIPTION.en_us.html</loc> <loc>https://home-assistant.io/static/fonts/roboto/DESCRIPTION.en_us.html</loc>
<lastmod>2018-01-27T17:18:38+00:00</lastmod> <lastmod>2018-01-27T19:29:49+00:00</lastmod>
</url> </url>
<url> <url>
<loc>https://home-assistant.io/static/fonts/robotomono/DESCRIPTION.en_us.html</loc> <loc>https://home-assistant.io/static/fonts/robotomono/DESCRIPTION.en_us.html</loc>
<lastmod>2018-01-27T17:18:38+00:00</lastmod> <lastmod>2018-01-27T19:29:49+00:00</lastmod>
</url> </url>
<url> <url>
<loc>https://home-assistant.io/static/mdi-demo.html</loc> <loc>https://home-assistant.io/static/mdi-demo.html</loc>
<lastmod>2018-01-27T17:18:38+00:00</lastmod> <lastmod>2018-01-27T19:29:49+00:00</lastmod>
</url> </url>
</urlset> </urlset>