Cant get DHT11 Sensor to work with HA Raspi 4

hi i cant seem to get the DHT11 Humidity and Temperature Sensor to work… Im using Pin 4 for the Data line
… i googled for help one page said use the Raspi-config and change to ICT to enabled
but when i use the Home assistant image from home assistant website… i cant SSH in and there is no raspi-config or Sudo in the Terminal ssh of Home Assistant

i read one article that Hass doesnt work right but you might need Core but wasnt tested…
so how you get it to work?
my code is

sensor:

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

Have you got a resistor in place between + & data

ya 10k resitor for humitiy and without it just does temperature
but so far still wont show up in develop tools

i tried adding a name: tempdisplay

and then i restart configuration but it wont show up in development tools

also it works fine on the Arduino just not on the pi running HA

i tried a clean raspbian install
and
https://www.circuitbasics.com/how-to-set-up-the-dht11-humidity-sensor-on-the-raspberry-pi/

and still cant get it to work yet works fine on arduino
also i enabled IC2

but still nothing

cant seem to get it to work with raspberry

It seems that maybe it should be pin 23, from the example you copied the yaml for a pi3

The name of the pin to which the sensor is connected has different names on different platforms. ‘P8_11’ for Beaglebone, ‘23’ for Raspberry Pi.

Example

An example for a Raspberry Pi 3 with a DHT22 sensor connected to GPIO4 (pin 7):

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

IDK the way it’s written isn’t really clear. Once upon a time gpio didn’t work on 64bit systems, idk if that is what you’re running. However, I don’t see the note on the gpio page so it may be supported now.

im running 32 bit… on the image page it says 32 bit for GPIO pins and 64 bit is not GPIO supported it looks like

so i changed it to Sensor DHT11 thats what u running and pin 4 i have tried other ports but nothing…
i have tried 2 different Raspberry Pi 4s… i even ran raspbarian and ran scripts but it doesnt work… but has no issues with the Ardunino… so i confused why its not working

so ya i stuck again i find alot of things not written well but then i still learning HA teaching myself

but ya i dunno and i tried gpio 23 too didnt help

In the meantime since there ia no where else to go with the pi right now, I’ve used firmata for switches via a usb connected audrino to my pi. You could try that. The other option would be if you have any esp board like a d1 or nodemcu, esphome will work and work well with HA.

dont think i have this esp board?
i bought this kit
https://www.amazon.ca/gp/product/B07D3RZZNN/ref=ppx_yo_dt_b_asin_title_o08_s00?ie=UTF8&psc=1

and dont know what firmata is at the moment ill have to google it later…

but i have that kit… and was trying to get the temperature to work on raspberry pi but of course i having bad luck lol

Firmata is a library that can be used to connect a pi to audrino. I came across a post that goes through the steps for connecting a DHT via an audrino.

I too had purchased a similar kit but found all the sensors to be very poor quality. If you want to do DIY type sensors for HA esphome is the way to go. Esp boards have built in wifi and bluetooth making them easy to setup away from the pi.

https://www.amazon.com/gp/product/B07QCP2451/ref=ppx_yo_dt_b_asin_title_o04_s01?ie=UTF8&psc=1

https://www.amazon.com/gp/product/B081CSJV2V/ref=ppx_yo_dt_b_asin_title_o06_s00?ie=UTF8&psc=1

these devices are like ardunino or raspberry pi then?
u just plug the DHT11 to it and then access it through wifi?

More like an audrino, kinda like a newer smaller version with additional features. Most of the time you can power them from a micro usb cell phone charger. Check the voltage though some are 5v others 3.3v.

ah ok and whats the difference between the 2 i seen 2 different kinds… is 1 better then the other… are codes written the same… or is the website you sent me to show you how to write it for per device? as i know this kit only has ardunino stuff

One has more inputs than the other. The smaller/cheaper ones are usually are more than enough connections. I’m using the bigger one to run 7 temperature sensors and 4 relay switches, I could have probably got that on the smaller one.

Esphome has guides. Then there are also videos for esphome and HA.

ok thanks ill check out thos
@Mikefila can you also hook up just a regular network cable… as i dont always do Wireless and wireless flaky at times plus outside i was gonna run a network cable in the ground as that way snowing cant ruing signal
and you run 7 temp sensors do you then use MQTT? i trying to teach myself that too as i like that 7 temp sensors for say around my basement to give me idea of the Humidity as i find one area more then the other… but i always liked Wired Nic… least then it can be connectdd as wifi isnt always perfect but i wont turn it down either… so ill l.ook into this stuff its cheaper then a raspberry pi thats for sure.

esphome is kinda geared to wireless. esp, espressif long version, is the name of the chip that gives the board wifi capabilities. They support ethernet on the bigger version (esp 32) but I’m not familiar with it’s setup.

If you want to run wired you can get a shield for the Arduino. For your wired locations using an arduino might be a better choice.

https://www.amazon.com/SunFounder-Ethernet-Shield-W5100-Arduino/dp/B00HG82V1A

ah ok ill look into it all i do have an ardunio i got it with the kit for the DHT11 but i used to the raspberry pi as its all in 1… nic and gpios home assistant…

i trying at the moment to use rpi home assistant and then link to my main HA i did find remote home assistant but it doesnt show up in pluiggins and i not sure how to install it… so i looking at all options … and ill look into more the esp stuff too i didnt have any of those to experiment with sso i new to it all in the end

@Mikefila so i looked up some…
i looked that esp is added to an Ardunino. and then u need to use a cell phone to access it… but i not sure how i access the code on the Ardunino to simulate button press’s

i did look at the esphome it seems to have the stuff u need for home assistant

you mentioned the esp is like board with a wireless
i was considering it… but i not sure which one… i have a program i written with bit of help thats on Ardunino uno and looking at the size of Arduno Nano which is the ESP equavlant with the wireless add on? and can you upload the code from ardunino to the ESP and then works fine with home assistant?