Site updated at 2016-07-24 17:39:50 UTC
This commit is contained in:
parent
2d9a218a1b
commit
29118ce15d
1007 changed files with 168343 additions and 140 deletions
|
@ -4,7 +4,7 @@
|
|||
<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/"/>
|
||||
<updated>2016-07-24T17:13:16+00:00</updated>
|
||||
<updated>2016-07-24T17:38:38+00:00</updated>
|
||||
<id>https://home-assistant.io/</id>
|
||||
<author>
|
||||
<name><![CDATA[Home Assistant]]></name>
|
||||
|
@ -269,7 +269,7 @@ Home Assistant will keep track of historical values and allow you to integrate i
|
|||
|
||||
<!--more-->
|
||||
|
||||
<h3>{% linkable_title Components %}</h3>
|
||||
<h3><a class='title-link' name='components' href='#components'></a> Components </h3>
|
||||
|
||||
<p>I’ve been using Adafruit for my shopping:</p>
|
||||
|
||||
|
@ -281,7 +281,7 @@ Home Assistant will keep track of historical values and allow you to integrate i
|
|||
|
||||
<p><em>Besides this, you will need the usual hardware prototype equipment: a breadboard, some wires, soldering iron + wire, Serial USB cable.</em></p>
|
||||
|
||||
<h3>{% linkable_title Alternatives %}</h3>
|
||||
<h3><a class='title-link' name='alternatives' href='#alternatives'></a> Alternatives </h3>
|
||||
|
||||
<p>Since this article has been published the HDC1008 has been discontinued. Updated sketches are available for the following alternatives:</p>
|
||||
|
||||
|
@ -290,7 +290,7 @@ Home Assistant will keep track of historical values and allow you to integrate i
|
|||
<li><a href="https://www.adafruit.com/product/2652">BME280 sensor</a> and <a href="https://gist.github.com/mtl010957/9ee85fb404f65e15c440b08c659c0419">updated sketch</a>.</li>
|
||||
</ul>
|
||||
|
||||
<h3>{% linkable_title Connections %}</h3>
|
||||
<h3><a class='title-link' name='connections' href='#connections'></a> Connections </h3>
|
||||
|
||||
<p>On your breadboard, make the following connections from your ESP8266 to the HDC1008:</p>
|
||||
|
||||
|
@ -323,7 +323,7 @@ Home Assistant will keep track of historical values and allow you to integrate i
|
|||
|
||||
<p><em>I picked <code>#2</code> and <code>14</code> myself, you can configure them in the sketch.</em></p>
|
||||
|
||||
<h3>{% linkable_title Preparing your IDE %}</h3>
|
||||
<h3><a class='title-link' name='preparing-your-ide' href='#preparing-your-ide'></a> Preparing your IDE </h3>
|
||||
|
||||
<p>Follow <a href="https://github.com/esp8266/Arduino#installing-with-boards-manager">these instructions</a> on how to install and prepare the Arduino IDE for ESP8266 development.</p>
|
||||
|
||||
|
@ -334,7 +334,7 @@ Home Assistant will keep track of historical values and allow you to integrate i
|
|||
<li>Adafruit HDC1000</li>
|
||||
</ul>
|
||||
|
||||
<h3>{% linkable_title Sketch %}</h3>
|
||||
<h3><a class='title-link' name='sketch' href='#sketch'></a> Sketch </h3>
|
||||
|
||||
<p>If you have followed the previous steps, you’re all set.</p>
|
||||
|
||||
|
@ -578,7 +578,7 @@ Adafruit_HDC1000 hdc = Adafruit_HDC1000();
|
|||
</tr></table>
|
||||
</div>
|
||||
|
||||
<h3>{% linkable_title Configuring Home Assistant %}</h3>
|
||||
<h3><a class='title-link' name='configuring-home-assistant' href='#configuring-home-assistant'></a> Configuring Home Assistant </h3>
|
||||
|
||||
<p>The last step is to integrate the sensor values into Home Assistant. This can be done by setting up Home Assistant to connect to the MQTT broker and subscribe to the sensor topics.</p>
|
||||
|
||||
|
@ -640,7 +640,7 @@ Adafruit_HDC1000 hdc = Adafruit_HDC1000();
|
|||
|
||||
<!--more-->
|
||||
|
||||
<h3>{% linkable_title Manual usage %}</h3>
|
||||
<h3><a class='title-link' name='manual-usage' href='#manual-usage'></a> Manual usage </h3>
|
||||
|
||||
<p>The simplest but not the coolest way as a human to interact with a Home Assistant sensor is launching a command manually. Let’s create a “Mood” sensor. For simplicity Home Assistant and the MQTT broker are both running on the same host. The needed configuration snipplets to add to the <code>configuration.yaml</code> file consists of two parts: one for the broker and one for the sensor.</p>
|
||||
|
||||
|
@ -683,7 +683,7 @@ Adafruit_HDC1000 hdc = Adafruit_HDC1000();
|
|||
|
||||
<p>This is a really bad example. Don’t do this in the real world because you won’t be able to create diagrams of historical data. Better use a numerical value.</p>
|
||||
|
||||
<h3>{% linkable_title Python MQTT bindings %}</h3>
|
||||
<h3><a class='title-link' name='python-mqtt-bindings' href='#python-mqtt-bindings'></a> Python MQTT bindings </h3>
|
||||
|
||||
<p>The last section was pretty boring, I know. Nobody wants to send MQTT messages by hand if there is a computer on the desk. If you are playing the lottery this section is for you. If not, read it anyway because the lottery is just an example :-).</p>
|
||||
|
||||
|
@ -768,7 +768,7 @@ client.loop_start()
|
|||
|
||||
<p>With only a few lines of Python and an MQTT broker you can create your own “smartdevice” or send information to Home Assistant which you haven’t think of. Of course this is not limited to Python. If there is an MQTT library available, the device can be used with Home Assistant now.</p>
|
||||
|
||||
<h3>{% linkable_title Arduino %}</h3>
|
||||
<h3><a class='title-link' name='arduino' href='#arduino'></a> Arduino </h3>
|
||||
|
||||
<p>To get started with real hardware that is capable to send MQTT messages, the Arduino platform is an inexpensive way to do it. In this section an Arduino UNO with an Ethernet shield and a photo resistor is used. The photo resistor is connected to analog pin 0 (A0) and has an output from 0 to 1024.</p>
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue