patch_ic24 #69

Merged
marko merged 88 commits from patch_ic24 into dev 2022-07-12 17:35:25 +00:00
3 changed files with 19 additions and 17 deletions
Showing only changes of commit ae3bf5f68a - Show all commits

View File

@ -1 +1 @@
[fix] - debug stuff [fix] - debug stuff - cleanup

View File

@ -652,9 +652,9 @@ sub WriteReadings {
$hash, $hash,
$decode_json->{abilities}[$abilities]{name} . '-' $decode_json->{abilities}[$abilities]{name} . '-'
. $propertie->{name}, . $propertie->{name},
RigReadingsValue( $hash, $propertie->{value} ) ($propertie->{value} eq '') ? 'N/A' : RigReadingsValue( $hash, $propertie->{value} )
) )
if ( defined( $propertie->{value} ) if ( exists( $propertie->{value} ) # defined ignored 'value':null
&& $decode_json->{abilities}[$abilities]{name} . '-' && $decode_json->{abilities}[$abilities]{name} . '-'
. $propertie->{name} ne 'radio-quality' . $propertie->{name} ne 'radio-quality'
&& $decode_json->{abilities}[$abilities]{name} . '-' && $decode_json->{abilities}[$abilities]{name} . '-'
@ -743,8 +743,6 @@ sub WriteReadings {
. $r, . $r,
RigReadingsValue( $hash, $v ) RigReadingsValue( $hash, $v )
); );
Log3 $name, 3, "[DEBUG] - GardenaSmartDevice ($name) Ventil $propertie->{name} $r: $v";
} }
} }
# ic24 and other watering devices calc irrigation left in sec # ic24 and other watering devices calc irrigation left in sec
@ -801,8 +799,6 @@ sub WriteReadings {
# check if empty, clear scheduling-scheduled_watering_next_start_x # check if empty, clear scheduling-scheduled_watering_next_start_x
readingsBulkUpdateIfChanged( $hash, 'scheduling-'.$decode_json->{settings}[$settings]{name}, readingsBulkUpdateIfChanged( $hash, 'scheduling-'.$decode_json->{settings}[$settings]{name},
$decode_json->{settings}[$settings]{value} ); $decode_json->{settings}[$settings]{value} );
readingsBulkUpdateIfChanged( $hash, "scheduling-scheduled_watering_next_start_$1", $decode_json->{settings}[$settings]{value}) if ($decode_json->{settings}[$settings]{value} eq '');
# CommandAttr( undef, $name . " scheduling-scheduled_watering_next_start_") if ($decode_json->{settings}[$settings]{value} eq '' ) # CommandAttr( undef, $name . " scheduling-scheduled_watering_next_start_") if ($decode_json->{settings}[$settings]{value} eq '' )
} }
@ -897,20 +893,26 @@ sub setState {
push @ic24opened_ventils, $_ if ( ( ( ReadingsVal( $name, "watering-watering_timer_".$_."_duration", 0 ) =~ m{\A[1-9]([0-9]+)?\z}xms ) ? $_ : 0 ) > 0 ); push @ic24opened_ventils, $_ if ( ( ( ReadingsVal( $name, "watering-watering_timer_".$_."_duration", 0 ) =~ m{\A[1-9]([0-9]+)?\z}xms ) ? $_ : 0 ) > 0 );
## find nearst timestamp ## find nearst timestamp
#$has_scheduling = 1 if ( ReadingsVal($name, 'scheduling-schedules_paused_until_'.$_ , '') ne '2038-01-18T00:00:00.000Z' && ReadingsVal($name, 'scheduling-schedules_paused_until_'.$_ , '') eq '' ); #$has_scheduling = 1 if ( ReadingsVal($name, 'scheduling-schedules_paused_until_'.$_ , '') ne '2038-01-18T00:00:00.000Z' && ReadingsVal($name, 'scheduling-schedules_paused_until_'.$_ , '') eq '' );
$has_scheduling = 1 if ( ReadingsVal($name, 'scheduling-schedules_paused_until_'.$_ , 'N/A') eq '' ); $has_scheduling = 1 if ( ReadingsVal($name, 'scheduling-schedules_paused_until_'.$_ , '') ne '2038-01-18T00:00:00.000Z' && ReadingsVal($name, 'scheduling-schedules_paused_until_'.$_ , 'N/A') eq '' );
#$has_scheduling = 1 if ( ReadingsVal($name, 'scheduling-schedules_paused_until_'.$_ , 'N/A') eq '' );
$longest_duration = ReadingsVal( $name, "watering-watering_timer_".$_."_irrigation_left", 0 ) if ( $longest_duration = ReadingsVal( $name, "watering-watering_timer_".$_."_irrigation_left", 0 ) if (
( ReadingsVal( $name, "watering-watering_timer_".$_."_duration", 0 ) =~ m{\A[1-9]([0-9]+)?\z}xms ( ReadingsVal( $name, "watering-watering_timer_".$_."_duration", 0 ) =~ m{\A[1-9]([0-9]+)?\z}xms
&& ReadingsVal( $name, "watering-watering_timer_".$_."_duration", 0 ) > 0 && ReadingsVal( $name, "watering-watering_timer_".$_."_duration", 0 ) > 0
&& ReadingsVal( $name, "watering-watering_timer_".$_."_duration", 0 ) > $longest_duration ) ); && ReadingsVal( $name, "watering-watering_timer_".$_."_duration", 0 ) > $longest_duration ) );
if ( ReadingsVal($name, 'scheduling-scheduled_watering_next_start_'.$_, '') ne '' # if ( ReadingsVal($name, 'scheduling-scheduled_watering_next_start_'.$_, '') ne ''
&& ReadingsVal($name, 'scheduling-schedules_paused_until_'.$_ , '') ne '2038-01-18T00:00:00.000Z' ) { # && ReadingsVal($name, 'scheduling-schedules_paused_until_'.$_ , '') ne '2038-01-18T00:00:00.000Z' ) {
$nearst_irrigation = ReadingsVal($name, 'scheduling-scheduled_watering_next_start_'.$_, '') # $nearst_irrigation = ReadingsVal($name, 'scheduling-scheduled_watering_next_start', '');
if ( # $nearst_irrigation = ReadingsVal($name, 'scheduling-scheduled_watering_next_start_'.$_, '')
Time::Piece->strptime( ReadingsVal($name, 'scheduling-scheduled_watering_next_start_'.$_, ''), "%Y-%m-%d %H:%M") < Time::Piece->strptime( $nearst_irrigation, "%Y-%m-%d %H:%M") # if (
&& $has_scheduling && Time::Piece->strptime( ReadingsVal($name, 'scheduling-scheduled_watering_next_start_'.$_, ''), "%Y-%m-%d %H:%M") > Time::Piece->new # Time::Piece->strptime( ReadingsVal($name, 'scheduling-scheduled_watering_next_start_'.$_, ''), "%Y-%m-%d %H:%M") < Time::Piece->strptime( $nearst_irrigation, "%Y-%m-%d %H:%M")
) # && $has_scheduling && Time::Piece->strptime( ReadingsVal($name, 'scheduling-scheduled_watering_next_start_'.$_, ''), "%Y-%m-%d %H:%M") > Time::Piece->new
} # fi # )
# } # fi
$nearst_irrigation = ReadingsVal($name, 'scheduling-scheduled_watering_next_start', '')
if ( ReadingsVal($name, 'scheduling-scheduled_watering_next_start_'.$_, '') ne '' );
} }
# override state 4 extendedstates # override state 4 extendedstates
if ( AttrVal( $name, "extendedState", 0 ) == 1) { if ( AttrVal( $name, "extendedState", 0 ) == 1) {

View File

@ -1,2 +1,2 @@
UPD 2022-06-28_13:11:16 49241 FHEM/73_GardenaSmartBridge.pm UPD 2022-06-28_13:11:16 49241 FHEM/73_GardenaSmartBridge.pm
UPD 2022-06-26_19:24:09 70125 FHEM/74_GardenaSmartDevice.pm UPD 2022-06-28_23:03:29 70402 FHEM/74_GardenaSmartDevice.pm