Sensors spread over three houses => several RPIs, Can I still use one MariaDB on NAS for all installations?

Well, I did not succeed that well. I have tried two tracks now:

  1. From the Arduino IDE
    I quickly got a blink demo to work. It means I could upload/flash SW.
    Then I tried to setup wifi. Here it starts to fail. It takes many++ attempts to connect to my wifi. By looking at WiFi.status I get a lot of WL_DISCONNECTED and WL_CONNECT_FAILED even if the router is a few meters away.
    I have download several other files but I get the same result.
    I have tried two different Wemos modules withe same result.

  2. ESPhome
    I connected the Wemos module to my RPI running HASS.
    I installed the ESPhome on my HASS.
    When I try upload the SW it ends with

Creating BIN file "/data/wemos_1/.pioenvs/wemos_1/firmware.bin" using "/data/wemos_1/.pioenvs/wemos_1/firmware.elf"
========================= [SUCCESS] Took 15.73 seconds =========================
INFO Successfully compiled program.
INFO Resolving IP address of wemos_1.local
ERROR Error resolving IP address of wemos_1.local. Is it connected to WiFi?
ERROR (If this error persists, please set a static IP address: https://esphome.io/components/wifi.html#manual-ips)
ERROR Error resolving IP address: Error resolving address with mDNS: Did not respond. Maybe the device is offline., [Errno -5] No address associated with hostname

My interpretation is that it is the same problem as for Arduino IDE attempt above.

I feel like a looserā€¦
Any suggestions?

Verify your router isnā€™t the problem (mac filter, etc). The fact that it happens in arduino and esphome makes me lean toward the router being the culprit here. Sometimes setting a static ip for esp devices can make connections more reliable.

Another thing to look at may be power supply, but you said it wonā€™t work plugged into the pi so probably not a problem. Using espeasy (dev version!) should eliminate any issues with older libraries. You are using dev right? The current release (1.14 iirc) has known wifi issues.

I was using current release and not dev of ESPhome. Will reinstall and try again before I set a static IP.
ESPhome seems like a nice way to run the board. I hope it will work.

Srry I havenā€™t read the whole thread, but I did want to answer the question. I would advise against using the same database for 3 different HA installs. Why? Well simply put, if the database fails/crashes you will lose data from all of them. It is better to use separate databases and then back them up to a central location.

This would be my advice so it isnā€™t a necessity. But I always think of point of failures and redundancy, and using a single database is imho not the best way.

That is likely the problem (with esphome anyways). To run dev, add this to the hassio addon configuration (hass.io menu/add- on store/esphome):

{
  ā€œesphome_versionā€: ā€œdevā€,
  ...
}

ā€¦then restart ha (configuration/server controls/restart). After a few minutes esphome dev will be installed (see esphome addon logs for progress).

Yeah i bet you will like esphome. You arenā€™t the first to have the wifi issue. There were lots of very unhappy campers having to climb in attics to recover esphome devices after esphome released 1.14ā€¦ and since then releases have not fixed it (thank goodness for dev/1.5). Poor souls who hit the ā€˜update allā€™ button have learned a lesson about upgrading stuff. So going forward, do beware that although esphome is good stuff and the devs mean well, it still has that early adopter beta flavor to it. Working with ha though, we should all be used to thatā€¦ so keep the ā€˜if it ainā€™t broke donā€™t fix itā€™, and ā€˜letā€™s have others find the bugsā€™ approach with esphome as well.

I reinstalled the dev version of ESPhome and realized that I could now change between OTA and serial flash. Maybe I missed that option earlier.
Now it ended much better:

[22:01:20][I][ota:046]: Boot seems successful, resetting boot loop counter.

Tomorrow I will try to add things and remove it from the RPI.

Thanks a lot for your patience!

Ah yes, first flash has to be serial of course. I was using the esphome flash tool on my windows pc, mainly because my pi is locked up in a box at the top of a closet and my embedded stuff (ftdi, pogo clips, etc) is just on top of a garage bench. Yeah for pi flashing you have to change the webui from ota to the serial port.

Btw, welcomeā€¦ I enjoy helping and what goes around comes around.

[Edit: on a side note, especially since you are under a time crunch, you should use the native esphome native api. It makes getting from start to a working system faster, and also makes changes later on less a headache (donā€™t have to deal with stored mqtt messages from deprecated topics).]

The native API looks very interesting. Will try that before adding sensors to Wemos.
Then I will add my onewire sensors using the Dallas sensor component.
Goal is to read all onewire connected sensors and via native API log them in my main HA.
I will get resistors tomorrow to be able to connect onewire network. It was a good description on esphome.io on this.

It is impressive how well ESPhome is integrated with Home Assistant. It just worksā€¦ :slight_smile:

Just some words of encouragementā€¦ today I just changed firmware on 3 of my DIY nodemcu devices from my arduino code to esphome, and they are working great so far. These devices have dallas temp, dht humid, PIR motion, beeper output, and one of them has an ms5611 baro. My DIY code did some averaging of values between reports. Esphome has some filter options that can be combined to accomplish the same thing, but I left it basic since a single value every 60sec is good enough.

Here is what I used in case it helps:

dallas:
  - pin: GPIO14

sensor:
  - platform: dallas
    index: 0
    resolution: 12
    accuracy_decimals: 1
    name: "Closet Temperature"
    id: celsius
    unit_of_measurement: "Ā°F"
    filters:
      - lambda: return x * (9.0 / 5.0) + 32.0;

I used index, because each esp has just 1 sensor. If you need the actual location of each temperature on a string of several dallas sensors, youā€™ll have to get the addresses for each sensor and use ā€œaddress:ā€ in the config instead of ā€œindex:ā€. If you donā€™t have that info handy, you can upload esphome with just the first 2 lines (no sensors configured), with debug logging enabled, and use the esphome logs to determine addresses as you go around heating/cooling each probe. OTOH, if youā€™re just averaging the temps, or just taking a max/min (ie location doesnā€™t matter), then you can cheat and just use index instead.

Also, yeah itā€™s hard to say enough about how nice it is to work with esphome. On my pc, it takes about as long for atom/pio just to load up, as it does for me to edit a config and upload using esphome. Then after pio loads, I make my edits, compile, go to ha mqtt server to send a message to turn on ota, then open a browser window to go to the ota address, then enter ota credentials, then browse to the firmware file, then upload, then go back to ha mqtt to disable otaā€¦ then if I added any messages Iā€™ve got to configure ha for the mqtt topic, and likely make a template so itā€™s useableā€¦ whew, all that work just to get to the same point as esphome, which finished before pio even loaded!!! LOL if folks donā€™t get the point, just trust me esphome (tasmota, espurna, etc) make things way easier!