This code enables a tesla Wallconnector to only use the power generated by your photovoltaik setup. It communicates with Solaredge Inverters over Modbus. The esp8266 then sends the collected data to the wallconnector over its RS-485 port. Therefor you need a adapter like this:https://www.ebay.de/itm/TTL-RS485-Adapter-485-UART-Seriell-3-3V-5-Volt-Level-Konverter-Modul-Arduino/252852473229?ssPageName=STRK%3AMEBIDX%3AIT&_trksid=p2057872.m2749.l2649
The esp8266 also hosts a webserver which displays everything. Once you´ve uploaded the sketch, the esp opens an acess point. At 192.168.4.1, there you can enter your wifi credentials and the ip Adress and port of your solaredge inverter. I know the code isnt perfect, but I hope it helps someone. I don´t currently have time to write a full explanation,but if you have any questions or ideas just let me know. Special thanks to @dracoventions, https://github.com/dracoventions/TWCManager for his detailted documentation on the wallconnectors´s protocoll.