mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-01-31 18:59:33 +00:00
94_PWM: add helper for pulses, fix roomsToStayOn
git-svn-id: https://svn.fhem.de/fhem/trunk@15528 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
651a9f52da
commit
099d8ec1a7
@ -26,6 +26,8 @@
|
|||||||
# 01.08.17 GA add attribute disable to stop calculations of PWM
|
# 01.08.17 GA add attribute disable to stop calculations of PWM
|
||||||
# 01.08.17 GA fix OverallHeatingSwitch (without threshold) now independent from ValveProtection
|
# 01.08.17 GA fix OverallHeatingSwitch (without threshold) now independent from ValveProtection
|
||||||
# 17.08.17 GA add attribute overallHeatingSwitchThresholdTemp define a threshold temperature to prevent switch to "on"
|
# 17.08.17 GA add attribute overallHeatingSwitchThresholdTemp define a threshold temperature to prevent switch to "on"
|
||||||
|
# 30.11.17 GA add helper for last pulses of rooms
|
||||||
|
# 30.11.17 GA fix clear roomsToStayOn and roomsToStayOnList if not used
|
||||||
|
|
||||||
##############################################
|
##############################################
|
||||||
# $Id$
|
# $Id$
|
||||||
@ -119,6 +121,8 @@ PWM_Calculate($)
|
|||||||
|
|
||||||
Log3 ($hash, 3, "PWM_Calculate $name");
|
Log3 ($hash, 3, "PWM_Calculate $name");
|
||||||
|
|
||||||
|
$hash->{helper}{pulses} = ();
|
||||||
|
|
||||||
readingsBeginUpdate ($hash);
|
readingsBeginUpdate ($hash);
|
||||||
|
|
||||||
#$hash->{STATE} = "lastrun: ".TimeNow();
|
#$hash->{STATE} = "lastrun: ".TimeNow();
|
||||||
@ -169,6 +173,7 @@ PWM_Calculate($)
|
|||||||
|
|
||||||
$roomsActive++;
|
$roomsActive++;
|
||||||
$RoomsPulses{$d} = $newpulse;
|
$RoomsPulses{$d} = $newpulse;
|
||||||
|
$hash->{helper}{pulses}{$d} = $newpulse;
|
||||||
$newpulseSum += $newpulse;
|
$newpulseSum += $newpulse;
|
||||||
$newpulseMax = max($newpulseMax, $newpulse);
|
$newpulseMax = max($newpulseMax, $newpulse);
|
||||||
|
|
||||||
@ -509,8 +514,12 @@ PWM_Calculate($)
|
|||||||
if ( $hash->{NoRoomsToStayOn} > 0) {
|
if ( $hash->{NoRoomsToStayOn} > 0) {
|
||||||
readingsBulkUpdate ($hash, "roomsToStayOn", $minRoomsOn);
|
readingsBulkUpdate ($hash, "roomsToStayOn", $minRoomsOn);
|
||||||
readingsBulkUpdate ($hash, "roomsToStayOnList", $minRoomsOnList);
|
readingsBulkUpdate ($hash, "roomsToStayOnList", $minRoomsOnList);
|
||||||
|
} else {
|
||||||
|
readingsBulkUpdate ($hash, "roomsToStayOn", 0);
|
||||||
|
readingsBulkUpdate ($hash, "roomsToStayOnList", "");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if ( defined ($hash->{OverallHeatingSwitch}) ) {
|
if ( defined ($hash->{OverallHeatingSwitch}) ) {
|
||||||
if ( $hash->{OverallHeatingSwitch} ne "") {
|
if ( $hash->{OverallHeatingSwitch} ne "") {
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user