Hi This is my first post on the site, I searched/looked/tried a bunch of things but none worked for me.
So… here I go.
I have the Node MCU ESP8266 (esp-12e model) and a generic PIR motion sensor with 3 pins.
I tried connecting the “data/yellow” wire to a bunch of different pins (2, 3, 13, 17) are the ones I was told to use by different posts and comments and from the ESPHome how to. nothing works…
heres the wiring:
red: on the 3v3
black: on the ground
yellow: on the “out” pin from the PIR and pin D7 or D3 or D4 etc…
also tried spelling in the .yaml
this is the last one i tried:
binary_sensor:
Those PIR sensors are marginal on 3.3V according to the ESPHome documentation. If you have 5V also, might be worth trying that.
When you say “not working”, do you mean the binary sensor isn’t created in HA, or that motion detection isn’t happening? You are putting the code you wrote into the ESPHome configuration YAML, and not HA’s YAML, correct?
This is my working code on a D1 Mini for two PIR sensors:
Post the complete code from ESPHome (the *.yaml) for this node (yep, rule 11 ).
Afterwards tell us exactly how and what you wired from and to your NodeMCU. How do you power it, how do you power the PIR and so on. The more detailed the information, the faster this get’s solved.
Looks pretty similar to the Joy-it ESP32 Wroom.
I wouldn’t be surprised at all if the VN in the top left provides 5V.
Not to mention that most NodeMCU board provide both on the opposite of each row of connectors. Means if one side offers 3.3V the other offers 5V
https://joy-it.net/de/products/SBC-NodeMCU
Sorry the pin is exactly named Vin = Voltage in
Means if you connect using the USB this serves the device with 5V.
And you’ll find this voltage on the first pin on th left side holding it upwards with the USB on the bottom.
Despite the code issues you suffer, I would wonder if you get it to work with 3.3V. Google is your friend and there’s several hints to try with 5V.
EDIT: you’ll find the pinout on the link given if you scroll down the page.
INFO Reading configuration /config/esphome/mtn_snsr_01.yaml...
ERROR Error while reading config: Invalid YAML syntax:
while parsing a block mapping
in "/config/esphome/mtn_snsr_01.yaml", line 1, column 1:
esphome:
^
expected <block end>, but found '-'
in "/config/esphome/mtn_snsr_01.yaml", line 28, column 1:
- platform: gpio
^