diff --git a/CHANGED b/CHANGED index 3d8c619..9ccedc0 100644 --- a/CHANGED +++ b/CHANGED @@ -1 +1 @@ - add ventil check + first step state diff --git a/FHEM/74_GardenaSmartDevice.pm b/FHEM/74_GardenaSmartDevice.pm index 34c9c2d..51444fa 100644 --- a/FHEM/74_GardenaSmartDevice.pm +++ b/FHEM/74_GardenaSmartDevice.pm @@ -884,14 +884,11 @@ sub setState { if ( AttrVal( $name, "extendedState", 0 ) == 1) { ### ic24 if ( AttrVal( $name, 'model', 'unknown' ) eq 'ic24' ){ - my @ic24opened_ventils; - my $opened_ventils = 0; # bit maker + my @ic24opened_ventils; my $state_string = ''; my $nearst_irrigation = '2999-12-12 24:00'; my $has_scheduling = false; my @valves_connected = split(',', ReadingsVal( $name, 'ic24-valves_connected', '')); - for (@valves_connected){ - ## calc bit wise 1 - 6 dec => 1 - 63 dec ( 11 1111 ) - $opened_ventils=$opened_ventils+(2**$zahl) if ( $zahl > 0 ); + for (@valves_connected){ ## add to opened ventils, if watering active push @ic24opened_ventils, $_ if ( ( ( ReadingsVal( $name, "watering-watering_timer_".$_."_duration", 0 ) =~ m{\A[1-9]([0-9]+)?\z}xms ) ? $_ : 0 ) > 0 ); ## find nearst timestamp diff --git a/controls_GardenaSmartDevice.txt b/controls_GardenaSmartDevice.txt index 7953d61..18a0616 100644 --- a/controls_GardenaSmartDevice.txt +++ b/controls_GardenaSmartDevice.txt @@ -1,2 +1,2 @@ UPD 2022-05-28_13:13:38 49520 FHEM/73_GardenaSmartBridge.pm -UPD 2022-06-10_20:21:02 67143 FHEM/74_GardenaSmartDevice.pm +UPD 2022-06-10_20:24:37 66965 FHEM/74_GardenaSmartDevice.pm