mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-01-31 12:49:34 +00:00
50_MOBILEALERTSGW.pm: Fix config with no gateway
51_MOBILEALERTS.pm: Add MA 10860 git-svn-id: https://svn.fhem.de/fhem/trunk@26393 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
9a3fc7d8cb
commit
9306d2b71e
@ -1,5 +1,6 @@
|
|||||||
# Add changes at the top of the list. Keep it in ASCII, and 80-char wide.
|
# 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.
|
# Do not insert empty lines here, update check depends on it.
|
||||||
|
- feature: 51_MOBILEALERTS: Add MA 10860
|
||||||
- change: 93_DbRep: NOTE: !! syntax of set ... changeValue" is changed !!
|
- change: 93_DbRep: NOTE: !! syntax of set ... changeValue" is changed !!
|
||||||
- feature: 10_RHASSPY: new module for Rhasspy integration (from contrib)
|
- feature: 10_RHASSPY: new module for Rhasspy integration (from contrib)
|
||||||
- bugfix: 73_AutoShuttersControl: fix can't locate object method after update
|
- bugfix: 73_AutoShuttersControl: fix can't locate object method after update
|
||||||
|
@ -97,7 +97,12 @@ sub MOBILEALERTSGW_Get ($$@) {
|
|||||||
my $destpaddr;
|
my $destpaddr;
|
||||||
my $command;
|
my $command;
|
||||||
|
|
||||||
if ( $gateway =~ /(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})/ ) {
|
if ( !defined($gateway)) {
|
||||||
|
$gateway = "000000000000";
|
||||||
|
$destpaddr = sockaddr_in( 8003, INADDR_BROADCAST );
|
||||||
|
$command = 1;
|
||||||
|
}
|
||||||
|
elsif ( $gateway =~ /(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})/ ) {
|
||||||
$destpaddr = sockaddr_in( 8003, inet_aton($gateway) );
|
$destpaddr = sockaddr_in( 8003, inet_aton($gateway) );
|
||||||
$gateway = "000000000000";
|
$gateway = "000000000000";
|
||||||
$command = 1;
|
$command = 1;
|
||||||
|
@ -256,7 +256,7 @@ sub MOBILEALERTS_Parse ($$) {
|
|||||||
if ( defined &$sub ) {
|
if ( defined &$sub ) {
|
||||||
|
|
||||||
#no strict "refs";
|
#no strict "refs";
|
||||||
&{ \&$sub }( $hash, substr $message, 12, $packageLength - 12 );
|
&{ \&$sub }( $hash, substr($message, 12, $packageLength - 12), substr($message, 12));
|
||||||
|
|
||||||
#use strict "refs";
|
#use strict "refs";
|
||||||
MOBILEALERTS_readingsBulkUpdate( $hash, 0, "lastMsg",
|
MOBILEALERTS_readingsBulkUpdate( $hash, 0, "lastMsg",
|
||||||
@ -305,14 +305,14 @@ sub MOBILEALERTS_Parse ($$) {
|
|||||||
return $res;
|
return $res;
|
||||||
}
|
}
|
||||||
|
|
||||||
sub MOBILEALERTS_Parse_02_ce ($$) {
|
sub MOBILEALERTS_Parse_02_ce ($$$) {
|
||||||
my ( $hash, $message ) = @_;
|
my ( $hash, $message, $messagefull ) = @_;
|
||||||
MOBILEALERTS_readingsBulkUpdateIfChanged( $hash, 0, "deviceType",
|
MOBILEALERTS_readingsBulkUpdateIfChanged( $hash, 0, "deviceType",
|
||||||
"MA10100/MA10101" );
|
"MA10100/MA10101" );
|
||||||
MOBILEALERTS_Parse_ce( $hash, $message );
|
MOBILEALERTS_Parse_ce( $hash, $message, $messagefull );
|
||||||
}
|
}
|
||||||
|
|
||||||
sub MOBILEALERTS_Parse_15_ce ($$) {
|
sub MOBILEALERTS_Parse_15_ce ($$$) {
|
||||||
my ( $hash, $message ) = @_;
|
my ( $hash, $message ) = @_;
|
||||||
MOBILEALERTS_readingsBulkUpdateIfChanged( $hash, 0, "deviceType",
|
MOBILEALERTS_readingsBulkUpdateIfChanged( $hash, 0, "deviceType",
|
||||||
"MA10880" );
|
"MA10880" );
|
||||||
@ -373,7 +373,7 @@ sub MOBILEALERTS_Parse_15_ce ($$) {
|
|||||||
"$channel $state_name" );
|
"$channel $state_name" );
|
||||||
}
|
}
|
||||||
|
|
||||||
sub MOBILEALERTS_Parse_ce ($$) {
|
sub MOBILEALERTS_Parse_ce ($$$) {
|
||||||
my ( $hash, $message ) = @_;
|
my ( $hash, $message ) = @_;
|
||||||
my ( $txCounter, $temperature, $prevTemperature ) =
|
my ( $txCounter, $temperature, $prevTemperature ) =
|
||||||
unpack( "nnn", $message );
|
unpack( "nnn", $message );
|
||||||
@ -397,7 +397,7 @@ sub MOBILEALERTS_Parse_ce ($$) {
|
|||||||
MOBILEALERTS_readingsBulkUpdate( $hash, 0, "state", "T: " . $temperature );
|
MOBILEALERTS_readingsBulkUpdate( $hash, 0, "state", "T: " . $temperature );
|
||||||
}
|
}
|
||||||
|
|
||||||
sub MOBILEALERTS_Parse_0f_d2 ($$) {
|
sub MOBILEALERTS_Parse_0f_d2 ($$$) {
|
||||||
my ( $hash, $message ) = @_;
|
my ( $hash, $message ) = @_;
|
||||||
my ( $txCounter, $temperatureIn, $temperatureOut, $prevTemperatureIn,
|
my ( $txCounter, $temperatureIn, $temperatureOut, $prevTemperatureIn,
|
||||||
$prevTemperatureOut )
|
$prevTemperatureOut )
|
||||||
@ -436,14 +436,14 @@ sub MOBILEALERTS_Parse_0f_d2 ($$) {
|
|||||||
"In T: " . $temperatureIn . " Out T: " . $temperatureOut );
|
"In T: " . $temperatureIn . " Out T: " . $temperatureOut );
|
||||||
}
|
}
|
||||||
|
|
||||||
sub MOBILEALERTS_Parse_03_d2 ($$) {
|
sub MOBILEALERTS_Parse_03_d2 ($$$) {
|
||||||
my ( $hash, $message ) = @_;
|
my ( $hash, $message, $messagefull ) = @_;
|
||||||
MOBILEALERTS_readingsBulkUpdateIfChanged( $hash, 0, "deviceType",
|
MOBILEALERTS_readingsBulkUpdateIfChanged( $hash, 0, "deviceType",
|
||||||
"MA10200" );
|
"MA10200" );
|
||||||
MOBILEALERTS_Parse_d2( $hash, $message );
|
MOBILEALERTS_Parse_d2( $hash, $message, $messagefull );
|
||||||
}
|
}
|
||||||
|
|
||||||
sub MOBILEALERTS_Parse_d2 ($$) {
|
sub MOBILEALERTS_Parse_d2 ($$$) {
|
||||||
my ( $hash, $message ) = @_;
|
my ( $hash, $message ) = @_;
|
||||||
my ( $txCounter, $temperature, $humidity, $prevTemperature, $prevHumidity )
|
my ( $txCounter, $temperature, $humidity, $prevTemperature, $prevHumidity )
|
||||||
= unpack( "nnnnn", $message );
|
= unpack( "nnnnn", $message );
|
||||||
@ -476,14 +476,14 @@ sub MOBILEALERTS_Parse_d2 ($$) {
|
|||||||
"T: " . $temperature . " H: " . $humidity );
|
"T: " . $temperature . " H: " . $humidity );
|
||||||
}
|
}
|
||||||
|
|
||||||
sub MOBILEALERTS_Parse_04_d4 ($$) {
|
sub MOBILEALERTS_Parse_04_d4 ($$$) {
|
||||||
my ( $hash, $message ) = @_;
|
my ( $hash, $message, $messagefull ) = @_;
|
||||||
MOBILEALERTS_readingsBulkUpdateIfChanged( $hash, 0, "deviceType",
|
MOBILEALERTS_readingsBulkUpdateIfChanged( $hash, 0, "deviceType",
|
||||||
"MA10350" );
|
"MA10350" );
|
||||||
MOBILEALERTS_Parse_d4( $hash, $message );
|
MOBILEALERTS_Parse_d4( $hash, $message, $messagefull );
|
||||||
}
|
}
|
||||||
|
|
||||||
sub MOBILEALERTS_Parse_d4 ($$) {
|
sub MOBILEALERTS_Parse_d4 ($$$) {
|
||||||
my ( $hash, $message ) = @_;
|
my ( $hash, $message ) = @_;
|
||||||
my ( $txCounter, $temperature, $humidity, $wetness,
|
my ( $txCounter, $temperature, $humidity, $wetness,
|
||||||
$prevTemperature, $prevHumidity, $prevWetness )
|
$prevTemperature, $prevHumidity, $prevWetness )
|
||||||
@ -521,7 +521,7 @@ sub MOBILEALERTS_Parse_d4 ($$) {
|
|||||||
"T: " . $temperature . " H: " . $humidity . " " . $wetness );
|
"T: " . $temperature . " H: " . $humidity . " " . $wetness );
|
||||||
}
|
}
|
||||||
|
|
||||||
sub MOBILEALERTS_Parse_05_da ($$) {
|
sub MOBILEALERTS_Parse_05_da ($$$) {
|
||||||
my ( $hash, $message ) = @_;
|
my ( $hash, $message ) = @_;
|
||||||
MOBILEALERTS_readingsBulkUpdateIfChanged( $hash, 0, "deviceType",
|
MOBILEALERTS_readingsBulkUpdateIfChanged( $hash, 0, "deviceType",
|
||||||
"WL2000" );
|
"WL2000" );
|
||||||
@ -579,14 +579,14 @@ sub MOBILEALERTS_Parse_05_da ($$) {
|
|||||||
. $co2 );
|
. $co2 );
|
||||||
}
|
}
|
||||||
|
|
||||||
sub MOBILEALERTS_Parse_07_da ($$) {
|
sub MOBILEALERTS_Parse_07_da ($$$) {
|
||||||
my ( $hash, $message ) = @_;
|
my ( $hash, $message, $messagefull ) = @_;
|
||||||
MOBILEALERTS_readingsBulkUpdateIfChanged( $hash, 0, "deviceType",
|
MOBILEALERTS_readingsBulkUpdateIfChanged( $hash, 0, "deviceType",
|
||||||
"MA10410" );
|
"MA10410" );
|
||||||
MOBILEALERTS_Parse_da( $hash, $message );
|
MOBILEALERTS_Parse_da( $hash, $message, $messagefull );
|
||||||
}
|
}
|
||||||
|
|
||||||
sub MOBILEALERTS_Parse_da ($$) {
|
sub MOBILEALERTS_Parse_da ($$$) {
|
||||||
my ( $hash, $message ) = @_;
|
my ( $hash, $message ) = @_;
|
||||||
my (
|
my (
|
||||||
$txCounter, $temperatureIn, $humidityIn,
|
$txCounter, $temperatureIn, $humidityIn,
|
||||||
@ -632,7 +632,7 @@ sub MOBILEALERTS_Parse_da ($$) {
|
|||||||
. $humidityOut );
|
. $humidityOut );
|
||||||
}
|
}
|
||||||
|
|
||||||
sub MOBILEALERTS_Parse_18_e0 ($$) {
|
sub MOBILEALERTS_Parse_18_e0 ($$$) {
|
||||||
my ( $hash, $message ) = @_;
|
my ( $hash, $message ) = @_;
|
||||||
my ( $txCounter, $txCounter2, $temperature, $humidity, $airPressure ) =
|
my ( $txCounter, $txCounter2, $temperature, $humidity, $airPressure ) =
|
||||||
unpack( "nCnCn", $message );
|
unpack( "nCnCn", $message );
|
||||||
@ -665,14 +665,14 @@ sub MOBILEALERTS_Parse_18_e0 ($$) {
|
|||||||
"T: " . $temperature . " H: " . $humidity . " A: " . $airPressure );
|
"T: " . $temperature . " H: " . $humidity . " A: " . $airPressure );
|
||||||
}
|
}
|
||||||
|
|
||||||
sub MOBILEALERTS_Parse_08_e1 ($$) {
|
sub MOBILEALERTS_Parse_08_e1 ($$$) {
|
||||||
my ( $hash, $message ) = @_;
|
my ( $hash, $message, $messagefull ) = @_;
|
||||||
MOBILEALERTS_readingsBulkUpdateIfChanged( $hash, 0, "deviceType",
|
MOBILEALERTS_readingsBulkUpdateIfChanged( $hash, 0, "deviceType",
|
||||||
"MA10650" );
|
"MA10650" );
|
||||||
MOBILEALERTS_Parse_e1( $hash, $message );
|
MOBILEALERTS_Parse_e1( $hash, $message, $messagefull );
|
||||||
}
|
}
|
||||||
|
|
||||||
sub MOBILEALERTS_Parse_e1 ($$) {
|
sub MOBILEALERTS_Parse_e1 ($$$) {
|
||||||
my ( $hash, $message ) = @_;
|
my ( $hash, $message ) = @_;
|
||||||
my @eventTime;
|
my @eventTime;
|
||||||
( my ( $txCounter, $temperature, $eventCounter ), @eventTime[ 0 .. 8 ] ) =
|
( my ( $txCounter, $temperature, $eventCounter ), @eventTime[ 0 .. 8 ] ) =
|
||||||
@ -735,14 +735,14 @@ sub MOBILEALERTS_Parse_e1 ($$) {
|
|||||||
"T: " . $temperature . " C: " . $eventCounter );
|
"T: " . $temperature . " C: " . $eventCounter );
|
||||||
}
|
}
|
||||||
|
|
||||||
sub MOBILEALERTS_Parse_0b_e2 ($$) {
|
sub MOBILEALERTS_Parse_0b_e2 ($$$) {
|
||||||
my ( $hash, $message ) = @_;
|
my ( $hash, $message, $messagefull ) = @_;
|
||||||
MOBILEALERTS_readingsBulkUpdateIfChanged( $hash, 0, "deviceType",
|
MOBILEALERTS_readingsBulkUpdateIfChanged( $hash, 0, "deviceType",
|
||||||
"MA10660" );
|
"MA10660" );
|
||||||
MOBILEALERTS_Parse_e2( $hash, $message );
|
MOBILEALERTS_Parse_e2( $hash, $message, $messagefull );
|
||||||
}
|
}
|
||||||
|
|
||||||
sub MOBILEALERTS_Parse_e2 ($$) {
|
sub MOBILEALERTS_Parse_e2 ($$$) {
|
||||||
my ( $hash, $message ) = @_;
|
my ( $hash, $message ) = @_;
|
||||||
my @dirTable = (
|
my @dirTable = (
|
||||||
"N", "NNE", "NE", "ENE", "E", "ESE", "SE", "SSE",
|
"N", "NNE", "NE", "ENE", "E", "ESE", "SE", "SSE",
|
||||||
@ -771,14 +771,14 @@ sub MOBILEALERTS_Parse_e2 ($$) {
|
|||||||
"D: " . $dirTable[$dir] . " W: " . $windSpeed . " G: " . $gustSpeed );
|
"D: " . $dirTable[$dir] . " W: " . $windSpeed . " G: " . $gustSpeed );
|
||||||
}
|
}
|
||||||
|
|
||||||
sub MOBILEALERTS_Parse_0e_d8 ($$) {
|
sub MOBILEALERTS_Parse_0e_d8 ($$$) {
|
||||||
my ( $hash, $message ) = @_;
|
my ( $hash, $message, $messagefull ) = @_;
|
||||||
MOBILEALERTS_readingsBulkUpdateIfChanged( $hash, 0, "deviceType",
|
MOBILEALERTS_readingsBulkUpdateIfChanged( $hash, 0, "deviceType",
|
||||||
"TFA30.3312.02" );
|
"TFA30.3312.02" );
|
||||||
MOBILEALERTS_Parse_d8( $hash, $message );
|
MOBILEALERTS_Parse_d8( $hash, $message, $messagefull );
|
||||||
}
|
}
|
||||||
|
|
||||||
sub MOBILEALERTS_Parse_d8 ($$) {
|
sub MOBILEALERTS_Parse_d8 ($$$) {
|
||||||
my ( $hash, $message ) = @_;
|
my ( $hash, $message ) = @_;
|
||||||
my (
|
my (
|
||||||
$txCounter, $temperature, $humidity, $prevTemperature,
|
$txCounter, $temperature, $humidity, $prevTemperature,
|
||||||
@ -822,14 +822,14 @@ sub MOBILEALERTS_Parse_d8 ($$) {
|
|||||||
"T: " . $temperature . " H: " . $humidity );
|
"T: " . $temperature . " H: " . $humidity );
|
||||||
}
|
}
|
||||||
|
|
||||||
sub MOBILEALERTS_Parse_10_d3 ($$) {
|
sub MOBILEALERTS_Parse_10_d3 ($$$) {
|
||||||
my ( $hash, $message ) = @_;
|
my ( $hash, $message, $messagefull ) = @_;
|
||||||
MOBILEALERTS_readingsBulkUpdateIfChanged( $hash, 0, "deviceType",
|
MOBILEALERTS_readingsBulkUpdateIfChanged( $hash, 0, "deviceType",
|
||||||
"MA10800" );
|
"MA10800" );
|
||||||
MOBILEALERTS_Parse_d3( $hash, $message );
|
MOBILEALERTS_Parse_d3( $hash, $message, $messagefull );
|
||||||
}
|
}
|
||||||
|
|
||||||
sub MOBILEALERTS_Parse_d3 ($$) {
|
sub MOBILEALERTS_Parse_d3 ($$$) {
|
||||||
my ( $hash, $message ) = @_;
|
my ( $hash, $message ) = @_;
|
||||||
my @data;
|
my @data;
|
||||||
( my ($txCounter), @data[ 0 .. 3 ] ) = unpack( "nnnnn", $message );
|
( my ($txCounter), @data[ 0 .. 3 ] ) = unpack( "nnnnn", $message );
|
||||||
@ -861,14 +861,14 @@ sub MOBILEALERTS_Parse_d3 ($$) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
sub MOBILEALERTS_Parse_12_d9 ($$) {
|
sub MOBILEALERTS_Parse_12_d9 ($$$) {
|
||||||
my ( $hash, $message ) = @_;
|
my ( $hash, $message, $messagefull ) = @_;
|
||||||
MOBILEALERTS_readingsBulkUpdateIfChanged( $hash, 0, "deviceType",
|
MOBILEALERTS_readingsBulkUpdateIfChanged( $hash, 0, "deviceType",
|
||||||
"MA10230" );
|
"MA10230" );
|
||||||
MOBILEALERTS_Parse_d9( $hash, $message );
|
MOBILEALERTS_Parse_d9( $hash, $message, $messagefull );
|
||||||
}
|
}
|
||||||
|
|
||||||
sub MOBILEALERTS_Parse_d9 ($$) {
|
sub MOBILEALERTS_Parse_d9 ($$$) {
|
||||||
my ( $hash, $message ) = @_;
|
my ( $hash, $message ) = @_;
|
||||||
my (
|
my (
|
||||||
$txCounter, $humidity3h, $humidity24h, $humidity7d,
|
$txCounter, $humidity3h, $humidity24h, $humidity7d,
|
||||||
@ -922,21 +922,21 @@ sub MOBILEALERTS_Parse_d9 ($$) {
|
|||||||
. $humidity30d );
|
. $humidity30d );
|
||||||
}
|
}
|
||||||
|
|
||||||
sub MOBILEALERTS_Parse_06_d6 ($$) {
|
sub MOBILEALERTS_Parse_06_d6 ($$$) {
|
||||||
my ( $hash, $message ) = @_;
|
my ( $hash, $message, $messagefull ) = @_;
|
||||||
MOBILEALERTS_readingsBulkUpdateIfChanged( $hash, 0, "deviceType",
|
MOBILEALERTS_readingsBulkUpdateIfChanged( $hash, 0, "deviceType",
|
||||||
"MA10300/MA10700" );
|
"MA10300/MA10700" );
|
||||||
MOBILEALERTS_Parse_d6( $hash, $message );
|
MOBILEALERTS_Parse_d6( $hash, $message, $messagefull );
|
||||||
}
|
}
|
||||||
|
|
||||||
sub MOBILEALERTS_Parse_09_d6 ($$) {
|
sub MOBILEALERTS_Parse_09_d6 ($$$) {
|
||||||
my ( $hash, $message ) = @_;
|
my ( $hash, $message, $messagefull ) = @_;
|
||||||
MOBILEALERTS_readingsBulkUpdateIfChanged( $hash, 0, "deviceType",
|
MOBILEALERTS_readingsBulkUpdateIfChanged( $hash, 0, "deviceType",
|
||||||
"MA10320PRO" );
|
"MA10320PRO" );
|
||||||
MOBILEALERTS_Parse_d6( $hash, $message );
|
MOBILEALERTS_Parse_d6( $hash, $message, $messagefull );
|
||||||
}
|
}
|
||||||
|
|
||||||
sub MOBILEALERTS_Parse_d6 ($$) {
|
sub MOBILEALERTS_Parse_d6 ($$$) {
|
||||||
my ( $hash, $message ) = @_;
|
my ( $hash, $message ) = @_;
|
||||||
my ( $txCounter, $temperatureIn, $temperatureOut, $humidityIn,
|
my ( $txCounter, $temperatureIn, $temperatureOut, $humidityIn,
|
||||||
$prevTemperatureIn, $prevTemperatureOut, $prevHumidityIn )
|
$prevTemperatureIn, $prevTemperatureOut, $prevHumidityIn )
|
||||||
@ -986,7 +986,7 @@ sub MOBILEALERTS_Parse_d6 ($$) {
|
|||||||
. $temperatureOut );
|
. $temperatureOut );
|
||||||
}
|
}
|
||||||
|
|
||||||
sub MOBILEALERTS_Parse_01_d2 ($$) {
|
sub MOBILEALERTS_Parse_01_d2 ($$$) {
|
||||||
my ( $hash, $message ) = @_;
|
my ( $hash, $message ) = @_;
|
||||||
my ( $txCounter, $temperatureIn, $temperatureOut, $prevTemperatureIn,
|
my ( $txCounter, $temperatureIn, $temperatureOut, $prevTemperatureIn,
|
||||||
$prevTemperatureOut )
|
$prevTemperatureOut )
|
||||||
@ -1025,14 +1025,14 @@ sub MOBILEALERTS_Parse_01_d2 ($$) {
|
|||||||
"In T: " . $temperatureIn . " Out T: " . $temperatureOut );
|
"In T: " . $temperatureIn . " Out T: " . $temperatureOut );
|
||||||
}
|
}
|
||||||
|
|
||||||
sub MOBILEALERTS_Parse_11_ea ($$) {
|
sub MOBILEALERTS_Parse_11_ea ($$$) {
|
||||||
my ( $hash, $message ) = @_;
|
my ( $hash, $message, $messagefull ) = @_;
|
||||||
MOBILEALERTS_readingsBulkUpdateIfChanged( $hash, 0, "deviceType",
|
MOBILEALERTS_readingsBulkUpdateIfChanged( $hash, 0, "deviceType",
|
||||||
"TFA30.3060.01.IT" );
|
"TFA30.3060.01.IT" );
|
||||||
MOBILEALERTS_Parse_ea( $hash, $message );
|
MOBILEALERTS_Parse_ea( $hash, $message, $messagefull );
|
||||||
}
|
}
|
||||||
|
|
||||||
sub MOBILEALERTS_Parse_ea ($$) {
|
sub MOBILEALERTS_Parse_ea ($$$) {
|
||||||
my ( $hash, $message ) = @_;
|
my ( $hash, $message ) = @_;
|
||||||
my (
|
my (
|
||||||
$txCounter, $temperature1, $humidity1,
|
$txCounter, $temperature1, $humidity1,
|
||||||
@ -1160,6 +1160,50 @@ sub MOBILEALERTS_Parse_ea ($$) {
|
|||||||
. $humidity3 );
|
. $humidity3 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sub MOBILEALERTS_Parse_0a_cb($$$) {
|
||||||
|
my ( $hash, $message, $messagefull ) = @_;
|
||||||
|
my ( $txCounter, $temperature ) =
|
||||||
|
unpack( "nn", $messagefull );
|
||||||
|
|
||||||
|
MOBILEALERTS_readingsBulkUpdateIfChanged( $hash, 0, "deviceType",
|
||||||
|
"MA 10860" );
|
||||||
|
|
||||||
|
# Alarm
|
||||||
|
my $alarm_ch1 = "off";
|
||||||
|
my $alarm_ch2 = "off";
|
||||||
|
my $alarm_ch3 = "off";
|
||||||
|
my $alarm_ch4 = "off";
|
||||||
|
$alarm_ch1 = "on" if( ($temperature & 0x8000) == 0x8000);
|
||||||
|
$alarm_ch2 = "on" if( ($temperature & 0x4000) == 0x4000);
|
||||||
|
$alarm_ch3 = "on" if( ($temperature & 0x2000) == 0x2000);
|
||||||
|
$alarm_ch4 = "on" if( ($temperature & 0x1000) == 0x1000);
|
||||||
|
|
||||||
|
MOBILEALERTS_readingsBulkUpdate( $hash, 0, "alarm1", $alarm_ch1);
|
||||||
|
MOBILEALERTS_readingsBulkUpdate( $hash, 0, "alarm2", $alarm_ch2);
|
||||||
|
MOBILEALERTS_readingsBulkUpdate( $hash, 0, "alarm3", $alarm_ch3);
|
||||||
|
MOBILEALERTS_readingsBulkUpdate( $hash, 0, "alarm4", $alarm_ch4);
|
||||||
|
# Oberen Bits werden fuer Alarm benutzt
|
||||||
|
$temperature = $temperature & 0x0fff;
|
||||||
|
|
||||||
|
# txCounter
|
||||||
|
MOBILEALERTS_readingsBulkUpdate( $hash, 0, "txCounter",
|
||||||
|
MOBILEALERTS_decodeTxCounter($txCounter) );
|
||||||
|
MOBILEALERTS_readingsBulkUpdate( $hash, 0, "triggered",
|
||||||
|
MOBILEALERTS_triggeredTxCounter($txCounter) );
|
||||||
|
MOBILEALERTS_readingsBulkUpdate( $hash, 0, "batteryState",
|
||||||
|
MOBILEALERTS_batteryStateTxCounter($txCounter) );
|
||||||
|
# temperature
|
||||||
|
$temperature =
|
||||||
|
MOBILEALERTS_decodeTemperature($temperature) +
|
||||||
|
$hash->{".corrTemperature"};
|
||||||
|
MOBILEALERTS_readingsBulkUpdate( $hash, 0, "temperature", $temperature );
|
||||||
|
MOBILEALERTS_readingsBulkUpdate( $hash, 0, "temperatureString",
|
||||||
|
MOBILEALERTS_temperatureToString($temperature) );
|
||||||
|
# state
|
||||||
|
MOBILEALERTS_readingsBulkUpdate( $hash, 0, "state", "T: " . $temperature .
|
||||||
|
" " . $alarm_ch1 . " " . $alarm_ch2 ." " . $alarm_ch3 . " " . $alarm_ch4);
|
||||||
|
}
|
||||||
|
|
||||||
sub MOBILEALERTS_decodeTxCounter($) {
|
sub MOBILEALERTS_decodeTxCounter($) {
|
||||||
my ($txCounter) = @_;
|
my ($txCounter) = @_;
|
||||||
return $txCounter & 0x3FFF;
|
return $txCounter & 0x3FFF;
|
||||||
@ -1508,7 +1552,7 @@ sub MOBILEALERTS_ActionDetector($) {
|
|||||||
The MOBILEALERTS is a fhem module for the german MobileAlerts devices and TFA WEATHERHUB devices.
|
The MOBILEALERTS is a fhem module for the german MobileAlerts devices and TFA WEATHERHUB devices.
|
||||||
<br><br>
|
<br><br>
|
||||||
The fhem module represents a MobileAlerts device. The connection is provided by the <a href="#MOBILEALERTSGW">MOBILELAERTSGW</a> module.
|
The fhem module represents a MobileAlerts device. The connection is provided by the <a href="#MOBILEALERTSGW">MOBILELAERTSGW</a> module.
|
||||||
Currently supported: 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>
|
Currently supported: MA10100, MA10101, MA10200, MA10230, MA10238, MA10300, MA10650, MA10320PRO, MA10350, MA10410, MA10450, MA10660, MA10700, TFA 30.3312.02, MA10800, WL2000, TFA30.3060.01.IT, MA10120PRO, MA10860, MA10880<br>
|
||||||
Supported but untested: ./.<br>
|
Supported but untested: ./.<br>
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
@ -1557,9 +1601,10 @@ sub MOBILEALERTS_ActionDetector($) {
|
|||||||
<li>lastEvent, lastEvent<X> ,lastEventString, lastEvent<X>String<br>Time when last event (rain) happend (MA10650 only).</li>
|
<li>lastEvent, lastEvent<X> ,lastEventString, lastEvent<X>String<br>Time when last event (rain) happend (MA10650 only).</li>
|
||||||
<li>mmRain, mmRainActHour, mmRainLastHour, mmRainActDay, mmRainYesterday<br>Rain since reset of counter, current hour, last hour, current day, yesterday.</li>
|
<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>direction, directionInt<br>Direction of wind.</li>
|
||||||
<li>windSpeed, gustSpeed<br>Windspeed.</li>
|
<li>windSpeed, gustSpeed<br>Windspeed in m/s.</li>
|
||||||
<li>airPressure<br>Barometric pressure in hPa</li>
|
<li>airPressure<br>Barometric pressure in hPa</li>
|
||||||
<li>airPressureString<br>Barometric pressure as String</li>
|
<li>airPressureString<br>Barometric pressure as String</li>
|
||||||
|
<li>alarm1, alarm2, alarm3, alarm4<br>Active Alarms (values: on/off)</li>
|
||||||
</ul>
|
</ul>
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
@ -1607,8 +1652,8 @@ sub MOBILEALERTS_ActionDetector($) {
|
|||||||
<br><br>
|
<br><br>
|
||||||
Dieses FHEM Modul stellt jeweils ein MobileAlerts Gerät dar. Die Verbindung wird durch das
|
Dieses FHEM Modul stellt jeweils ein MobileAlerts Gerät dar. Die Verbindung wird durch das
|
||||||
<a href="#MOBILEALERTSGW">MOBILELAERTSGW</a> Modul bereitgestellt.<br>
|
<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>
|
Aktuell werden unterstüzt: MA10100, MA10101, MA10200, MA10238, MA10230, MA10300, MA10650, MA10320PRO, MA10350, MA10410, MA10450, MA10660, MA10700, TFA 30.3312.02, MA10800, WL2000, TFA30.3060.01.IT, MA10120PRO, MA10860, MA10880<br>
|
||||||
Unterstüzt aber ungetestet: MA10238<br>
|
Unterstüzt aber ungetestet: ./.<br>
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
<a name="MOBILEALERTSdefine"></a>
|
<a name="MOBILEALERTSdefine"></a>
|
||||||
@ -1656,9 +1701,10 @@ sub MOBILEALERTS_ActionDetector($) {
|
|||||||
<li>lastEvent, lastEvent<X> ,lastEventString, lastEvent<X>String<br>Zeitpunkt wann das letzte Event (Regen) stattgefunden hat (nur MA10650).</li>
|
<li>lastEvent, lastEvent<X> ,lastEventString, lastEvent<X>String<br>Zeitpunkt wann das letzte Event (Regen) stattgefunden hat (nur MA10650).</li>
|
||||||
<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>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>direction, directionInt<br>Richtung des Winds.</li>
|
||||||
<li>windSpeed, gustSpeed<br>Windgeschwindigkeit.</li>
|
<li>windSpeed, gustSpeed<br>Windgeschwindigkeit in m/s.</li>
|
||||||
<li>airPressure<br>Luftdruck in hPa</li>
|
<li>airPressure<br>Luftdruck in hPa</li>
|
||||||
<li>airPressureString<br>Luftdruck in hPa als Zeichenkette</li>
|
<li>airPressureString<br>Luftdruck in hPa als Zeichenkette</li>
|
||||||
|
<li>alarm1, alarm2, alarm3, alarm4<br>Aktive Alarme (Werte: on/off)</li>
|
||||||
</ul>
|
</ul>
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user