[Beginner] Trying to learn Python in Home Assistant

I’m trying to learn how to use Python in home assistant, eventually I want to add notifications for which type of bin I need to put out for collection based on the calendar on my councils website.

So I started with the documentation to write my first python script:

But I’m struggling with this part:

strong text

Is the YAML a completely new YAML file which I need to create? Or is this added to configuration.yaml?

If someone could explain this to me I’d be very grateful, as I can’t seem to find any answers by searching the forum.

It’s added somewhere you can call the python_script.turn_on service. Like in a script or automation actions.

So I could add the service to my automations.yaml ?

You could add it to the actions of an automation in your automations.yaml file, yes.

Other places:

Lovelace button tap action, Template Cover, or Switch open/close actions, etc…

OK, I think I understand. I’ll try experimenting with it and see if I can get it to work.

Thanks for your help.