I have a script that I’m looking to add to a custom button card. The desired outcome is to call the script when the button is pressed.
The script, however, is in the packages folder (not /scripts) because I’m bundling different devices’ actions into one process. If I add it to the yaml, it complains that it can’t find scripts/find_roku_remote.
Is there a way to call a package using action: call-service? If not, do I need to move the script into the scripts folder and use service: script.myscript_1? Also, if I move this script out of the packages directory, will it break handling the script as far as HA is concerned?
There is no service: script.roku_remote_finder you could call. If you explicitly want to call the script script.notify_engine, you have to adjust your button action. Since you have defined input_boolean.living_room_remote_finder as automation trigger, it is sufficient to press it in the frontend. As far as I remember, you have to call service toggle when using custom:button-card.
So it appears I’m not seeing the logic behind the service calls then. I figured call-service would call the referenced script and just run it from top to bottom.
A package is no script. It is a bunch of several platforms that can be grouped together due to their context. Instead of defining all elements individually in different places, you combine them in one file. From there, you are able to use any element in the package by its function.
When I read the headline, I assumed that you had just expressed yourself a little bit clumsily and that you were referring to a script (or something else) from a place other than automations.yaml or scripts.yaml/UI.