https://www.malachisoord.com/2019/12/05/esphome-based-pir-mo...
Tasmota I use just like said for switches and for that it works very well too.