Thanks @gohan it works perfectly using a digital pin and the door sensor example.
Best posts made by ronnyandre
RE: [SOLVED] How to detect power current with Arduino Pro Mini in a doorbell?
RE: Office plant monitoring
@mfalkvidd Thanks for the quick answer! I also read on the page for battery powered sensors that the step up generates alot of noise that can interfere with the radio, and that a solution might be to add capacitators (which I already tried), but also powering the radio directly from batteries. I'll try that later today. Thanks!
And thank you for the link to the troubleshooting. It's now bookmarked!
RE: Need help to figure out how to power 230 V to 5 V Arduino with relay
@gohan Thanks for your help, it sure would have been easier to just buy a Sonoff, but I wouldn't learn as much
Were you thinking of something like this? (Don't mind me using a LED in replacement of a lamp).