mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-01-31 06:39:11 +00:00
51_MOBILEALERTS: Added sensor MA10238
git-svn-id: https://svn.fhem.de/fhem/trunk@22347 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
30c2a156f7
commit
b6d91ab1db
@ -1,5 +1,6 @@
|
||||
# Add changes at the top of the list. Keep it in ASCII, and 80-char wide.
|
||||
# Do not insert empty lines here, update check depends on it.
|
||||
- feature: 51_MOBILEALERTS: Added Sensor MA 10238
|
||||
- bugfix 73_AutoShuttersControl: fix bug in
|
||||
./lib/FHEM/Automation/ShuttersControl.pm
|
||||
- feature: 76_SMAPortal: new attribute noHomeManager
|
||||
|
@ -325,6 +325,7 @@ sub MOBILEALERTS_Parse_15_ce ($$) {
|
||||
my $button = $buttonstate >> 4;
|
||||
my $state = $buttonstate & 0xF;
|
||||
my $state_name;
|
||||
|
||||
if ( $state == 1 ) {
|
||||
$state_name = "Short";
|
||||
}
|
||||
@ -630,6 +631,39 @@ sub MOBILEALERTS_Parse_da ($$) {
|
||||
. $humidityOut );
|
||||
}
|
||||
|
||||
sub MOBILEALERTS_Parse_18_e0 ($$) {
|
||||
my ( $hash, $message ) = @_;
|
||||
my ( $txCounter, $txCounter2, $temperature, $humidity, $airPressure ) =
|
||||
unpack( "nCnCn", $message );
|
||||
MOBILEALERTS_readingsBulkUpdateIfChanged( $hash, 0, "deviceType",
|
||||
"MA10238" );
|
||||
|
||||
MOBILEALERTS_readingsBulkUpdate( $hash, 0, "txCounter",
|
||||
MOBILEALERTS_decodeTxCounter2($txCounter, $txCounter2) );
|
||||
MOBILEALERTS_readingsBulkUpdate( $hash, 0, "triggered",
|
||||
MOBILEALERTS_triggeredTxCounter($txCounter) );
|
||||
MOBILEALERTS_readingsBulkUpdate( $hash, 0, "batteryState",
|
||||
MOBILEALERTS_batteryStateTxCounter($txCounter) );
|
||||
$temperature =
|
||||
MOBILEALERTS_decodeTemperature($temperature) +
|
||||
$hash->{".corrTemperature"};
|
||||
MOBILEALERTS_readingsBulkUpdate( $hash, 0, "temperature", $temperature );
|
||||
MOBILEALERTS_readingsBulkUpdate( $hash, 0, "temperatureString",
|
||||
MOBILEALERTS_temperatureToString($temperature) );
|
||||
$humidity =
|
||||
MOBILEALERTS_decodeHumidity($humidity) + $hash->{".corrHumidity"};
|
||||
MOBILEALERTS_readingsBulkUpdate( $hash, 0, "humidity", $humidity );
|
||||
MOBILEALERTS_readingsBulkUpdate( $hash, 0, "humidityString",
|
||||
MOBILEALERTS_humidityToString($humidity) );
|
||||
$airPressure = MOBILEALERTS_decodeAirPressure($airPressure);
|
||||
MOBILEALERTS_readingsBulkUpdate( $hash, 0, "airPressure", $airPressure );
|
||||
MOBILEALERTS_readingsBulkUpdate( $hash, 0, "airPressureString",
|
||||
MOBILEALERTS_airPressureToString($airPressure) );
|
||||
|
||||
MOBILEALERTS_readingsBulkUpdate( $hash, 0, "state",
|
||||
"T: " . $temperature . " H: " . $humidity . " A: " . $airPressure );
|
||||
}
|
||||
|
||||
sub MOBILEALERTS_Parse_08_e1 ($$) {
|
||||
my ( $hash, $message ) = @_;
|
||||
MOBILEALERTS_readingsBulkUpdateIfChanged( $hash, 0, "deviceType",
|
||||
@ -1128,6 +1162,11 @@ sub MOBILEALERTS_decodeTxCounter($) {
|
||||
return $txCounter & 0x3FFF;
|
||||
}
|
||||
|
||||
sub MOBILEALERTS_decodeTxCounter2($$) {
|
||||
my ($txCounter, $txCounter2) = @_;
|
||||
return (($txCounter & 0x3FFF) << 8) + $txCounter2;
|
||||
}
|
||||
|
||||
sub MOBILEALERTS_triggeredTxCounter($) {
|
||||
my ($txCounter) = @_;
|
||||
if ( ( $txCounter & 0x4000 ) == 0x4000 ) {
|
||||
@ -1171,6 +1210,16 @@ sub MOBILEALERTS_temperatureToString($) {
|
||||
return $temperature . "°C";
|
||||
}
|
||||
|
||||
sub MOBILEALERTS_decodeAirPressure($) {
|
||||
my ($airPressure) = @_;
|
||||
return $airPressure * 0.1;
|
||||
}
|
||||
|
||||
sub MOBILEALERTS_airPressureToString($) {
|
||||
my ($airPressure) = @_;
|
||||
return $airPressure . "hPa";
|
||||
}
|
||||
|
||||
sub MOBILEALERTS_decodeHumidity($) {
|
||||
my ($humidity) = @_;
|
||||
return 9999 if ( ( $humidity & 0x80 ) == 0x80 );
|
||||
@ -1506,6 +1555,8 @@ sub MOBILEALERTS_ActionDetector($) {
|
||||
<li>mmRain, mmRainActHour, mmRainLastHour, mmRainActDay, mmRainYesterday<br>Rain since reset of counter, current hour, last hour, current day, yesterday.</li>
|
||||
<li>direction, directionInt<br>Direction of wind.</li>
|
||||
<li>windSpeed, gustSpeed<br>Windspeed.</li>
|
||||
<li>airPressure<br>Barometric pressure in hPa</li>
|
||||
<li>airPressureString<br>Barometric pressure as String</li>
|
||||
</ul>
|
||||
<br>
|
||||
|
||||
@ -1554,7 +1605,7 @@ sub MOBILEALERTS_ActionDetector($) {
|
||||
Dieses FHEM Modul stellt jeweils ein MobileAlerts Gerät dar. Die Verbindung wird durch das
|
||||
<a href="#MOBILEALERTSGW">MOBILELAERTSGW</a> Modul bereitgestellt.<br>
|
||||
Aktuell werden unterstüzt: MA10100, MA10101, MA10200, MA10230, MA10300, MA10650, MA10320PRO, MA10350, MA10410, MA10450, MA10660, MA10700, TFA 30.3312.02, MA10800, WL2000, TFA30.3060.01.IT, MA10120PRO, MA10880<br>
|
||||
Unterstüzt aber ungetestet: ./.<br>
|
||||
Unterstüzt aber ungetestet: MA10238<br>
|
||||
<br>
|
||||
|
||||
<a name="MOBILEALERTSdefine"></a>
|
||||
@ -1603,6 +1654,8 @@ sub MOBILEALERTS_ActionDetector($) {
|
||||
<li>mmRain, mmRainActHour, mmRainLastHour, mmRainActDay, mmRainYesterday<br>Regen seit dem letzten Reset des Counters, in der aktuellen Stunde, seit der letzten Stunden, am aktuellen Tagn, gestern.</li>
|
||||
<li>direction, directionInt<br>Richtung des Winds.</li>
|
||||
<li>windSpeed, gustSpeed<br>Windgeschwindigkeit.</li>
|
||||
<li>airPressure<br>Luftdruck in hPa</li>
|
||||
<li>airPressureString<br>Luftdruck in hPa als Zeichenkette</li>
|
||||
</ul>
|
||||
<br>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user