home-climate-control / dz

Home Climate Control Core: *the* Open Source multi-zone temperature and climate control system.
http://homeclimatecontrol.com/
GNU General Public License v3.0
59 stars 7 forks source link

Make Thermostat PID controller configuration values HVAC mode independent #299

Open climategadgets opened 9 months ago

climategadgets commented 9 months ago

Existing Behavior

PID controller p and i values must be positive for cooling mode and negative for heating. This requires two changes in unrelated configuration sections to change the operating mode. Moreover, economizer configuration already allows keeping the same PID values for cooling and heating operation, thus confusing things even more.

Desired Behavior

Virtual thermostat recognizes the operating mode and allows to use the same values for both cooling and heating mode.

Implementation Considerations

As of v4.3.0, Mode is specified in three configurations: Zone (implicitly with PID controller p and i values sign), Switchable HVAC device (explicitly), and Director (explicitly).

The key to solving this problem is to detect the mode at Zone creation time, and provide correct values to its PID controller. Providing mode to the Zone is cumbersome, so it looks like the Zones need to be created by the Director (instead of directly as they are now).

Alternatively, an arguably less elegant but more future proof solution (automatic changeover is coming someday, right?) would be to allow setting a Zone mode directly and reconfiguring the PID controller on the fly - in this case the mode will have to be sent to the zones just as it is being sent to the HVAC device.