Yaml Scripting vs Python Scripting capabilites

I realize that Python scripting in HA is quite limited being in sandbox.

Is there anything in Yaml scripting (with templates) that cannot be accomplished in HA-Python? And vice-versa?

Looking at my own Yaml scripts (first-time Yaml-er and Jinja2-er here) I feel that some of it would be a lot simpler in Python, especially when service templates, condition templates, and data templates are involved.

I did seem to find a case for Python which I couldn’t do easily in Yaml. I had a variable list of phone numbers in an input_text string, and I could not find a way in Yaml to call SMS notify (notify.twilio_sms) service for each of them after splitting them up in a template expression.

If you feel comfortable with Python, I’d recommend to try AppDaemon. No limitations, you can set up nearly any Python library and do whatever you need. I personally prefer Python over Yaml for its simplicity and brevity. Yaml is good for simple if-then automations, once you need something non-trivial, you’ll find yourself writing Python-like code inside Jinja templates. Another issue for me is reusability of Yaml automations, AFAIK you have to copy/paste snippets to change some input data. To see what I’m talking about, look how second person support was added to this Yaml routine: https://philhawthorne.com/making-home-assistants-presence-detection-not-so-binary/

But Yaml is a standard in HA world and most of the knowledge/support you can count on, will be in Yaml.