How to run python script in Home Assistent OS

Hi there,

It seems I have gaps in basics but I tried to run python scrips (in this special case a *.py script from SamsungTV Encrypted to get a token for my Samsung TV). I failed. I added python script (also tried pyscript from HACS) in the configuration.yaml and it was showed in the services but I have no clue how I can run the *.py from my custom_compotents. I’m pleased for a hint how I can execute a script in Home Assistiant OS. And… sorry for the maybe stupid question… I researched a lot but it’s always written “run script” but not the “how”. At least not understandible for me :wink:

Thanks and regards
Artcore

Developer tools/ services would be one way.

If you need to run it regularly, assigning it to the tap action of a Lovelace button would be another.

Hello tom_I,

thank you for your help.

I see how I can run a script from the python_scrips folder in .

Is there any way or a parameter to run a script from the custom_components (or any other) folder?

Reason is I have installed “SamsungTV Encrypted” from HACS in the folder “custom_components”. When I copy the get_token.py in python_scripts and execute it there is no reaction (but an error in the log about an invalid parameters).

I don’t believe of an error in the script so the question if any way to run a script form another folder because of any potential dependencies.

Thank you
artcore

Probably best to ask the integration developer if the instructions don’t cover it.