Closed migromao closed 6 years ago
@MartinHjelmare please change dht sensor package from Adafruit_Python_DHT to Adafruit-DHT ref https://github.com/adafruit/Adafruit_Python_DHT/issues/99#issuecomment-408260880
Workaround for hass.io users until fix is released: create directories in your config directory: custom_components/sensor/ save this file as dht.py in the sensor directory you just created: https://raw.githubusercontent.com/home-assistant/home-assistant/e76e9e0966b01dd16e8e5205a3825b6e8d30ce39/homeassistant/components/sensor/dht.py restart home assistant
@nhorvath thankyou
FYI after a fix is released you should delete that file in custom_components
mhmmm somehow your fix @nhorvath does not work for me.... I just did a curl > custom_components/sensor/dht.py with the url you posted but the following error occurs in the logs and nothing is shown in the web interface (but also no longer the error message that the sensor dht could not be set up ) :
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/hbmqtt/broker.py", line 342, in stream_connected
yield from self.client_connected(listener_name, StreamReaderAdapter(reader), StreamWriterAdapter(writer))
File "/usr/local/lib/python3.6/site-packages/hbmqtt/broker.py", line 357, in client_connected
handler, client_session = yield from BrokerProtocolHandler.init_from_connect(reader, writer, self.plugins_manager, loop=self._loop)
File "/usr/local/lib/python3.6/site-packages/hbmqtt/mqtt/protocol/broker_handler.py", line 129, in init_from_connect
connect = yield from ConnectPacket.from_stream(reader)
File "/usr/local/lib/python3.6/site-packages/hbmqtt/mqtt/packet.py", line 225, in from_stream
fixed_header = yield from cls.FIXED_HEADER.from_stream(reader)
File "/usr/local/lib/python3.6/site-packages/hbmqtt/mqtt/packet.py", line 104, in from_stream
byte1 = yield from read_or_raise(reader, 1)
File "/usr/local/lib/python3.6/site-packages/hbmqtt/codecs.py", line 52, in read_or_raise
data = yield from reader.read(n)
File "/usr/local/lib/python3.6/site-packages/hbmqtt/adapters.py", line 146, in read
data = yield from self._reader.readexactly(n)
File "/usr/local/lib/python3.6/asyncio/streams.py", line 672, in readexactly
raise IncompleteReadError(incomplete, n)
I know it looks like a different component (mqtt) but before the custom component that error was not spawning... well maybe I will just wait for the fix to arrive in the main release, but thank you.
@kaiomatico what version of hass.io are you running? i'm on the latest 0.74.2 DHT doesn't even interact with mqtt so i'd be surprised if this was actually the reason for it. maybe you have an automation based on dht that triggers something mqtt? do you see your dht sensor in the states view in hassio?
@nhorvath I'm using the new hass.io with HassOS and homeassistant 0.74.2. I don't have an automation but I have a esp8266 dht sensor in a different room connected via wifi and mqtt. But that sensor is still working with the custom component enabled. I don't see the locally attached gpio dht sensor as state. But after a fresh restart I now saw the correct error message! You were right that mqtt had nothing to do with it, but here is the error now:
by the way this is my configuration.yaml for the sensor:
- platform: dht
name: Wohnzimmer
sensor: DHT22
pin: 4
monitored_conditions:
- temperature
- humidity
I'm sorry. I'm not sure why you would get that if it was working before you upgraded.
On Fri, Jul 27, 2018 at 4:14 PM kaiomatico notifications@github.com wrote:
I'm using the new hass.io with HassOS and homeassistant 0.74.2. I don't have an automation but I have a esp8266 dht sensor in a different room connected via wifi and mqtt. But that sensor is still working with the custom component enabled. I don't see the locally attached gpio dht sensor as state. But after a fresh restart I now saw the correct error message! You were right that mqtt had nothing to do with it, but here is the error now: [image: image] https://user-images.githubusercontent.com/8037196/43344530-5e08f132-91ea-11e8-8939-cf4d11365b4e.png
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/home-assistant/home-assistant/issues/15333#issuecomment-408527203, or mute the thread https://github.com/notifications/unsubscribe-auth/AAKE3HeQ5Ryd5OxkJ3Sfxl6Ay-oMMFpOks5uK3SjgaJpZM4VGD8f .
Thank you for your support, I will just wait for the next stable release to fix this issue
Fixed by #15706
Just upgraded to Hassbian 0.74.2 and the DHT stopped working. Here's the log:
Not initializing sensor.dht because could not install requirement Adafruit_Python_DHT==1.3.2 9:59 AM requirements.py (ERROR) Unable to install package Adafruit_Python_DHT==1.3.2: Command "/srv/homeassistant/bin/python3 -u -c "import setuptools, tokenize;file='/tmp/pip-install-r5hf0984/Adafruit-Python-DHT/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record /tmp/pip-record-kspim5a2/install-record.txt --single-version-externally-managed --compile --install-headers /srv/homeassistant/include/site/python3.5/Adafruit-Python-DHT" failed with error code 1 in /tmp/pip-install-r5hf0984/Adafruit-Python-DHT/ 9:59 AM util/package.py (ERROR)
@rdagger adding your "me too" post after an issue is already marked as fixed in dev doesn't add anything. You can either wait for the next release or follow the workarounds posted above to change dht.py
Any error log?
Ignore me, separate issue.
@nhorvath Sorry I had already installed the workaround. I didn't realize you had to reinstall the workaround after each upgrade.
OK I've successfully updated my Hassio instance to 0.75, but it still tries to install the broken Adafruit 1.3.2. (Yesterday's problems were unrelated.) Log below:
Unable to install package Adafruit_Python_DHT==1.3.2: Failed building wheel for Adafruit-Python-DHT
wirelesstagpy 0.3.0 has requirement colorlog==3.0.1, but you'll have colorlog 3.1.4 which is incompatible.
waterfurnace 0.4.0 has requirement websocket-client>=0.46, but you'll have websocket-client 0.37.0 which is incompatible.
upsmychoice 1.0.6 has requirement beautifulsoup4==4.5.1, but you'll have beautifulsoup4 4.6.1 which is incompatible.
upsmychoice 1.0.6 has requirement python-dateutil==2.6.0, but you'll have python-dateutil 2.7.3 which is incompatible.
upsmychoice 1.0.6 has requirement requests==2.12.4, but you'll have requests 2.19.1 which is incompatible.
toonlib 1.0.2 has requirement cachetools==2.0.0, but you'll have cachetools 2.0.1 which is incompatible.
toonlib 1.0.2 has requirement requests==2.13.0, but you'll have requests 2.19.1 which is incompatible.
temperusb 1.5.3 has requirement pyusb>=1.0.0rc1, but you'll have pyusb 1.0.0b1 which is incompatible.
spotcrime 1.0.3 has requirement requests==2.12.4, but you'll have requests 2.19.1 which is incompatible.
skybellpy 0.1.2 has requirement colorlog==3.0.1, but you'll have colorlog 3.1.4 which is incompatible.
python-velbus 2.0.11 has requirement pyserial==3.3, but you'll have pyserial 3.1.1 which is incompatible.
python-jose-cryptodome 1.3.2 has requirement pycryptodome<3.4.0,>=3.3.1, but you'll have pycryptodome 3.6.4 which is incompatible.
pysma 0.2.0 has requirement aiohttp<3,>2, but you'll have aiohttp 3.3.2 which is incompatible.
pysma 0.2.0 has requirement async-timeout<3,>2, but you'll have async-timeout 3.0.0 which is incompatible.
pymysensors 0.16.0 has requirement pyserial>=3.4, but you'll have pyserial 3.1.1 which is incompatible.
pymonoprice 0.3 has requirement pyserial>=3.4, but you'll have pyserial 3.1.1 which is incompatible.
pymata 2.14 has requirement pyserial==2.7, but you'll have pyserial 3.1.1 which is incompatible.
pyicloud 0.9.1 has requirement keyring<9.0,>=8.0, but you'll have keyring 13.2.1 which is incompatible.
pyicloud 0.9.1 has requirement keyrings.alt<2.0,>=1.0, but you'll have keyrings-alt 3.1 which is incompatible.
pyblackbird 0.5 has requirement pyserial>=3.4, but you'll have pyserial 3.1.1 which is incompatible.
nad-receiver 0.0.9 has requirement pyserial==3.2.1, but you'll have pyserial 3.1.1 which is incompatible.
myusps 1.3.2 has requirement beautifulsoup4==4.6.0, but you'll have beautifulsoup4 4.6.1 which is incompatible.
myusps 1.3.2 has requirement python-dateutil==2.6.0, but you'll have python-dateutil 2.7.3 which is incompatible.
myusps 1.3.2 has requirement requests==2.12.4, but you'll have requests 2.19.1 which is incompatible.
myusps 1.3.2 has requirement selenium==2.53.6, but you'll have selenium 3.14.0 which is incompatible.
mycroftapi 2.0 has requirement websocket-client==0.44.0, but you'll have websocket-client 0.37.0 which is incompatible.
motorparts 1.0.2 has requirement beautifulsoup4==4.5.1, but you'll have beautifulsoup4 4.6.1 which is incompatible.
motorparts 1.0.2 has requirement requests==2.12.4, but you'll have requests 2.19.1 which is incompatible.
magicseaweed 1.0.0 has requirement requests==2.12.4, but you'll have requests 2.19.1 which is incompatible.
locationsharinglib 2.0.7 has requirement beautifulsoup4==4.6.0, but you'll have beautifulsoup4 4.6.1 which is incompatible.
locationsharinglib 2.0.7 has requirement requests==2.18.4, but you'll have requests 2.19.1 which is incompatible.
libsoundtouch 0.7.2 has requirement websocket-client>=0.40.0, but you'll have websocket-client 0.37.0 which is incompatible.
insteonplm 0.11.7 has requirement pyserial==3.2.0, but you'll have pyserial 3.1.1 which is incompatible.
hipnotify 1.0.8 has requirement requests==2.9.1, but you'll have requests 2.19.1 which is incompatible.
gearbest-parser 1.0.7 has requirement beautifulsoup4==4.6.0, but you'll have beautifulsoup4 4.6.1 which is incompatible.
fedexdeliverymanager 1.0.6 has requirement beautifulsoup4==4.5.1, but you'll have beautifulsoup4 4.6.1 which is incompatible.
fedexdeliverymanager 1.0.6 has requirement python-dateutil==2.6.0, but you'll have python-dateutil 2.7.3 which is incompatible.
discord-py 0.16.12 has requirement aiohttp<1.1.0,>=1.0.0, but you'll have aiohttp 3.3.2 which is incompatible.
crimereports 1.0.0 has requirement requests==2.12.4, but you'll have requests 2.19.1 which is incompatible.
broadlink 0.9 has requirement pycryptodome==3.4.11, but you'll have pycryptodome 3.6.4 which is incompatible.
alarmdecoder 1.13.2 has requirement pyserial==2.7, but you'll have pyserial 3.1.1 which is incompatible.
abodepy 0.13.1 has requirement colorlog==3.0.1, but you'll have colorlog 3.1.4 which is incompatible.
Command "/usr/local/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-8hiorqmr/Adafruit-Python-DHT/setup.py';f=getattr(tokenize, 'open', open (__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-bpqvlta9/install-record.txt --single-version-externally-managed --prefix --compile --user --prefix=" failed with error code 1 in /tmp/pip-install-8hiorqmr/Adafruit-Python-DHT/
You are using pip version 10.0.1, however version 18.0 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
It was fixed by #15706, but missed the 0.75 release (info is shown in issue). For me now the workaround is not working anymore. I reinstalled the .py by hand, but I still get the known message. I think we have to wait for the .1 update
Stumbled accross this, cause i had the same problem.
Until you get the update, here is how i fixed it for me, maybe helps other people.
sed -i 's/Adafruit_Python_DHT==1.3.2/Adafruit_DHT==1.3.2/' /usr/local/lib/python3.6/site-packages/homeassistant/components/sensor/dht.py
Maybe you have to change the path to the dht.py file depending on your installation.
If you really have no idea where it could be try this
find / -type f -name dht.py
Yay. 0.75.1 has fixed this for me (hassio). It now loading adafruit 1.3.3 and DHT22 temp and humidity sensor working perfectly again. So that's how hot it has been in my living room!
No more problems with Adafruit component, but now it said ERROR ON DEVICE UPDATE
Log Details (ERROR)
Sun Aug 05 2018 10:56:09 GMT-0400 (Chile Standard Time)
dht: Error on device update!
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/homeassistant/helpers/entity_platform.py", line 248, in _async_add_entity
await entity.async_device_update(warning=False)
File "/usr/local/lib/python3.6/site-packages/homeassistant/helpers/entity.py", line 322, in async_device_update
yield from self.hass.async_add_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 122, in update
self.dht_client.update()
File "/usr/local/lib/python3.6/site-packages/homeassistant/util/__init__.py", line 325, in wrapper
result = method(*args, **kwargs)
File "/usr/local/lib/python3.6/site-packages/homeassistant/components/sensor/dht.py", line 157, 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.
What can I do? Thanks for the help
@besgum please open a new issue
Home Assistant release with the issue: 0.73
Last working Home Assistant release (if known): 0.72.1
Operating environment (Hass.io/Docker/Windows/etc.): Hassbian Please provide details about your environment. DHT22 sensor on raspberry GPIO and google location
Component/platform:
https://www.home-assistant.io/components/sensor.dht/
Description of problem:
ERROR (Thread-21) [homeassistant.util.package] Unable to install package Adafruit_Python_DHT==1.3.2: Failed building wheel for Adafruit-Python-DHT pyowm 2.8.0 has requirement requests<2.19,>=2.18.2, but you'll have requests 2.19.1 which is incompatible. locationsharinglib 2.0.7 has requirement requests==2.18.4, but you'll have requests 2.19.1 which is incompatible.
locationsharinglib 2.0.7 has requirement requests==2.18.4, but you'll have requests 2.19.1 which is incompatible. pyowm 2.8.0 has requirement requests<2.19,>=2.18.2, but you'll have requests 2.19.1 which is incompatible.