add custom schedule breake ic24 + add commandref

This commit is contained in:
Sebastian 2021-05-18 21:29:09 +02:00
parent 82833104ff
commit ed2387c89b
2 changed files with 13 additions and 2 deletions

View File

@ -63,6 +63,8 @@ use warnings;
use POSIX; use POSIX;
use FHEM::Meta; use FHEM::Meta;
use Time::Local; use Time::Local;
use Time::Piece;
use Time::Seconds;
# try to use JSON::MaybeXS wrapper # try to use JSON::MaybeXS wrapper
# for chance of better performance + open code # for chance of better performance + open code
@ -405,12 +407,14 @@ sub Set {
} }
elsif ( $cmd =~ /.*ScheduleValve/ ){ elsif ( $cmd =~ /.*ScheduleValve/ ){
my $valve_id = $aArg->[0]; my $valve_id = $aArg->[0];
my $duration = (( defined($aArg->[1]) ? ( ((Time::Piece->new)+(ONE_HOUR * $aArg->[1]))->datetime ).'.000Z' : '2040-12-31T22:00:00.000Z'));
$abilities = 'irrigation_settings'; $abilities = 'irrigation_settings';
$service_id = $hash->{helper}->{'schedules_paused_until_'.$valve_id.'_id'}; $service_id = $hash->{helper}->{'schedules_paused_until_'.$valve_id.'_id'};
$payload = '"settings":{"name":"schedules_paused_until_' $payload = '"settings":{"name":"schedules_paused_until_'
. $valve_id . $valve_id
. '", "value":"' . '", "value":"'
. ($cmd eq 'resumeScheduleValve' ? '' : '2040-12-31T22:00:00.000Z') . ($cmd eq 'resumeScheduleValve' ? '' : $duration )
. '","device":"' . '","device":"'
. $hash->{DEVICEID} . $hash->{DEVICEID}
. '"}'; . '"}';
@ -1130,6 +1134,10 @@ sub SetPredefinedStartPoints {
<li>set NAME startpoint enable 1</li> <li>set NAME startpoint enable 1</li>
<li>set NAME startpoint disable 3 enable 1</li> <li>set NAME startpoint disable 3 enable 1</li>
</ul> </ul>
<li>resumeScheduleValve - start schedule irrigation on valve n</li>
<li>stopScheduleValve - stop schedule irrigation on valve n (Default: 2040-12-31T22) | optional params hours (now + hours)</li>
<li>closeAllValves - close all valves</li>
</ul> </ul>
</ul> </ul>
@ -1274,6 +1282,9 @@ sub SetPredefinedStartPoints {
<li>set NAME startpoint enable 1</li> <li>set NAME startpoint enable 1</li>
<li>set NAME startpoint disable 3 enable 1</li> <li>set NAME startpoint disable 3 enable 1</li>
</ul> </ul>
<li>resumeScheduleValve - Startet Bew&aauml;sserung am Ventil n nach Zeitplan</li>
<li>stopScheduleValve - Setzt Bew&aauml;sserung am Ventil n aus (Default: 2040-12-31T22) | Optionaler Parameter Stunden (Jetzt + Stunden)</li>
<li>closeAllValves - Stopt Bew&aauml;sserung an allen Ventilen </li>
</ul> </ul>
</ul> </ul>

View File

@ -1,2 +1,2 @@
UPD 2021-05-16_21:23:09 46133 FHEM/73_GardenaSmartBridge.pm UPD 2021-05-16_21:23:09 46133 FHEM/73_GardenaSmartBridge.pm
UPD 2021-05-17_18:30:20 50836 FHEM/74_GardenaSmartDevice.pm UPD 2021-05-18_21:27:40 51588 FHEM/74_GardenaSmartDevice.pm