mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-03-03 16:56:54 +00:00
WMBUS: new attribute rawmsg_as_reading
git-svn-id: https://svn.fhem.de/fhem/trunk@7619 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
dbb938146b
commit
f688104a8a
@ -32,6 +32,7 @@ sub WMBUS_Initialize($) {
|
|||||||
$hash->{AttrList} = "IODev".
|
$hash->{AttrList} = "IODev".
|
||||||
" AESkey".
|
" AESkey".
|
||||||
" ignore:0,1".
|
" ignore:0,1".
|
||||||
|
" rawmsg_as_reading:0,1".
|
||||||
" $readingFnAttributes";
|
" $readingFnAttributes";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -290,6 +291,9 @@ sub WMBUS_SetReadings($$$)
|
|||||||
readingsBulkUpdate($hash, "$dataBlock->{number}_value", $dataBlock->{value});
|
readingsBulkUpdate($hash, "$dataBlock->{number}_value", $dataBlock->{value});
|
||||||
readingsBulkUpdate($hash, "$dataBlock->{number}_unit", $dataBlock->{unit});
|
readingsBulkUpdate($hash, "$dataBlock->{number}_unit", $dataBlock->{unit});
|
||||||
readingsBulkUpdate($hash, "$dataBlock->{number}_value_type", $dataBlock->{functionFieldText});
|
readingsBulkUpdate($hash, "$dataBlock->{number}_value_type", $dataBlock->{functionFieldText});
|
||||||
|
if (defined($dataBlock->{extension})) {
|
||||||
|
readingsBulkUpdate($hash, "$dataBlock->{number}_extension", $dataBlock->{extension});
|
||||||
|
}
|
||||||
if ($dataBlock->{errormsg}) {
|
if ($dataBlock->{errormsg}) {
|
||||||
readingsBulkUpdate($hash, "$dataBlock->{number}_errormsg", $dataBlock->{errormsg});
|
readingsBulkUpdate($hash, "$dataBlock->{number}_errormsg", $dataBlock->{errormsg});
|
||||||
}
|
}
|
||||||
@ -307,6 +311,10 @@ sub WMBUS_SetReadings($$$)
|
|||||||
readingsBulkUpdate($hash, "state", 'decryption failed');
|
readingsBulkUpdate($hash, "state", 'decryption failed');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (AttrVal($name, "rawmsg_as_reading", 0)) {
|
||||||
|
readingsBulkUpdate($hash, "rawmsg", unpack("H*",$mb->{msg}));
|
||||||
|
}
|
||||||
|
|
||||||
readingsEndUpdate($hash,1);
|
readingsEndUpdate($hash,1);
|
||||||
|
|
||||||
return @list;
|
return @list;
|
||||||
@ -448,9 +456,12 @@ WMBUS_Attr(@)
|
|||||||
</li><br>
|
</li><br>
|
||||||
<li>AESKey<br>
|
<li>AESKey<br>
|
||||||
A 16 byte AES-Key in hexadecimal digits. Used to decrypt messages from meters which have encryption enabled.
|
A 16 byte AES-Key in hexadecimal digits. Used to decrypt messages from meters which have encryption enabled.
|
||||||
</li>
|
</li><br>
|
||||||
<li>
|
<li>
|
||||||
<a href="#ignore">ignore</a>
|
<a href="#ignore">ignore</a>
|
||||||
|
</li><br>
|
||||||
|
<li>rawmsg_as_reading<br>
|
||||||
|
If set to 1, received raw messages will be stored in the reading rawmsg. This can be used to log raw messages to help with debugging.
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<br>
|
<br>
|
||||||
@ -463,7 +474,7 @@ WMBUS_Attr(@)
|
|||||||
The readings are generated in blocks starting with block 1. A meter can send several data blocks.
|
The readings are generated in blocks starting with block 1. A meter can send several data blocks.
|
||||||
Each block has at least a type, a value and a unit, e.g. for an electricity meter it might look like<br>
|
Each block has at least a type, a value and a unit, e.g. for an electricity meter it might look like<br>
|
||||||
<ul>
|
<ul>
|
||||||
<code>1_type VIF_ELECTRIC_ENERGY</code><br>
|
<code>1_type VIF_ENERGY_WATT</code><br>
|
||||||
<code>1_unit Wh</code><br>
|
<code>1_unit Wh</code><br>
|
||||||
<code>1_value 2948787</code><br>
|
<code>1_value 2948787</code><br>
|
||||||
</ul>
|
</ul>
|
||||||
@ -554,11 +565,14 @@ WMBUS_Attr(@)
|
|||||||
<li>AESKey<br>
|
<li>AESKey<br>
|
||||||
Ein 16 Bytes langer AES-Schlüssel in hexadezimaler Schreibweise. Wird verwendet um Nachrichten von Zählern zu entschlüsseln bei denen
|
Ein 16 Bytes langer AES-Schlüssel in hexadezimaler Schreibweise. Wird verwendet um Nachrichten von Zählern zu entschlüsseln bei denen
|
||||||
die Verschlüsselung aktiviert ist.
|
die Verschlüsselung aktiviert ist.
|
||||||
</li>
|
</li><br>
|
||||||
<li>
|
<li>
|
||||||
<a href="#ignore">ignore</a>
|
<a href="#ignore">ignore</a>
|
||||||
|
</li><br>
|
||||||
|
<li>rawmsg_as_reading<br>
|
||||||
|
If set to 1, received raw messages will be stored in the reading rawmsg. This can be used to log raw messages to help with debugging.
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<br>
|
<br>
|
||||||
<a name="WMBUSreadings"></a>
|
<a name="WMBUSreadings"></a>
|
||||||
<b>Readings</b><br>
|
<b>Readings</b><br>
|
||||||
@ -570,7 +584,7 @@ WMBUS_Attr(@)
|
|||||||
Die Readings werden als Block dargestellt, beginnend mit Block 1. Ein Zähler kann mehrere Blöcke senden.
|
Die Readings werden als Block dargestellt, beginnend mit Block 1. Ein Zähler kann mehrere Blöcke senden.
|
||||||
Jeder Block enthält zumindest einen Typ, einen Wert und eine Einheit. Für einen Elektrizitätszähler könnte das z. B. so aussehen<br>
|
Jeder Block enthält zumindest einen Typ, einen Wert und eine Einheit. Für einen Elektrizitätszähler könnte das z. B. so aussehen<br>
|
||||||
<ul>
|
<ul>
|
||||||
<code>1_type VIF_ELECTRIC_ENERGY</code><br>
|
<code>1_type VIF_ENERGY_WATT</code><br>
|
||||||
<code>1_unit Wh</code><br>
|
<code>1_unit Wh</code><br>
|
||||||
<code>1_value 2948787</code><br>
|
<code>1_value 2948787</code><br>
|
||||||
</ul>
|
</ul>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user