2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-02-28 02:44:53 +00:00

30_tradfri.pm: added createEventTimestampReading attribute

git-svn-id: https://svn.fhem.de/fhem/trunk@25768 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
justme-1968 2022-03-03 20:40:32 +00:00
parent ed0b2a1c90
commit 16dde85aee

@ -51,6 +51,7 @@ tradfri_Initialize($)
"tradfriFHEM-securityCode ". "tradfriFHEM-securityCode ".
"tradfriFHEM-sshHost tradfriFHEM-sshUser ". "tradfriFHEM-sshHost tradfriFHEM-sshUser ".
"disable:1 disabledForIntervals ". "disable:1 disabledForIntervals ".
"createEventTimestampReading:1,0 ".
"createGroupReadings:1,0 ". "createGroupReadings:1,0 ".
$readingFnAttributes; $readingFnAttributes;
@ -191,6 +192,10 @@ tradfri_processEvent($$) {
my ($hash,$decoded) = @_; my ($hash,$decoded) = @_;
my $name = $hash->{NAME}; my $name = $hash->{NAME};
if( defined(my $create = AttrVal($name,'createEventTimestampReading',undef )) ) {
readingsSingleUpdate($hash, 'event', 'timestamp', $create ) if( $create );
}
my $id = $decoded->{id} ; my $id = $decoded->{id} ;
if( $decoded->{r} eq 'scene' ) { if( $decoded->{r} eq 'scene' ) {
@ -720,6 +725,16 @@ tradfri_Attr($$$)
The command to use as tradfri-fhem</li> The command to use as tradfri-fhem</li>
<li>tradfriFHEM-params<br> <li>tradfriFHEM-params<br>
Additional tradfri-fhem cmdline params.</li> Additional tradfri-fhem cmdline params.</li>
<a id="tradfri-attr-createEventTimestampReading"></a><li>createEventTimestampReading<br>
timestamp reading for every event received<br>
0 -> update reading without fhem event<br>
1 -> update reading with fhem event<br>
undef -> don't create reading</li>
<a id="tradfri-attr-createGroupReadings"></a><li>createGroupReadings<br>
create 'artificial' readings for group devices.<br>
0 -> create readings only for group devices where createGroupReadings ist set to 1<br>
1 -> create readings for all group devices where createGroupReadings ist not set or set to 1<br>
undef -> do nothing</li>
</ul> </ul>
</ul><br> </ul><br>