Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rainDuration #3

Closed
christoph-morrison opened this issue Aug 6, 2019 · 1 comment
Closed

rainDuration #3

christoph-morrison opened this issue Aug 6, 2019 · 1 comment
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@christoph-morrison
Copy link
Collaborator

christoph-morrison commented Aug 6, 2019

könnte man evtl noch die 'rainDuration' mit als Reading ausgeben? Ich lasse mir einen Push schicken beim Mountainbiken, falls sich die Regendauer ändert (kurzer Schauer oder langanhaltender Regen), das ist schwieriger zu berechnen, weil die Readings für RainStart und RainEnd nur als HH:MM ausgegeben werden, falls dazwischen ein Tageswechsel liegt.
inoma, Forum #963631

Ja und es ist vor allem schwieriger zu berechnen weil es ja durchaus auch Pausen gibt. Ich könnte natürlich die (ersten zusammenhängenden) 5-Minuten-Intervalle zählen in denen es regnet, dann hat man wenigstens einen groben Wert - aber der kann halt verführerisch gut sein, wenn es erst 5 Minuten regnet, dann 5 Minuten nicht und dann die restliche Zeit wieder doch. Oder halt alle 5-Minuten-Intervalle in den nächsten 2 Stunden. Die Daten sind dafür eigentlich nicht genau genug. Ich überleg's mir mal.

Ich dachte an sowas:

$rainDurationMin = ($rainEnd-$rainStart)/60;
$rainDuration = MinToHours ($rainDurationMin);


::readingsBulkUpdate( $hash, "rainDuration", (($rainStart && $rainEnd) ? $rainDuration : 'unknown'));
::readingsBulkUpdate( $hash, "rainDurationMin", (($rainStart && $rainEnd) ? $rainDurationMin : 'unknown'));


sub MinToHours($) {
  my($intime) = @_;
  return sprintf("%02d:%02d",(($intime/60),$intime%60));
}

inoma, Forum #963769

@christoph-morrison christoph-morrison added the enhancement New feature or request label Aug 6, 2019
@christoph-morrison christoph-morrison added this to the 2.2 milestone Aug 6, 2019
@christoph-morrison christoph-morrison self-assigned this Aug 6, 2019
This was referenced Aug 8, 2019
Closed
@mahowi
Copy link

mahowi commented Aug 9, 2019

Wird mit #6 eingeführt.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

No branches or pull requests

2 participants