# # # 94_PWMR.pm # written by Andreas Goebel 2012-07-25 # e-mail: ag at goebel-it dot de # ############################################## # $Id: # 29.07.15 GA change set manualTempDuration # 21.09.15 GA update, use Log3 and readingsSingleUpdate # 07.10.15 GA initial version published # 07.10.15 GA fix calculation of PWMPulse, default for c_autoCalcTemp # 13.10.15 GA add event-on-change-reading # 14.10.15 GA fix round energyusedp # 15.10.15 GA add a_regexp_on, a regular expression for the on state of the actor # module for PWM (Pulse Width Modulation) calculation # this module defines a room for calculation # it is used by a PWM object # reference to the PWM object is via IODev # PWMR object defines: # IODev: reference to PWM # factor (also used in PID calculation): # temperatur difference * factor * cycletime (from PWM) defines on/off periods (pulse) # sensor delivering the temperature (temperature is read from reading using a regexp) # actor to switch on/off the heating devices (may be a structure if more than on actor..) # comma separated list of window contacts followd by ":" and a regular expression # default for the regular expression is "Open" # if the regular expression matches on of the contacts # then readRoom will return c_tempFrostProtect as desired-temp # instead of the current calculated desired-temp # this should cause the calculation routine for the room to switch off heating # # calculation of "desired-temp" is done in a loop (5-minutes default) # - if c_frostProtect is "1" -> set to c_tempFrostProtect # - if c_autoCalcTemp is "1" -> use c_tempN, c_tempD, c_tempC, c_tempE and c_tempRule[1-5] # - c_* variables are syntax checked and derived from attr which have a readable syntax # # - c_tempRule[1-5] are processed in order 5..1 (5 is highes priority) # rules define: # ,[N|D|C] [