Understanding the service_template action

Actually, yeah. I hadn’t thought about it but the sensor.whoishome could trigger the actions. It does provide those 3 states.

Then the simplest (and probably about equal length) solution would be three automations triggered on the three separate states of the sensor. Templates are not always the best solution.

OK, then it helps to reduce the complexity of the action’s templates and to avoid the problems you encountered with using service_template.