From d3020ded2c194b5d21ea5150a1b56c67dbba2d0c Mon Sep 17 00:00:00 2001 From: Sebastian Date: Thu, 23 Jun 2022 12:45:31 +0200 Subject: [PATCH] [alpha] - extendetState - irrigation stuff --- CHANGED | 2 +- FHEM/74_GardenaSmartDevice.pm | 34 ++++++++++++++++----------------- controls_GardenaSmartDevice.txt | 2 +- 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/CHANGED b/CHANGED index e4fe25a..6b83971 100644 --- a/CHANGED +++ b/CHANGED @@ -1 +1 @@ - fix + debugg diff --git a/FHEM/74_GardenaSmartDevice.pm b/FHEM/74_GardenaSmartDevice.pm index d3fc8a5..7ae31ab 100644 --- a/FHEM/74_GardenaSmartDevice.pm +++ b/FHEM/74_GardenaSmartDevice.pm @@ -757,29 +757,29 @@ sub WriteReadings { . $propertie->{name} . '_irrigation_left', sprintf("%.f" , - Time::Piece::localtime->strptime( + (Time::Piece::localtime->strptime( RigReadingsValue($hash, $propertie->{timestamp}), "%Y-%m-%d %H:%M:%S") - + ($propertie->{value}{duration} - 3 ) - Time::Piece::localtime->new ) + + ($propertie->{value}{duration} + 3 ) - Time::Piece::localtime->new) / 60 ) ) if ( defined( $propertie->{value} ) && $decode_json->{abilities}[$abilities]{name} eq 'watering' && $propertie->{value}{duration} > 0 ); - if ( defined( $propertie->{value} ) - && $decode_json->{abilities}[$abilities]{name} eq 'watering' - && $propertie->{value}{duration} > 0 ){ - Log3 $name, 2, "[DDebug] " . Time::Piece::localtime->strptime( - RigReadingsValue($hash, $propertie->{timestamp}), "%Y-%m-%d %H:%M:%S"); - my $dt = Time::Piece::localtime->strptime( RigReadingsValue($hash, $propertie->{timestamp}), "%Y-%m-%d %H:%M:%S"); - Log3 $name, 2, "[DEBUG] $dt"; - my $ndt = Time::Piece::localtime->new; - Log3 $name, 2, "[cDEBUG] $ndt"; - Log3 $name, 2, "[aDEBUG] " . ($propertie->{value}{duration} + 3 ); - Log3 $name, 2, "[sDEBUG] " . sprintf("%.f" , - Time::Piece::localtime->strptime( - RigReadingsValue($hash, $propertie->{timestamp}), "%Y-%m-%d %H:%M:%S") - + ($propertie->{value}{duration} - 6 ) - Time::Piece::localtime->new ); - } + # if ( defined( $propertie->{value} ) + # && $decode_json->{abilities}[$abilities]{name} eq 'watering' + # && $propertie->{value}{duration} > 0 ){ + # Log3 $name, 2, "[DDebug] " . Time::Piece::localtime->strptime( + # RigReadingsValue($hash, $propertie->{timestamp}), "%Y-%m-%d %H:%M:%S"); + # my $dt = Time::Piece::localtime->strptime( RigReadingsValue($hash, $propertie->{timestamp}), "%Y-%m-%d %H:%M:%S"); + # Log3 $name, 2, "[DEBUG] $dt"; + # my $ndt = Time::Piece::localtime->new; + # Log3 $name, 2, "[cDEBUG] $ndt"; + # Log3 $name, 2, "[aDEBUG] " . ($propertie->{value}{duration} + 3 ); + # Log3 $name, 2, "[sDEBUG] " . sprintf("%.f" , + # Time::Piece::localtime->strptime( + # RigReadingsValue($hash, $propertie->{timestamp}), "%Y-%m-%d %H:%M:%S") + # + ($propertie->{value}{duration} + 3 ) - Time::Piece::localtime->new ); + # } #2022-06-21T08:56:42.488Z -> 2022-06-21 08:56:48 diff --git a/controls_GardenaSmartDevice.txt b/controls_GardenaSmartDevice.txt index 60cfaeb..75ef282 100644 --- a/controls_GardenaSmartDevice.txt +++ b/controls_GardenaSmartDevice.txt @@ -1,2 +1,2 @@ UPD 2022-06-21_08:17:57 49520 FHEM/73_GardenaSmartBridge.pm -UPD 2022-06-23_12:41:15 71382 FHEM/74_GardenaSmartDevice.pm +UPD 2022-06-23_12:44:35 71419 FHEM/74_GardenaSmartDevice.pm