I have similar problems, the sketch by BRUH works just fine but I have problems with the LED option in the Shawn Cory sketch, all other sensors work just fine and my sensorname is “sensornode2”.
So, I struggled for weeks with getting intermittent NAN values from my DHT22’s on 6 different Bruh multisensors.
When I built the first one I thought it may have been a hardware issue with the nodemcu board, the DHT sensor or the power supply being used, but after building 6 of these with different brand power supplies, NodeMCU’s, DHT’s, etc. I was getting intermittent NANs on all of them at different times.
The only thing that would reliably fix it was to remove power from the nodemcu and reapply it (a reboot). After that it would tend to work for a while but the NANs would come back. Sometimes, very infrequently, it would fix itself.
I didn’t want to stuff around with other libraries as I am just learning Arduino and didn’t want to introduce a possibly conflicting library as I didn’t know what the impact of that would be or how to undo it if I had issues.
The way I fixed it was to install version 1.1.1 of the library (the version previous to 1.2.0). After recompiling and redeploying the new code to all Bruh sensors, I have not had another NAN reported for a couple of weeks now.
There is a side effect though. The ComputeHeatIndex function within the DHT library doesn’t appear work properly in v1.1.1. It produces obviously incorrect heat index data. When humidity is high, heat index is low and vice versa.
I just ignore the heat index value calculated by the nodemcu, and calculate my own heat index inside of hassio using a value template.
I hope this helps someone who has/is experiencing similar frustrations to me. I almost abandoned the project because of it, but now I am stoked it is working. Wifey is not all that happy about seeing little 3D printed black boxes everywhere that flash red when she walks past them, but that is part of the fun isn’t it? Annoying the missus!
Hi, i have built this sensor and used Bruh his code.
All works except for the light sensor. I use the temt6000 for that but i get no value at all.
I ordered two of them and both don’t give a value.
Do i have to change something to the code?
I also used the example Yaml from Bruh, but i cant find something wrong in there.
then probably your temt6000 broken. When finished upload and connected to wifi you can test and should show the result except the led because didn’t have on-off command yet.
Built one of these a few weeks ago and damn I think the wife hates it. HA! Why does she hate it? Because I’ve been spending hours learning the code. Think I’ve tore into just about every piece of this sketch except the LED part as I didn’t have one to play with. Have a batch coming and will probably fix/change a lot of that too. Reminds me of the old school days writing efficient and tight code in the DOS days.
It’s probably a little overblown but I’ve broken out the MQTT calls to each sensor to get rid of those spikes in the graphs at times, added some status changes with the internal LEDs, such as blue with no motion and red with motion, cycling LEDs for WiFi disconnects or MQTT disconnects, controllable internal LEDs, configuration files on the EEPROM, etc. Working on the HTTP status page and throwing in the WiFi AP stuff on new/reset configs. I hate hard coding stuff! Will probably see about ordering a few different sensor types to add to the config. I’ll probably drop the source code later once I get things cleaned up.
Now I just need to find some cases for them or breakdown and buy a 3D printer. Been thinking of some ideas to do an all in one with a wall power supply where I can just plug these in the wall and point the PIR, or mounting them in some 1 gang boxes with the sensors mounted in a 1 gang plate. Anyone use the BME280 sensor yet?
I’ve also thought about the gang box route - would love to hear about your experience if you do it! I was looking at getting/making something like this AC-to-DC converter so that I could just tap into an existing power source in the wall, and in the event that I move I can just replace my sensor with a standard outlet and not have a random hole in the wall.
I was trying to keep some costs down and labor, been thinking of a few things.
One would be to buy a 2 gang box, old work style(deep) (US here). Mounted over something like a doorway for motion. Like in a bathroom above the door, you probably wouldn’t see it unless you were looking up on the way out. Throw in one of those all in one USB all in one chargers outlets on one side and blank on the other side. The USB wire would be shown a bit but loop it back inside and attach to the NodeMCU. Other three sensors would attach to the blank side of the plate. It would be relatively easy to fish down a piece of romex to power the plug, although it would never get used but you aren’t modifying anything on the 120vac side, all of your “hackery” is on the low voltage side. But would that comply with things mixing voltages in the same box. Probably not. I guess you could mount two 1 gang boxes but then what do you do when you don’t want it there anymore? So I kinda scratched this one.
It would be awesome to get one of those little taps to 2 prong for a phone style charger and throw it all in the 1 gang box. Again does it comply with things… hmm…not sure. Or an alternative would be a decent little power supply that has two screw terminals in and 5vdc out on the other of course.
I do think the best solution to comply with things and makes things easy is to have a little enclosure snap over a small flat phone charger close to the wall. Pack the sensors in to the box and call it a day. There’s that 3D printer need again! Something kind of like this. https://www.amazon.com/Matone-Generation-Assistants-Space-Saving-Solution/dp/B078W5JHJB
This evening i built the other sensor with the other node mcu. But with one of the temt6000 that didn’t work on the other node.
I don’t understand it, but now the light sensor on that node does work.
So that problem is solved.
may be because of the power supply. I mean not enough electricity supply to all sensors. If temt6000 works on another node mcu that means temt6000 is not broken.