If-then clause within action in automation

Hi guys

I’m trying to set up an automation where the outcome is notifying different devices when checking specific states. I’m thinking of the typical if-then clause inside action:

If (device-tracker phone A = home) then notify.phoneA
else if (device-tracker phone B = home) then notify.phoneB
else if (device-tracker phone A != home and device-tracker phone B != home) then notify both

Is this if-then clause even possible within an action?

Thanks!

Check out service templates. Looks like those might be of help to you.

templating is what you’re after.

I’d probably start with three separate automations and condition blocks.