INFO Reading configuration /config/esphome/test-dev.yaml...
ERROR Error while reading config: Invalid YAML syntax:
while parsing a block mapping
in "/config/esphome/test-dev.yaml", line 1, column 1:
esphome:
^
expected <block end>, but found '<block sequence start>'
in "/config/esphome/test-dev.yaml", line 39, column 3:
- platform: bme280
^
If someone can help me with this, yaml is also new to me. The nodemcu is running with a smaller config and works like a charm, with one sensor, but cant get that code back, is that also possible with esphome?
first hint … you have to handle the errors bottom up … means no time to waste with the eshome error.
since so … what might be wrong with line 39 column 3?
the line itself looks pretty good on the first look.
But what does it belong to?
i2c: since that’s the last “:” ? Looks to me as if it should be a “sensor:” but it’s not declared.
if you solved that one.
next hint
remember indentation is not optional. if YAML requires things to be indented by 2 spaces then this is a must not something optional. Yeah I also like YAML because of being unable to handle such things similar to more common lanuages.
I’m getting there now, but little stuck on this one:
INFO Reading configuration /config/esphome/test-dev.yaml...
ERROR Error while reading config: Invalid YAML syntax:
while parsing a block mapping
in "/config/esphome/test-dev.yaml", line 40, column 5:
- platform: bme280
^
expected <block end>, but found '-'
in "/config/esphome/test-dev.yaml", line 53, column 5:
- platform: bh1750
Indenting is everything in yaml. You sometimes indent only one space extra, it should be 2. You seem to specify 2 buses, but you do not folow the specification for 2 buses you yourself linked to.
It would something be, but I still dont understand yaml, getting a litte confused of all the different methods and codes.
I hashed it out, so at least one sensor is working.
If someone could line it up good for me, I think I can understand it, and look for myself what I did wrong.
yes I have it working now, sort of. The bme sensor saying communication error and lux sensor gives data.
When I hash out the i2x bus_b and the bh1750 sensor, the bme sensor does work again.
What could that be? Limitation of the board or did I choose wrong pins?
If only 1 sensor fails while the other one works it’s pretty unlikely you used the wrong pins.
a example pics with a more complete pinout. Check yourself if you got a v2 or v2.x nodemcu and then make sure to define the correct one in the esp8266: board: section of your code.
Though it won’t make a differnce since both the v2 and v3 have D1 & D2 at the same pins.
Something which looked strange to me.
D1 should be SCL and D2 should be SDA … that the common way.
Perhaps you simply mixed up the cabels … double check all 3 devices have SDA connected to SDA and same for SCL.
It might also depend upon which sensor (bme) you got. Some do work at address 0x76 and some at address 0x77. Most of them offers selecting by connecting an additional pin to gnd if I remember right.
Please use
logger:
level: debug
then you’ll get much more information about if the sensor is detected and at which address it was detected.
And before using cable to make the sensor run at 0x76 it’s easier to use 0x77 in the code.
What other pins? Perhaps you could post you actual code again (the sensor section)
I only used a TSL2591 in the past and that gave no problems.
Some sensors are critical on the i2c clockspeed, but I never heard about the BH1750 being amongst these.
No hints given if you turn logger: level to verbose or even very_verbose?