I have now successfully flashed 9 Sonoffs (Basic / S20) using Theo Arends' Tasmota firmware see https://github.com/arendst/Sonoff-Tasmota/wiki), which has Domoticz support built in. Once you have set up a dummy switch in Domoticz, all you need to do is select Configuration > Configure Domoticz from the Tasmota main menu, and enter the Domoticz Idx, et voila!

indeed the Tasmota firmware works better on the Sonoff. But with only the IDX of a virtual switch will it not work for me. Do you use MQTT? (Domoticz needs to know in some way the IP adress of the Sonoff switch i think.) And how have you setup the MQTT part?

You need to amend user_config.h in the Tasmota sonoff folder, to use your WiFi SSID and password (look for #define STA_SSID1 and #define STA_PASS1 in the WiFi section) and also your MQTT details (#define MQTT_HOST and #define MQTT_PASS in the MQTT section). However, you only need to do this once - you can then flash any subsequent Sonoffs without further changes.

Further down, under MQTT - Domoticz, the standard Domoticz MQTT topics: domoticz/in, domoticz/out are defined - Tasmota is sending / receiving commands via MQTT (i.e., publishing / subscribing to MQTT topics), and so doesn't need to know Domoticz's ip address. (The wiki suggests that you can configure these topics via the web interface, but I can't find this in my version.)

You also need to ensure that you have set up hardware type 'MQTT Client Gateway with LAN interface' on the Domoticz Hardware page.