ESPHome [Errno 111]

I am adding soil moisture sensors but have hit a wall. I have one sensor setup fine but the 2nd one is confusing me. I am able to install the esphome firmware with basically a blank yaml file. when I add the sensor programing in the yaml esphome errors out with:

Error connecting to (‘10.10.8.125’, 6053): [Errno 111] Connect call failed

I tried coping entire yaml file of the working sensor and just changed the name and api info but still got the same result.

the code I added that seems to cause the issue is line 32 - 136 esphome-april-soil-moisture-sensor/default-template.yaml at 33e6ece25b2eb2f93d5c762e7ac1c769576006c8 · illuzn/esphome-april-soil-moisture-sensor · GitHub

the default template is basically the same code that is on the working sensor.

I see no definition of $device_name in the link you have posted.