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

CCS811 eCO2 / eTVOC air-quality sensor input (IN_CCS811 = 5). More...

#include <in_ccs811_hdc1080.h>

Inheritance diagram for in_ccs811:

Public Member Functions

 in_ccs811 (Input *_in)
int Setup () override
int Poll (short cause) override
Public Member Functions inherited from abstractIn
 abstractIn (Input *_in)
Public Member Functions inherited from abstractCh
 abstractCh ()
virtual ~abstractCh ()
virtual int Stop ()
virtual int Status ()
virtual void setStatus (uint8_t status)

Protected Member Functions

void printDriverError (CCS811Core::status errorCode)
void printSensorError ()
Protected Member Functions inherited from abstractIn
int publish (long value, const char *subtopic=NULL)
int publish (float value, const char *subtopic=NULL)
int publish (char *value, const char *subtopic=NULL)
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)

Additional Inherited Members

Protected Attributes inherited from abstractIn
Input * in
 Pointer to the Input (config entry) this driver is attached to.
friend Input

Detailed Description

CCS811 eCO2 / eTVOC air-quality sensor input (IN_CCS811 = 5).

Reads the MOX air-quality sensor over I2C at the fixed address CCS811_ADDR (0x5A). Polls the sensor when new data is available, suppresses spontaneous calculation errors (CO2 >= 10000 ppm) and publishes the readings on the input "in" section:

  • /CO2 - estimated CO2 concentration (ppm);
  • /TVOC - estimated total volatile organic compounds (ppb);
  • /base - sensor baseline value.

The humidity/temperature measured by the companion HDC1080 input are forwarded here via setEnvironmentalData() to improve accuracy.

Constructor & Destructor Documentation

◆ in_ccs811()

in_ccs811::in_ccs811 ( Input * _in)
inline

Member Function Documentation

◆ Poll()

int in_ccs811::Poll ( short cause)
overridevirtual

Periodic poll hook.

Parameters
cause- POLLING_SLOW/POLLING_FAST/POLLING_INT/POLLING_1S

Reimplemented from abstractCh.

◆ printDriverError()

void in_ccs811::printDriverError ( CCS811Core::status errorCode)
protected

◆ printSensorError()

void in_ccs811::printSensorError ( )
protected

◆ Setup()

int in_ccs811::Setup ( )
overridevirtual

Initialize hardware and reserve resources.

Returns
0 on success.

Implements abstractCh.


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