dev #74

Merged
sebastianschwarz merged 126 commits from dev into testing 2022-09-06 11:31:54 +00:00
3 changed files with 11 additions and 10 deletions
Showing only changes of commit 6a7083f6ea - Show all commits

View File

@ -1 +1 @@
[enhancemend] - commandref
[fix] - fix

View File

@ -846,12 +846,13 @@ sub WriteReadings {
scalar( @{$decode_json->{scheduled_events} } ) );
my $valve_id =1; my $event_id = 0; # ic24 [1..6] | wc, pump [1]
## valcid zahlen. readings mit valvid aber
# my @soll = ();
# for my $event_schedules ( @{ $decode_json->{scheduled_events} } ) {
# while ( my ( $r, $v ) = each %{ $event_schedules } ) {
# push @soll, $v; # cloud hat SOLL
# }
# }
my @soll = ();
for my $event_schedules ( @{ $decode_json->{scheduled_events} } ) {
while ( my ( $r, $v ) = each %{ $event_schedules } ) {
push @soll, $v if $r eq 'id'; # cloud hat SOLL
}
}
for my $event_schedules ( @{ $decode_json->{scheduled_events} } ) {
$valve_id = $event_schedules->{valve_id} if ( exists($event_schedules->{valve_id} ) ); #ic24
$event_id++; # event id
@ -1056,7 +1057,7 @@ sub setState {
if (scalar(@opened_valves) > 0){
## valve 1 will be ir.. 23 minutes remaining
for (@valves_connected){
$state_string .= sprintf(RigReadingsValue($hash,'valve').' '.$_.' '.(RigReadingsValue($hash, 'will be irrigated %.f minutes remaining.') .'</br>'), (ReadingsVal( $name, 'watering-watering_timer_'.$_.'_duration', 0 )/60));
$state_string .= sprintf(RigReadingsValue($hash,'valve').' '.$_.' '.(RigReadingsValue($hash, 'watering. %.f minutes left') .'</br>'), (ReadingsVal( $name, 'watering-watering_timer_'.$_.'_duration', 0 )/60));
} # /for
} else {
$state_string .= RigReadingsValue($hash, 'closed');
@ -1073,7 +1074,7 @@ sub setState {
Log3 $name, 5, "[DEBUG] - Offene Ventile :".scalar(@opened_valves)." laengste bewaesserung: $longest_duration . hat Zeitplan: $has_schedule Naechster Zeitplan: $nearst_irrigation";
$state_string = scalar(@opened_valves) > 0
# offen
? sprintf( (RigReadingsValue($hash, 'will be irrigated %.f minutes remaining.')), $longest_duration/60)
? sprintf( (RigReadingsValue($hash, 'watering. %.f minutes left')), $longest_duration/60)
# zu
:
( $has_schedule

View File

@ -1,2 +1,2 @@
UPD 2022-07-21_19:43:48 49634 FHEM/73_GardenaSmartBridge.pm
UPD 2022-08-04_14:44:27 107271 FHEM/74_GardenaSmartDevice.pm
UPD 2022-08-04_14:54:35 107246 FHEM/74_GardenaSmartDevice.pm