diff --git a/fhem/FHEM/70_LaMetric2.pm b/fhem/FHEM/70_LaMetric2.pm index 68c497061..61f4d7cdb 100644 --- a/fhem/FHEM/70_LaMetric2.pm +++ b/fhem/FHEM/70_LaMetric2.pm @@ -267,7 +267,7 @@ sub LaMetric2_Define($$) { $hash->{HOST} = $host; $hash->{".API_KEY"} = $apikey; - $hash->{VERSION} = "2.2.1"; + $hash->{VERSION} = "2.2.2"; $hash->{INTERVAL} = $interval && looks_like_number($interval) ? $interval : 60; $hash->{PORT} = $port && looks_like_number($port) ? $port : 4343; @@ -1589,7 +1589,7 @@ sub LaMetric2_SetNotification { my $str = $h->{chart}; $str =~ s/[^\d,.]//g; foreach ( split( /,/, $str ) ) { - push @{ $values{chart} }, round( $_, 0 ); + push @{ $values{chart}{chartData} }, round( $_, 0 ); } # take object+model defaults for this frame type @@ -1971,7 +1971,13 @@ sub LaMetric2_SetNotification { text => "", index => $index++, } - ); + ) + + # only if there is no other + # non-text frame afterwards + if ( !defined( $values{metric} ) + && !defined( $values{chart} ) + && !defined( $values{goal} ) ); } # regular frames @@ -2021,10 +2027,9 @@ sub LaMetric2_SetNotification { if ( $values{chart} ) { $values{chart}{index} = $index++; - push @{ $notification{model}{frames} }, - ( { chartData => $values{chart} } ); + push @{ $notification{model}{frames} }, $values{chart}; readingsBulkUpdate( $hash, "lastChart", - join( ',', @{ $values{chart} } ) ); + join( ',', @{ $values{chart}{chartData} } ) ); } readingsEndUpdate( $hash, 1 ); @@ -2220,7 +2225,7 @@ sub LaMetric2_IsDuringTimeframe($$;$) { metric* - type: n/a - All other options described for the metric-setter can be used here by adding the prefix 'metric' to it.

app - type: text - app_name to push this message to that particular app. Requires matching token parameter (see below).
- token - type: text - Private access token to be used when pushing data to an app. Can be retreived from developer.lametric.com/applications/app/<app_number> of the corresponding app.
+ token - type: text - Private access token to be used when pushing data to an app. Can be retrieved from developer.lametric.com/applications/app/<app_number> of the corresponding app.

Examples: