Between my house and the main gate are trees, so I can't tell if I forgot to close the gate. That's why I want a contact sensor at the gate and a led strip in the house, so I can tell if it's closed or when it opens.
I imagine that Z-Wave won't work at such a distance.
Maybe one of you guys had already a smiliar problem and can point me in the right direction
There are a couple threads here if you search, but a popular one points back to this solution on the ST forums for a mailbox (but something similar should still work for a gate):
The range you want is quite likely not going to be reachable by practical Z-Wave performance unless you can get a repeater in the middle (and even then...), and it would be a similar stretch for Zigbee (although here an Xbee Pro might be able to help on the transmitting end, but you still have to consider whether the end device could reach back).
So, the general idea for all the things I've read is to forget about either of those, then use a "dumb" solution with some proprietary indoor "receiver," then modify that to connect to the contacts of something that is smart/Hubitat-compatible, like the famed Ecolink Z-Wave Plus contact sensors that have terminals for connecting to external sources (probably what I'd use nowadays--the post on ST is a bit old).
I was going to recommend an Ecolink Z-Wave Plus connected to wired contact sensors. You should be able to bury a wire and run it most of the way back to the house. The reed switch contact sensors are cheap, and the wire you'd need for this should be pretty cheap, too. Two-conductor solid 22 AWG would probably work. You shouldn' t need to bury it very deep, since it's low-voltage. I wouldn't trench, I'd use a flat shovel to open a ~6 in deep slice and lay the wire in there, then press the dirt/grass back together over top.
Something like hacking that long-range mailbox sensor looks worthwhile, though!