Site updated at 2016-06-20 04:19:00 UTC
This commit is contained in:
parent
cd545b5648
commit
32fbab7f30
24 changed files with 157 additions and 42 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-06-19T22:07:22+00:00</updated>
|
||||
<updated>2016-06-20T04:18:24+00:00</updated>
|
||||
<id>https://home-assistant.io/</id>
|
||||
<author>
|
||||
<name><![CDATA[Paulus Schoutsen]]></name>
|
||||
|
@ -281,9 +281,14 @@ 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>
|
||||
|
||||
<p class="note">
|
||||
Adafruit has stopped selling the HDC1008. One possible replacement is the <a href="https://www.adafruit.com/product/2652">BME280</a>. Adjusted sketch to work with the BME280 can be found <a href="https://gist.github.com/mtl010957/9ee85fb404f65e15c440b08c659c0419">here</a>.
|
||||
</p>
|
||||
<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>
|
||||
|
||||
<ul>
|
||||
<li><a href="https://www.adafruit.com/product/385">DHT22 sensor</a> and <a href="https://gist.github.com/balloob/1176b6d87c2816bd07919ce6e29a19e9">updated sketch</a>.</li>
|
||||
<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><a class='title-link' name='connections' href='#connections'></a> Connections </h3>
|
||||
|
||||
|
@ -455,6 +460,8 @@ Adafruit has stopped selling the HDC1008. One possible replacement is the <a hre
|
|||
<a href="#n107" name="n107">107</a>
|
||||
<a href="#n108" name="n108">108</a>
|
||||
<a href="#n109" name="n109">109</a>
|
||||
<strong><a href="#n110" name="n110">110</a></strong>
|
||||
<a href="#n111" name="n111">111</a>
|
||||
</pre></td>
|
||||
<td class="code"><pre><span class="preprocessor">#include</span> <span class="include"><ESP8266WiFi.h></span>
|
||||
<span class="preprocessor">#include</span> <span class="include"><Wire.h></span>
|
||||
|
@ -487,7 +494,8 @@ Adafruit_HDC1000 hdc = Adafruit_HDC1000();
|
|||
<span class="keyword">if</span> (!hdc.begin()) {
|
||||
Serial.println(<span class="string"><span class="delimiter">"</span><span class="content">Couldn't find sensor!</span><span class="delimiter">"</span></span>);
|
||||
<span class="keyword">while</span> (<span class="integer">1</span>);
|
||||
}}
|
||||
}
|
||||
}
|
||||
|
||||
<span class="directive">void</span> setup_wifi() {
|
||||
delay(<span class="integer">10</span>);
|
||||
|
@ -529,7 +537,8 @@ Adafruit_HDC1000 hdc = Adafruit_HDC1000();
|
|||
}
|
||||
|
||||
<span class="predefined-type">bool</span> checkBound(<span class="predefined-type">float</span> newValue, <span class="predefined-type">float</span> prevValue, <span class="predefined-type">float</span> maxDiff) {
|
||||
<span class="keyword">return</span> newValue < prevValue - maxDiff || newValue > prevValue + maxDiff;
|
||||
<span class="keyword">return</span> !isnan(newValue) &&
|
||||
(newValue < prevValue - maxDiff || newValue > prevValue + maxDiff);
|
||||
}
|
||||
|
||||
<span class="predefined-type">long</span> lastMsg = <span class="integer">0</span>;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue