Got a few of these boards set up fine accross my house, but I’ve tried adding an aditional one with just a PIR sensor.
After using the exact same code, hardware and config.yaml(obviously changing the MQTT topics and unique bits) A board I’ve deployed is not showing the PIR state at all. It doesnt say either standby/motion detected its just blank. The MQTT topic for the board is fine since I have a reed switch on the same board which is displaying the state correctly.
Anyone else suddenly having PIR function not working as expected on new board flashes? I’ve tried a couple of different PIR modules, and tried swapping the pins around in the code just in case the node’s board was defected.
The only thing I can think is either homeassistant is not liking PIR anymore (although my other PIR sensors are working fine) or something has updated in the arduino library prior to flashing the board that it doesnt like?
Any ideas? I will post my code tonight when I’m back home if anyone can help. Thanks.
Or you could try to use the serial monitor in the ArduinoIDE to see if you are getting any response from the motion sensor. Of course it depends on if you have debugging code built in to your sketch.
I should have uploaded this a while a back but here it is. Feel free to critique/fix things as I’m still learning on the ESP8266. This was my first ESP8266 learning project that got me hooked. Cleaned up a few things and ripped off the band-aid and threw it up there for now instead of waiting to finish/fix a few things. I’ll post pics of my case I used later this evening as I have one last thing to fix on it.
Thanks - I ended up completely starting fresh with my flashing and writing the code, ended up working so must have typed something slightly incorrect the first time.
Will defo use MQTT.fx in the future though - very helpful.
My redneck’d gutted Boxee Box turned into a sensor node. Little rough in some spots and need to figure out how to color the inside of the DHT22 without tearing it up, already had to unsolder the headers on the DHT22 and light resistor. But all in all it works and sits on my media center shooting the PIR down the hallway to tie into a Nodered flow with another motion sensor for dim lights for stumbling around the house after the alarm is armed and the sun is still down.
Have a few notifications/statuses on the LED, I put a second LED up top but didn’t tie it in yet. I did reuse the power button on the Boxee Box and tied it into a MQTT topic, haven’t done anything with it yet though other than being on the dashboard.
I have used a multitude of devices to power my NodeMCU sensor. All just random phone chargers, like old ones. The device doesn’t pull much power and for the most part is stepping down the 5VDC to 3.3 VDC for the ESP and other sensors. The PIR sensor is using the 5VDC line though. I do remember some folks powering their nodeMCU through the VIN/GND pins with 12VDC and it would step it down but then you would need to figure out another power source to match your PIR or if it could take 12VDC.
I have got the multisensors built, and have had various config problems along the way, and i eventually find the issue. however this time i am stumped. Basically I can get 1 sensor working perfectly apart from the LED. but my problem is that as soon as i connect a second sensor to power they both start to reboot until i disconnect 1. I have read about these rebooting randomly, but these just reboot every 5 seconds.
Not sure if i have posted in the right place, but hopefully someone will get me looking in the right place.
thanks for replying, had already tried power supplies but thought i would try again,. just tried a pair of brand new Samsung phone chargers with 2.0 amp output. also tried connecting both to 2 different laptops and still they reboot. So have rolled back to 2.3 from 2.4.1 on board manager and still the same result. I think it must be something in my configuration. also i cannot get the LED’s to switch on, which may be related. I can control both of the switches from the front end of HASSIO so don’t think they are the problem.
So here is the 1st part of the sketch for a sensor. i have not changed anything else from the original by Bruh, followed by my YAML file. If someone could take a look it would be really appreciated
Thanks
Si
#include <ESP8266WiFi.h>
#include <DHT.h>
#include <PubSubClient.h>
#include <ESP8266mDNS.h>
#include <WiFiUdp.h>
#include <ArduinoOTA.h>
#include <ArduinoJson.h>
/************ WIFI and MQTT INFORMATION (CHANGE THESE FOR YOUR SETUP) ******************/
#define wifi_ssid "VMxxxxxx" //type your WIFI information inside the quotes
#define wifi_password "xxxxxxxxx"
#define mqtt_server "192.168.x.x"
#define mqtt_user "xxxxx"
#define mqtt_password "xxx"
#define mqtt_port 1883
/************* MQTT TOPICS (change these topics as you wish) **************************/
#define light_state_topic "House/Backroom"
#define light_set_topic "House/Backroom/set"
const char* on_cmd = "ON";
const char* off_cmd = "OFF";
/**************************** FOR OTA **************************************************/
#define SENSORNAME "xxxxxxxxx"
#define OTApassword "xxxxx" // change this to whatever password you want to use when you upload OTA
int OTAport = 8266;
Thanks. yes your right about case sensitivity, i have put that right and got the LED working, but the colours are all over the place. I will investigate further.
As for the rebooting, i seem to have cured it. I don’t know what was causing it but i built a new sensor and replaced 1 of the 2 and now quite stisfied
So just the LED to sort out, although i can’t really see what purpose it serves but as its there i want it to work.
It is my understanding that ground is the longer leg, but i cant get any life out of it unless i use the other middle leg as ground, but as i said the colours appear to be all mixed up.
For those that have printed the Bruh case and use a lolin esp8266 and found that it does not fit. I am working on a new design that makes the outer diameter bigger so the chip will fit but the internal cuts outs are the same, drop me a pm for the .stl
I am trying to use this as a light sensor for my screens.
The problem is that the lux range stops at 970. i need more range to make a difference noticeable between direct sunlight and bright daylight.
Yes it would have to be changed as the sensor works on the i2c bus utilizing 2 GPIO pins. The library for these chips are somewhat simple but offer a larger range and high precision you are looking for.