dev #54

Merged
marko merged 19 commits from dev into main 2022-04-12 11:37:37 +00:00
2 changed files with 34 additions and 9 deletions
Showing only changes of commit c553b8ef8f - Show all commits

View File

@ -767,6 +767,11 @@ sub WriteReadings {
{ $decode_json->{settings}[$settings]{name} . '_id' } = { $decode_json->{settings}[$settings]{name} . '_id' } =
$decode_json->{settings}[$settings]{id}; $decode_json->{settings}[$settings]{id};
} }
# check watering controler single schedules pause until
if ( $decode_json->{settings}[$settings]{name} eq 'schedules_paused_until' ) {
readingsBulkUpdateIfChanged( $hash, 'scheduling-schedules_paused_until',
$decode_json->{settings}[$settings]{value} );
}
# save winter mode as reading # save winter mode as reading
@ -831,20 +836,39 @@ sub setState {
my $online_state = my $online_state =
ReadingsVal( $name, 'device_info-connection_status', 'unknown' ); ReadingsVal( $name, 'device_info-connection_status', 'unknown' );
#online state mower
readingsBulkUpdate( $hash, 'state', readingsBulkUpdate( $hash, 'state',
$online_state eq 'online' $online_state eq 'online'
? ReadingsVal( $name, 'mower-status', 'readingsValError' ) ? ReadingsVal( $name, 'mower-status', 'readingsValError' )
: 'offline' ) : 'offline' )
if ( AttrVal( $name, 'model', 'unknown' ) eq 'mower' ); if ( AttrVal( $name, 'model', 'unknown' ) eq 'mower' );
readingsBulkUpdate(
$hash, 'state', #online state water control
( # zeit bewaesseung
ReadingsVal( $name, 'watering-watering_timer_1_duration', 0 ) =~ # online | offline
# open | closed
# zeitplan -> dauert pausiert wenn 2038-01-18
if ( AttrVal( $name, 'model', 'unknown' ) eq 'watering_computer' ){
#should: open | online | no timer
#open/closed?
my $state_string = ReadingsVal( $name, 'watering-watering_timer_1_duration', 0 ) =~
m{\A[1-9]([0-9]+)?\z}xms m{\A[1-9]([0-9]+)?\z}xms
? RigReadingsValue( $hash, 'open' ) ? RigReadingsValue( $hash, 'open' );
: RigReadingsValue( $hash, 'closed' ) : ( ReadingsVal( $name, 'scheduling-schedules_paused_until', '') ne '' ?
'scheduled watering next start: '
. (
ReadingsVal(
$name, 'scheduling-schedules_paused_until',
'no timer'
) )
) if ( AttrVal( $name, 'model', 'unknown' ) eq 'watering_computer' ); ) : 'closed' );
# state offline | override
$state_string = 'offline' if ($online_state eq 'offline');
readingsBulkUpdate(
$hash, 'state', $state_string );
}
if ( AttrVal( $name, 'model', 'unknown' ) =~ /sensor.?/ ) { if ( AttrVal( $name, 'model', 'unknown' ) =~ /sensor.?/ ) {
my $state_string = my $state_string =
@ -870,6 +894,7 @@ sub setState {
# readingsBulkUpdate( $hash, 'ambient_temperature-temperature', '-1' ) if (ReadingsVal($name, 'device_info-category', 'unknown') eq 'sensor'); # readingsBulkUpdate( $hash, 'ambient_temperature-temperature', '-1' ) if (ReadingsVal($name, 'device_info-category', 'unknown') eq 'sensor');
# readingsBulkUpdate( $hash, 'light-light', '-1' ) if (ReadingsVal($name, 'device_info-category', 'unknown') eq 'sensor'); # readingsBulkUpdate( $hash, 'light-light', '-1' ) if (ReadingsVal($name, 'device_info-category', 'unknown') eq 'sensor');
# } # }
#online state sensor I II
readingsBulkUpdate( $hash, 'state', readingsBulkUpdate( $hash, 'state',
$online_state eq 'online' ? $state_string : 'offline' ); $online_state eq 'online' ? $state_string : 'offline' );
} }

View File

@ -1,2 +1,2 @@
UPD 2022-03-29_13:42:09 49520 FHEM/73_GardenaSmartBridge.pm UPD 2022-03-29_13:42:09 49520 FHEM/73_GardenaSmartBridge.pm
UPD 2022-04-05_09:22:09 57281 FHEM/74_GardenaSmartDevice.pm UPD 2022-04-05_11:36:13 58328 FHEM/74_GardenaSmartDevice.pm