If you are running Home Assistant core and would like to flash your NodeMCU with ESPHome and integrate it with Home Assistant then you can follow my steps.
Install the ESPHome docker image. I use Unraid so I just installed it from the community apps.
Open ESPHome, it'll run on port 6052 and click the + sign to add a new node
Node Name: Give it any name you want. This will also be it's local DNS name. It needs to be lowercase.
Device Type: I just picked NodeMCU under ESP8266
Wifi: Enter you wifi info. This is what the NoeMCU will use to connect to your wifi router
Click finish. It will build and fail because it can't connect to your NodeMCU. This is expected the first time you try to flash your NodeMCU
At the home screen in ESPHome, click the ... on your device, click "Compile" and then "Download Binary". This is what we'll use to flash the device for the first time so you can then use wifi going forward
Flash the device with your binary from the previous step
Plug in your NodeMCU to your compouter with a USB cable
Open esp-home flasher and select the serial port for your node. You list of serial ports might be empty. If so, this might be your problem 1) install the driver, I used the CP210x Universal Windows Driver 2) try a different USB cable, some are charging only and otherwise won't work.
Now flash the device by selecting your downloaded bin file and clicking the flash button
Now your device should be on wifi
Go back to Home Assistant -> Configuration -> Integrations -> Add an integration -> Search for ESPHome -> For "Host" use the name you have the device, click submit