You have to start with any ESPHome “empty” firmware (generated by the wizard) or preflashed firmware for ESP8266 using https://web.esphome.io/
and adopted to ESPHome dashboard (IDE)
The solution is fully documented in its repository.
Wemos D1 Mini itself is definitely not enough, you also need CC1101 in a version made for 868MHz
Other resources (in Polish):