LightHub 4.6.0
Open-source smart home controller firmware
Loading...
Searching...
No Matches
out_Multivent Class Reference

Multi-zone ventilation controller for a shared AC unit, channel type CH_MULTIVENT = 18. More...

#include <out_multivent.h>

Inheritance diagram for out_Multivent:

Public Member Functions

void link (Item *_item)
 Links the channel item and reads the zones object from itemArg.
int Setup () override
 Creates the per-zone state (fan/cmd/out) and allocates the PID controllers.
int Poll (short cause) override
 Per-zone PID control, airflow redistribution, boost/suppress and AC fan/mode control (see class doc).
int Stop () override
 Deletes the PID controllers and marks the channel as unknown.
int isActive () override
 Returns 1 if any zone requests an active command, 0 otherwise.
int getChanType () override
 Returns CH_THERMO (5).
int Ctrl (itemCmd cmd, char *subItem=NULL, bool toExecute=true, bool authorized=false) override
 Applies a command to a zone (or the AC without subitem) and forwards the resulting fan level to the AC, see class doc.
int fanCtrl (itemCmd cmd, char *subItem=NULL, bool force=false)
 Zone fan/mode/set/val handling with passive mode, freeze and PID interlocks; returns the resulting AC fan level (0-255), -1 (no change, OK) or -2 (rejected).
Public Member Functions inherited from abstractOut
 abstractOut ()
virtual bool isAllowed (itemCmd cmd)
virtual itemCmd getDefaultOnVal ()
virtual int Status () override
virtual void setStatus (uint8_t status) override
Item * getItem ()
Public Member Functions inherited from abstractCh
 abstractCh ()
virtual ~abstractCh ()

Protected Member Functions

void getConfig ()
int sendACcmd (itemCmd cmd)
void checkACcmd (int acCmd)
void checkACfan (int acFan)
void checkACset (int acSet)
void setPassiveMode (aJsonObject *zone, bool mode)
uint32_t getFlag (aJsonObject *zone, uint32_t flag)
void setFlag (aJsonObject *zone, uint32_t flag)
void clearFlag (aJsonObject *zone, uint32_t flag)
void enablePid (aJsonObject *zone, int enable, int direction=-1)
bool pidEnabled (aJsonObject *pidObj)
void setBoost (itemCmd)
void resetBoost ()
void notifyState (itemCmd state)
void stopAllzones ()
void restoreAllzones ()
Protected Member Functions inherited from abstractOut
int pubAction (bool state)
Protected Member Functions inherited from abstractCh
int publishTopic (const char *topic, long value, const char *subtopic=NULL)
int publishTopic (const char *topic, float value, const char *subtopic=NULL)
int publishTopic (const char *topic, const char *value, const char *subtopic=NULL, const char *suffix=NULL)

Protected Attributes

aJsonObject * gatesObj
aJsonObject * acObj
Protected Attributes inherited from abstractOut
Item * item
 Item currently linked to this driver.

Detailed Description

Multi-zone ventilation controller for a shared AC unit, channel type CH_MULTIVENT = 18.

Manages several ventilation zones (per-zone setpoints, PID control and airflow capacity) and steers the shared AC unit (mode, fan level and setpoint), including boost on PID imbalance and suppression of redundant commands to the AC.

JSON config (itemArg = OBJECT of zones). The key "" is the shared AC node. Zone keys: "set" (setpoint), "fan", "cmd", "V" (airflow capacity, default 60), "pid" ([kP, kI, kD, dT(default 5 s)]), "AlarmTime" (default 120 s), "AlarmValue". AC node keys: "boost" (default 230), "supress" (bitmask: 1 fan, 2 set, 4 cmd, 7 all; default 0xF), "turnbyfan", "overridecmd", "onextcmd", "cas" (cascade execution object).

Ctrl commands:

  • /fan - LOW / MEDIUM / HIGH (64/128/255), a 0-255 value, AUTO (passive mode) or OFF;
  • /cmd - ON, OFF, HEAT, COOL, HEATCOOL, DRY, FAN, AUTO, FREEZE, UNFREEZE;
  • /set - zone temperature setpoint;
  • /val - zone temperature (PID input).
  • Without a subitem the call is AC feedback (/val, /fan, /set, /mode, /cmd).

Poll: runs the per-zone PID loops, redistributes airflow by V capacity, applies boost/suppress and sends the resulting fan level and mode to the AC.

Member Function Documentation

◆ checkACcmd()

void out_Multivent::checkACcmd ( int acCmd)
protected

◆ checkACfan()

void out_Multivent::checkACfan ( int acFan)
protected

◆ checkACset()

void out_Multivent::checkACset ( int acSet)
protected

◆ clearFlag()

void out_Multivent::clearFlag ( aJsonObject * zone,
uint32_t flag )
protected

◆ Ctrl()

int out_Multivent::Ctrl ( itemCmd cmd,
char * subItem = NULL,
bool toExecute = true,
bool authorized = false )
overridevirtual

Applies a command to a zone (or the AC without subitem) and forwards the resulting fan level to the AC, see class doc.

Implements abstractOut.

◆ enablePid()

void out_Multivent::enablePid ( aJsonObject * zone,
int enable,
int direction = -1 )
protected

◆ fanCtrl()

int out_Multivent::fanCtrl ( itemCmd cmd,
char * subItem = NULL,
bool force = false )

Zone fan/mode/set/val handling with passive mode, freeze and PID interlocks; returns the resulting AC fan level (0-255), -1 (no change, OK) or -2 (rejected).

◆ getChanType()

int out_Multivent::getChanType ( )
overridevirtual

Returns CH_THERMO (5).

Reimplemented from abstractOut.

◆ getConfig()

void out_Multivent::getConfig ( )
protected

◆ getFlag()

uint32_t out_Multivent::getFlag ( aJsonObject * zone,
uint32_t flag )
protected

◆ isActive()

int out_Multivent::isActive ( )
overridevirtual

Returns 1 if any zone requests an active command, 0 otherwise.

Reimplemented from abstractOut.

◆ link()

void out_Multivent::link ( Item * _item)
inlinevirtual

Links the channel item and reads the zones object from itemArg.

Reimplemented from abstractOut.

◆ notifyState()

void out_Multivent::notifyState ( itemCmd state)
protected

◆ pidEnabled()

bool out_Multivent::pidEnabled ( aJsonObject * pidObj)
protected

◆ Poll()

int out_Multivent::Poll ( short cause)
overridevirtual

Per-zone PID control, airflow redistribution, boost/suppress and AC fan/mode control (see class doc).

Setup PID mode and direction based on real AC mode

Reimplemented from abstractCh.

◆ resetBoost()

void out_Multivent::resetBoost ( )
protected

◆ restoreAllzones()

void out_Multivent::restoreAllzones ( )
protected

◆ sendACcmd()

int out_Multivent::sendACcmd ( itemCmd cmd)
protected

◆ setBoost()

void out_Multivent::setBoost ( itemCmd cmd)
protected

◆ setFlag()

void out_Multivent::setFlag ( aJsonObject * zone,
uint32_t flag )
protected

◆ setPassiveMode()

void out_Multivent::setPassiveMode ( aJsonObject * zone,
bool mode )
protected

◆ Setup()

int out_Multivent::Setup ( )
overridevirtual

Creates the per-zone state (fan/cmd/out) and allocates the PID controllers.

Reimplemented from abstractOut.

◆ Stop()

int out_Multivent::Stop ( )
overridevirtual

Deletes the PID controllers and marks the channel as unknown.

Reimplemented from abstractCh.

◆ stopAllzones()

void out_Multivent::stopAllzones ( )
protected

Member Data Documentation

◆ acObj

aJsonObject* out_Multivent::acObj
protected

◆ gatesObj

aJsonObject* out_Multivent::gatesObj
protected

The documentation for this class was generated from the following files: