Skip to content

Add I2c HTU21D temperature and humidity sensor for Raspberry Pi#8049

Merged
pvizeli merged 13 commits into
home-assistant:devfrom
azogue:i2c-sensor-htu21d
Jun 22, 2017
Merged

Add I2c HTU21D temperature and humidity sensor for Raspberry Pi#8049
pvizeli merged 13 commits into
home-assistant:devfrom
azogue:i2c-sensor-htu21d

Conversation

@azogue
Copy link
Copy Markdown
Member

@azogue azogue commented Jun 15, 2017

Introduction:

Many of us use a Raspberry Pi to run Home Assistant, and we have different sensors connected to it, but for many of them there is no direct support, and it is necessary to use template sensors or command line sensors to make them work within Home Assistant.

Problem is using shell commands to retrieve the values of some sensors limits the working modes of these sensors, and, IMHO, it could be an entry barrier for some beginners.

I think that, as it exists for sensors like the DHT11/22 or the onewire ones, specific platforms for good and cheap digital sensors, with a simple configuration in Home Assistant, are very convenient.

This is the second of a series of PR that I intend to propose for supporting I2c digital sensors compatible with Raspberry Pi. First was #7989 (BME280 sensor), and next will be a light level sensor (BH1750).

Description:

HTU21D sensor support as a sensor platform. Senses temperature and humidity.

The docs include a section to easy install the i2c and smbus support for the home_assistant user, to get things done quickly.

Pull request in home-assistant.github.io with documentation (if applicable): home-assistant/home-assistant.io#2820

Example entry for configuration.yaml (if applicable):

sensor:

  - platform: htu21d

    name: Ambient


Checklist:

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • New dependencies are only imported inside functions that use them (example).
  • New dependencies have been added to requirements_all.txt by running script/gen_requirements_all.py.
  • New files were added to .coveragerc.

* new sensor platform
* requirements_all and .coveragerc update
@azogue azogue changed the title Add new HTU21D temperature and humidity sensor Add I2c HTU21D temperature and humidity sensor for Raspberry Pi Jun 15, 2017
Copy link
Copy Markdown
Member

@pvizeli pvizeli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Amazing work but it is not allow to have proto specific code inside HomeAssistant. Please export this device specific code into a new mini library and use this for this sensor.

@azogue
Copy link
Copy Markdown
Member Author

azogue commented Jun 21, 2017

@pvizeli, changes are done

@pvizeli pvizeli merged commit 435e5c8 into home-assistant:dev Jun 22, 2017
@azogue azogue deleted the i2c-sensor-htu21d branch June 22, 2017 09:41
@balloob balloob mentioned this pull request Jul 1, 2017
dethpickle pushed a commit to dethpickle/home-assistant that referenced this pull request Aug 18, 2017
…-assistant#8049)

* Add new HTU21D temperature and humidity sensor

* new sensor platform
* requirements_all and .coveragerc update

* fix lint

* review changes: move sensor code to external module

* remove debug log msg

* add i2csense to COMMENT_REQUIREMENTS, require i2csense 0.0.3

* Add new HTU21D temperature and humidity sensor

* new sensor platform
* requirements_all and .coveragerc update

* fix lint

* review changes: move sensor code to external module

* remove debug log msg

* add i2csense to COMMENT_REQUIREMENTS, require i2csense 0.0.3

* change style for hass

* fix requirements
@home-assistant home-assistant locked and limited conversation to collaborators Oct 20, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants