Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DHT22 sensor component can't update #18108

Closed
langestefan opened this issue Nov 2, 2018 · 1 comment
Closed

DHT22 sensor component can't update #18108

langestefan opened this issue Nov 2, 2018 · 1 comment

Comments

@langestefan
Copy link

Home Assistant release with the issue:

0.81.2

Last working Home Assistant release (if known):
I've had this issue for as long as I can remember.

Operating environment (Hass.io/Docker/Windows/etc.):

Hass.io running on a RPI3B+

Component/platform:

https://www.home-assistant.io/components/sensor.dht/

Description of problem:
Hass.io fails updating the dht sensor component.

In /Adafruit_DHT/common.py I see the following lines:

def get_platform():
    """Return a DHT platform interface for the currently detected platform."""
    plat = platform_detect.platform_detect()
    if plat == platform_detect.RASPBERRY_PI:
        # Check for version 1 or 2 of the pi.
        version = platform_detect.pi_version()
        if version == 1:
            from . import Raspberry_Pi
            return Raspberry_Pi
        elif version == 2:
            from . import Raspberry_Pi_2
            return Raspberry_Pi_2
        elif version == 3:
            """Use Pi 2 driver even though running on Pi 3"""
            from . import Raspberry_Pi_2
            return Raspberry_Pi_2
        else:
            raise RuntimeError('No driver for detected Raspberry Pi version available!')
    elif plat == platform_detect.BEAGLEBONE_BLACK:
        from . import Beaglebone_Black
        return Beaglebone_Black
    else:
        raise RuntimeError('Unknown platform.')

So I guess it has something to do with it not being able to detect my pi version.

Problem-relevant configuration.yaml entries and (fill out even if it seems unimportant):

sensor:
  - platform: dht
    sensor: DHT22
    pin: 4
    temperature_offset: 2.1
    humidity_offset: -3.2
    monitored_conditions:
      - temperature
      - humidity

Traceback (if applicable):

Log Details (ERROR)
Thu Nov 01 2018 22:28:21 GMT+0100 (Midden-Europese standaardtijd)

dht: Error on device update!
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/homeassistant/helpers/entity_platform.py", line 251, in _async_add_entity
    await entity.async_device_update(warning=False)
  File "/usr/local/lib/python3.6/site-packages/homeassistant/helpers/entity.py", line 349, in async_device_update
    await self.hass.async_add_executor_job(self.update)
  File "/usr/local/lib/python3.6/concurrent/futures/thread.py", line 56, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.6/site-packages/homeassistant/components/sensor/dht.py", line 121, in update
    self.dht_client.update()
  File "/usr/local/lib/python3.6/site-packages/homeassistant/util/__init__.py", line 324, in wrapper
    result = method(*args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/homeassistant/components/sensor/dht.py", line 156, in update
    self.sensor, self.pin)
  File "/usr/local/lib/python3.6/site-packages/Adafruit_DHT/common.py", line 94, in read_retry
    humidity, temperature = read(sensor, pin, platform)
  File "/usr/local/lib/python3.6/site-packages/Adafruit_DHT/common.py", line 80, in read
    platform = get_platform()
  File "/usr/local/lib/python3.6/site-packages/Adafruit_DHT/common.py", line 63, in get_platform
    raise RuntimeError('Unknown platform.')
RuntimeError: Unknown platform.

Additional information:
Issue was raised here but no solution was given: #15847

@fabaff
Copy link
Member

fabaff commented Nov 2, 2018

Duplicate of #15847

@fabaff fabaff marked this as a duplicate of #15847 Nov 2, 2018
@fabaff fabaff closed this as completed Nov 2, 2018
@home-assistant home-assistant locked and limited conversation to collaborators Feb 5, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants