I don’t get a stable readout. It is constantly bouncing between on and off. I found that you can activate internal pullup or pulldown resistors with this code.
Sometimes things are easy. Read the manual the right way. The problem is partialy solved. Without the module connected no problems anymore. As soon I connected it the problem is back. When I connect the module to the mains, the out port goes down (0 volt) and the bouncing begines. Experimented with higher values of the delay, condensor over the out to the ground nothing helpes. If I look at scoop the signal is not very decent. It think those modules are simply crap.
After all I found the real problem. On the circuit board was a misprint. The pin next to 5V was marked GND. So I used it as GND. It has to be marked CMD. The sensor signal was floating when I used this pin as GND. Works perfect now. Thanks for your help.