hi. I have added a esp32c3 to my home assistant , (someone said home assistant makes everything much easier xD) so i have the esp32c3 connected with a dht22 humidity and temp, wich i want to view in home assstant… BUT HOW!??
I have it all working in arduino, but NOTHING works in home assistant…
inside the esp home tab it says:
With ESPHome, you can go from a few lines of YAML straight to a custom-made firmware. For example, to include a DHT22. temperature and humidity sensor, you just need to include 8 lines of YAML in your configuration file:
Then just click UPLOAD and the sensor will magically appear in Home Assistant:
Where is the yaml file? where is the upload? wow creat tutorial xD plz help
On the ESPHome website you can find code examples for everything you can connect.
This also applies to DHT22, did that code not work? (Copy and Paste)
Have you configured right pin ie GPIOXX
Is your ESP up and running in ESPHome?
You say that you have installed the ESPHome extension and that you have also added your ESP32-C3 device.
If you have done this, you will also find its configuration file when you open ESPHome. The configuration file has the name that you named your device.
When editing that file, you should paste your code under the heading captive_portal:
Under the heading, you can start by adding the code
web_server:
port: 80
Then you can look at the measurement values via the device’s web server.
If you are not sure how to do this, there are many videos on YouTube on how to do it.
Here are some examples…
You have got to use code formatting! The spacing of different things in that code matter. When you dont format the code and just copy/paste then it all just gets shoved over to the left margin. No one looking at that knows if you just used some bad spacing or its something totally different. Its 3 (```) without the number 3 or the (). You put 3 above the code block and 3 under it at the end.
You have an error for just abour everything and its probably your spacing. Quit freaking out and post your whole config, top to bottom AND use the code formatting!
Your not using code formatting either… how do you plan to help someone with left aligned text for your “sample DHT22 config” ? They cant see how the syntax is supposed to be formatted or worse, they left align all their config just like the sample you gave them to use.
You ever seen a dog chase its tail??? Thats kinda whats going on here.
You’re right that we should copy the code in here correctly, but I think ticsyboy has this covered.
The problem is probably that he hasn’t entered the correct port that the sensor is connected to.
Thats the conclusion you came to after seeing the laundry list of errors? They just used the wrong gpio? Even though the error shows they used “GPIO4”
Maybe they should just keep going down the line and trying another perfectly fine gpio next?
@ticsyboy
You must copy your code correctly so that we can see if it is correct.
In the Reply dialogue, first click on this symbol </> , and then paste your code.
Copy the code from the heading captive_portal: and down, that’s enough.
And I mention once again that you must write the port you are using in a correct way.
If you have the device that my picture shows, write GPIO4 or D2, (not just 2).