Orange Pi One ($9.99) Home Assistant Server + DHT22 ($2.50) Sensor

Hi there!

I’m a new Home Assistant user and just playing around since a few weeks.

I use a Orange Pi One Quad-Core H3 with 512MB RAM running the latest Armbian with Home Assistant via Python Virtual Env environment. I catched the hardware for $9.99 from ali express.

I now took another $2.50 and bought a DHT22.

I got it running with this guide: https://www.piprojects.xyz/temperature-humidity-sensor-orange-pi/
and get data from the sensor with the ‘dht’ program compiled with help of the tutorial.

I did the setup in home assistant with the help from here: https://home-assistant.io/components/sensor.dht/

my code in the configurations.yaml is the following:

# DHT Sensor 

  - platform: dht
    sensor: DHT22
    pin: 7
    monitored_conditions:
      - temperature
      - humidity

but I just get the following output: unknown for both values

unkwn

In home assistant under dev-info it always throw’s this messages:

Updating dht sensor took longer than the scheduled update interval 0:00:30
8:39 PM helpers/entity_component.py (WARNING)
Update of sensor.dht_sensor_humidity is taking over 10 seconds
8:39 PM core.py (WARNING)

I’m open for any debugging :wink:

Sorry, new users can only put one image in a post. :rage:
Sorry, new users can only put 2 links in a post. :face_with_symbols_over_mouth:

1 Like

Im not sure i have seen anyone using the DHT sensor on another platform (other than Raspberry Pi).

From what I recall that sensor is setup using the dht python program from adafruit which is written for the Pi. You would need to adapt it to work with the Orange Pi.

I’m don’t have any coding skilled (was long fight already to get used to the yaml structure) but I think there is already python code doing exactly this for the orange pi: https://www.piprojects.xyz/temperature-sensor-orange-pi-python-code/

Can this be used for home assistant?

Btw - this is how my setup looks like (server&sensor in one :crazy_face:)

1 Like

I use DHT22s and BMP180s on Wemos D1 Minis, or NodeMCUs. They are a perfect fit

How do you connect them to home assistant? Which firmware is running on the esp8266 and do you use the MQTT protocol (build in with home assistant?). Do you have a tutorial setting everything up? Sounds very nice :wink:

I should have been more clear. I haven’t seen anyone using the Home Assistant DHT sensor Component on another platform (other than Raspberry Pi).

MQTT

I write my own code on them, and use MQTT

Sorry, I do not.

Yeah, I like them.

Ha. Sorry for the confusion. :wink:

Here you have a tutorial for the DHT22 communication with home-assistant.

Or better, you can use the SHT30 shield with a wemos D1 Mini:

Don’t think you’ll be able to use the DHT component as it uses the adafruit python lib: https://github.com/adafruit/Adafruit_Python_DHT.
There’s no support for OrangePi in that library.

Are you able to read the DHT data via terminal, like in this how to?:

You can add them to a WemosD1 mini and run them through ESPEasy. I would personally recommend ESPEasy over any roll your own. It’s easier to manage, update and handle.

Yeah, too bad ESPEasy wasn’t around 2 years ago when I wrote mine. LOL. I spent a lot of time getting all the code and OTA implemented…

Interesting is the fact that the code actually somehow does something. Any other pin (instead of the right one - Nr. 7) in the configuration is preventing the the component coming up successfully in home assistant (no sensor in webview and many lines in the logfile complaining about the pin is not correct).

sadly I’m not familiar with python. I tried a quick run but stuck when I need to install. It looks there is a problem with my python environment (3.4) but I’m not able to debug.

pyA20/gpio/gpio.c:25:20: fatal error: Python.h: No such file or directory
 #include "Python.h"
                    ^
compilation terminated.
error: command 'arm-linux-gnueabihf-gcc' failed with exit status 1

But I guess it’s working if somebody is skilled. The same author did the tutorial I used to read out in C Code - see link in the first post…

I also did some cross reading and found out that the library in tutorial is not the freshest. There is some recent work done here: GitHub - chwe17/pyGPIO (More @ pyGPIO - A 'more general' python GPIO library - Reviews, Tutorials, Hardware hacks - Armbian Community Forums) which is far more general and should work with a lot’s of boards and SoC’s. If I understand correct :face_with_monocle:

System: Sorry you cannot post a link to that host. WTF? What’s wrong with you? :face_with_raised_eyebrow:

WTF is wrong with you???

Hello,

This is an automated message from Home Assistant Community to let you know that your post was hidden.

Orange Pi One ($9.99) Home Assistant Server + DHT22 ($2.50) Sensor - #4 by orange-assistant

Your post was flagged as spam: the community feels it is an advertisement, something that is overly promotional in nature instead of being useful or relevant to the topic as expected.

Multiple community members flagged this post before it was hidden, so please consider how you might revise your post to reflect their feedback. You can edit your post after 10 minutes, and it will be automatically unhidden.

However, if the post is hidden by the community a second time, it will remain hidden until handled by staff.

For additional guidance, please refer to our community guidelines.

Why is everything overblocked? :face_with_symbols_over_mouth: This is not normal!!!

1 Like

This is how you should install the GPIO library:

git clone https://github.com/chwe17/pyGPIO
sudo apt-get update
sudo apt-get install python-dev
cd pyGPIO
sudo python setup.py install
python setup.py install

If it still fails try installing these packages:
sudo apt-get install python3-pip git-core python-dev python3-dev python3-pip git libssl-dev libffi-dev wget git pkg-config libboost-python-dev libboost-thread-dev libglib2.0-dev python-dev libcap2-bin

This did it! I needed Python 2. Now it worked. And yes. It works. Easy…

Get the results via python:

Last valid input: 2018-01-17 22:02:07.019286
Temperature: 20.20 C
Humidity: 60.70 %
Last valid input: 2018-01-17 22:02:08.099118
Temperature: 20.20 C
Humidity: 60.80 %

So the question now is how to get this upstream into home assistant so I can get the results in the webui :relaxed:

BTW: I didn’t used the pyGPIO (don’t know what to do with it!) but instead I used the 2 git’s from the tutorial:

I did a request over here:

maybe something happens :smiley:

//1984 censor crew was here

Wow. Thank’s for the hint. The specs for the SHT-30 look great! Do you know any difference between version 1 and the (more expensive) version 2 (you linked in your post)?. The only information I found is for the version 1.0 - also from the wemos site? I don’t find anywhere mentioning version 2?

The version 2 have a cut in Pcb to isolate the sensor from the wemos board heat.
It’s a little less disturb by the heat generated by the wemos.
Just look at the picture on aliexpress, you’ll see the difference. Unless this “shape” difference, they are the same. Functionality and programming is the same.