HDC1080 Temperature/Humidity Sensor

The HDC1080 component allows you get accurate temperature and humidity readings from your HDC1080 (datasheet, adafruit) sensors with esphomelib. To use these i2c-based devices, first initialize the i2c bus using the pins you have for SDA and SCL and then create the sensors themselves as in below example.

Example Usage

// inside setup()
App.init_i2c(SDA_PIN, SCL_PIN); // change these values for your pins.
// create sensors
App.make_hdc1080_sensor("Outside Temperature", "Outside Humidity");

See Application::make_hdc1080_sensor().

API Reference

class HDC1080Component : public PollingComponent, public I2CDevice

HDC1080 temperature+humidity i2c sensor integration.

Based off of implementation by ClosedCube: https://github.com/closedcube/ClosedCube_HDC1080_Arduino

Public Functions

HDC1080Component(I2CComponent *parent, const std::string &temperature_name, const std::string &humidity_name, uint32_t update_interval)

Initialize the component with the provided update interval.

void setup()

Setup the sensor and check for connection.

void dump_config()
void update()

Retrieve the latest sensor values. This operation takes approximately 16ms.

HDC1080TemperatureSensor *get_temperature_sensor() const

Get the internal temperature sensor.

HDC1080HumiditySensor *get_humidity_sensor() const

Get the internal humidity sensor.

float get_setup_priority() const

priority of setup().

higher -> executed earlier

Defaults to 0.

The setup priority of this component

Protected Attributes

HDC1080TemperatureSensor *temperature_
HDC1080HumiditySensor *humidity_