2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-03 16:56:54 +00:00

59_LuftdatenInfo: added parsing of BME280 sensor data

git-svn-id: https://svn.fhem.de/fhem/trunk@14070 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
igami 2017-04-22 12:09:10 +00:00
parent 625174985d
commit 4bdc2dd4c0

View File

@ -327,7 +327,7 @@ sub LuftdatenInfo_ParseHttpResponse($) {
LuftdatenInfo_GetHttpResponse($hash, $SENSORID2)
if(defined($SENSORID2));
}
elsif($sensor_type eq "DHT22"){
elsif($sensor_type ne "SDS011"){
Log3 $SELF, 5, "$TYPE ($SELF) - parsing $sensor_type data";
if( $sensor->{location}{latitude} ne
@ -339,7 +339,8 @@ sub LuftdatenInfo_ParseHttpResponse($) {
Log3(
$SELF, 2
, "$TYPE ($SELF) - DHT22 position differs from SDS011 position"
, "$TYPE ($SELF) - "
. "$sensor_type position differs from SDS011 position"
);
return;
@ -357,6 +358,9 @@ sub LuftdatenInfo_ParseHttpResponse($) {
elsif($_->{value_type} eq "humidity"){
readingsBulkUpdate($hash, "humidity", $1);
}
elsif($_->{value_type} eq "pressure"){
readingsBulkUpdate($hash, "pressure", $1);
}
}
readingsBulkUpdate($hash, "state", "active");
@ -376,6 +380,9 @@ sub LuftdatenInfo_ParseHttpResponse($) {
elsif($_->{value_type} eq "humidity"){
readingsBulkUpdate($hash, "humidity", $1);
}
elsif($_->{value_type} eq "pressure"){
readingsBulkUpdate($hash, "pressure", $1);
}
elsif($_->{value_type} eq "SDS_P1"){
readingsBulkUpdate($hash, "PM10", $1);
}
@ -456,7 +463,9 @@ sub LuftdatenInfo_statusRequest($) {
<ul>
<code>
define &lt;name&gt; LuftdatenInfo
(&lt;SDS011sensorID&gt; [&lt;DHT22sensorID&gt;]|&lt;ip&gt;)
(&lt;SDS011sensorID&gt;
[&lt;DHT22sensorID&gt;|&lt;BME280sensorID&gt;]
|&lt;ip&gt;)
</code><br>
To query the data from the server, the SDS011 SensorID must be
specified.<br>
@ -498,6 +507,11 @@ sub LuftdatenInfo_statusRequest($) {
<code>humidity</code><br>
Relative humidity in%
</li>
<li>
<code>pressure</code><br>
Pressure in hPa<br>
Only available with BME280 sensor.
</li>
<li>
<code>latitude</code><br>
latitude<br>
@ -575,7 +589,9 @@ sub LuftdatenInfo_statusRequest($) {
<ul>
<code>
define &lt;name&gt; LuftdatenInfo
(&lt;SDS011sensorID&gt; [&lt;DHT22sensorID&gt;]|&lt;ip&gt;)
(&lt;SDS011sensorID&gt;
[&lt;DHT22sensorID&gt;|&lt;BME280sensorID&gt;]
|&lt;ip&gt;)
</code><br>
F&uuml;r eine Abfrage der Daten vom Server muss die SensorID von dem
SDS011 Sensor angegeben werden. Diese steht rechts auf der Seite
@ -616,6 +632,11 @@ sub LuftdatenInfo_statusRequest($) {
<code>humidity</code><br>
Relative Luftfeuchtgkeit in %
</li>
<li>
<code>pressure</code><br>
Luftdruck in hPa<br>
Nur bei einem BME280 Sensor verf&uuml;gbar.
</li>
<li>
<code>latitude</code><br>
Breitengrad<br>