Hi, read the entire thread. I want to give it a go but need some startup push. Having a D1 mini, where do I start from there to get that up and running with what yaml? How do I get yaml onto that? And how do I hook it to homeassistant? Connecting a flow meter to gpio5 seems the most easy part :-). And powering D1 with usb or 5v is the other easy part :-).
So, I run hass on esxi with 3 exisitng is use usb passthroughās. If I wanted to use the plugin I would have to add an new passthrough to the D1 miniā¦ would have to connect, stop hass, passthrough usb, start, etcā¦ and every new D1 would mean the sameā¦ Is that the only way or is there other options to connect to an esp8266?
Hi @sender. I run hass on a RPI4, and I run esphome as a plugin inside it. I use esphome for the initial compile, and then I select the option to download the compiled binary file.
I flash that binary file onto whatever ESP device Iām working with on a Windows machine, using an FTDI interface and the FlashESP8266.exe file that came with EspEasy (an alternative ESP firmware), because thatās the method that works for me.
Itās only ever necessary to do this once. After that, any updates or changes you make can be sent to the device via OTA update from within ESPhome.
I do a compile using esphome addon and and then I upload using usb by connecting the esp8266 to the RPi4 on one of the USB ports. After the first upload, uploading later can be done by OTA as you suggest @DeeBeeKay
Been following this project and finally today ordered this https://www.electronicscomp.com/sensors-module/sensors/water-flow-rain-drop-sensor/0.75-inch-brass-water-flow-sensor-sen-hz43wb
will use this sensor in the inlet line to detect that water supply has started as an added protection to my pump running dry. I have this pump connected to a smart switch based on esphome as an automation to start when level indicated by level sensors is true and the time is 5 AM or 17 PM. water timings change so I will add the flow sensor in the logic too.
my home assistant is on a segment 192.168.4.0/24 and the esphome is on 192.168.6.0.24 and they can reach each other (hence it got discovered - and other device like tasmota work fine this way).
What is wrong?
Edit: this is hte logging of the esphome via usb:
[21:02:51][C][wifi:415]: WiFi:
[21:02:51][C][wifi:283]: SSID: āIOTDOMā
[21:02:51][C][wifi:284]: IP Address: 192.168.6.6
[21:02:51][C][wifi:286]: BSSID: 70:4C:A5:72:C9:23
[21:02:51][C][wifi:287]: Hostname: āwatermeterā
[21:02:51][C][wifi:291]: Signal strength: -56 dB āāāā
[21:02:51][C][wifi:295]: Channel: 11
[21:02:51][C][wifi:296]: Subnet: 255.255.255.0
[21:02:51][C][wifi:297]: Gateway: 192.168.6.1
[21:02:51][C][wifi:298]: DNS1: 90.145.32.32
[21:02:51][C][wifi:299]: DNS2: 90.145.32.33
[21:02:51][C][logger:175]: Logger:
[21:02:51][C][logger:176]: Level: DEBUG
[21:02:51][C][logger:177]: Log Baud Rate: 115200
[21:02:51][C][logger:178]: Hardware UART: UART0
[21:02:51][C][captive_portal:169]: Captive Portal:
[21:02:51][C][ota:029]: Over-The-Air Updates:
[21:02:51][C][ota:030]: Address: watermeter.local:8266
[21:02:51][W][ota:036]: Last Boot was an unhandled reset, will proceed to safe mode in 7 restarts
[21:02:51][C][api:095]: API Server:
[21:02:51][C][api:096]: Address: watermeter.local:6053
[21:04:43][I][ota:046]: Boot seems successful, resetting boot loop counter.
[21:04:58][D][api:067]: Disconnecting aioesphomeapi (192.168.1.142)
[21:04:59][D][api.connection:583]: Client āHome Assistant 0.114.0 (192.168.1.142)ā connected successfully!
EDIT:
got it working! Had to tweak pihole, my DNS servers, etcā¦ I think using DNS is not very handy and just another weak link in this chainā¦ but I have now āsomeā sensor in my hass:
Howzit, greeting from Limpopo, I see youāre also South African.
I wish I could give you more explicit help, but the problem is the sensor I am using has exact data in the spec sheet saying that 27 rotations = 1L. That makes it super easy to do, because if you know this, then you just divide the incoming number of rotations by 27 and tadaaaaa you have litres. Which is what youāll see if you scroll up and look at my yaml.
You, however, have a weird sensor that has a formula I donāt understand. What you want is to know how many revs = 1L. All I can suggest is mega googling on that sensor to see if someone has worked that out. Failing that, you are going to have to do the hardcore practical way.
This is the hardcore practical way. Configure your sensor with a very short update_interval. Then, pour a litre of water through it, and time how long it takes, while also keeping an eye on the data output. You want to know a) how long a litre takes to move through, and b) what the average pulses per minute were.
With those two pieces of information, you can calculate how many revolutions the sensor takes to pass 1L of water. I recommend you do it several times and average your results. And for better resolution, do it again with 2L, and with 5L. Youāre not going to be perfectly accurate, but youāll get within error bars of the truth.
EDIT: I forgot your second question. To do total litres you will need to configure a sensor in HomeAssistant, which I describe in this post: Using ESPhome to build a water flow rate meter
A quick glace at the specs for that sensor shows that it gives you 6.68 pulses per litre, or explained the other way around, one pulse should be equal to 0.1497L.
@DeeBeeKay the formula is not weird, it just has the accuracy value tacked on the end in the spec listing.