ok i’ guess i’ll go over at step 6 to rules, variables and devices. this is a very large topic.
@demlak please open a new threat at the Rules and Scripts Forum to get help on that since it’s a very specific question and the howto’s are more common.
Meanwhile have a a look at the buttons device or a dummy switch.
this threat here contains some helpful information https://github.com/pimatic/pimatic/issues/293