Great work! Thank you for the in-depth tutorial! Also: Nice avatar
It seems like you are going to have A LOT of duplicated code within your rules. @rlkoshak has posted a design pattern how to tackle this using groups, so you only need that code once + a detection where you find out which of your PIRs actually triggered that rule
Be sure to have a look at the other design patterns.