12#define OUTPUT_TRESHOLD 1.0
100 int Poll(
short cause)
override;
109 int Ctrl(
itemCmd cmd,
char* subItem=NULL,
bool toExecute=
true,
bool authorized =
false)
override;
A single LightHub item (virtual channel).
Definition item.h:232
chPersistent * getPersistent()
Definition item.cpp:641
abstractOut()
Definition abstractout.h:22
virtual void link(Item *_item)
Definition abstractout.h:24
Item * item
Item currently linked to this driver.
Definition abstractout.h:55
Placeholder for driver-persistent data attached to an item (I_EXT field).
Definition abstractout.h:8
Command + value container passed between items, drivers and MQTT.
Definition itemCmd.h:306
void link(Item *_item)
Attach to an item and grab its persistent PID state.
Definition out_pid.h:95
void alarm(bool)
Enter (state=true) or leave (state=false) the input-failure alarm; forces the alarmVal output on entr...
Definition out_pid.cpp:250
bool getConfig()
Parse the item argument array, fill store and create the PID controller.
Definition out_pid.cpp:11
pidPersistent * store
Definition out_pid.h:115
float getAlarmVal()
Get the forced output value used on alarm (alarmVal, or 0/255 by control direction).
Definition out_pid.cpp:205
int Stop() override
De-initialize and free the PID controller and persistent state.
Definition out_pid.cpp:139
out_pid()
Default constructor.
Definition out_pid.h:93
int getChanType() override
Channel type of the driver.
Definition out_pid.cpp:273
int Poll(short cause) override
Run the PID loop: compute output, apply it to the output item, watch the input-failure timer.
Definition out_pid.cpp:157
int Ctrl(itemCmd cmd, char *subItem=NULL, bool toExecute=true, bool authorized=false) override
Handle /val (input), /set (setpoint) and /cmd|/ctrl (ON/OFF/ENABLE/DISABLE/RESET) commands.
Definition out_pid.cpp:284
int isActive() override
True when the item command is not CMD_OFF.
Definition out_pid.cpp:151
int Setup() override
Allocate persistent state, load JSON config, initialize the PID controller.
Definition out_pid.cpp:112
pidJson(aJsonObject *_obj)
Constructor, stores the JSON object pointer.
Definition out_pid.h:24
aJsonObject * obj
Definition out_pid.h:34
aJsonObject * getPoObj()
Get the JSON object holding the PID output (not used yet).
Definition out_pid.h:31
PID * getPID()
Get the PID controller pointer stored inside the JSON object value.
Definition out_pid.h:33
aJsonObject * getValObj()
Get the JSON object holding the PID input value (not used yet).
Definition out_pid.h:27
aJsonObject * getSetObj()
Get the JSON object holding the PID setpoint (not used yet).
Definition out_pid.h:29
Persistent (survives reboot) state of the PID driver.
Definition out_pid.h:44
iotype setpoint
Definition out_pid.h:49
uint16_t alarmTimeout
Definition out_pid.h:53
iotype input
Definition out_pid.h:48
PID * pid
Definition out_pid.h:46
bool alarmArmed
Definition out_pid.h:52
float prevOut
Definition out_pid.h:50
iotype output
Definition out_pid.h:47
uint32_t alarmTimer
Definition out_pid.h:51
Item (virtual channel) system of LightHub.