I have the following problem:
I want to use one script to be able to reset light entities to 80% brightness, and 2700K. This script shall be triggered by buttons, which shall provide the entity of the light, the script shall reset.
I created that with a script using the “fields” option, to specify the input arguments. The script itself works. When i start it directly in the service area, i can provide entities as arguments - no problem.
However, if i do the same thing as a service call from a button, the system will respond, that it does not get the required arguments.
First i recognized, that the UI automatically removed the quotation marks, and i thought, this might be the problem, but it was not. On a direct call it works with or without quotation marks. I asked the copilot and tried several ways to transform the argument in something better to read, such as using “-> " in front or " {{’ '}}” around, or even to split the entity in domain and id, and to connect them back in the script - nothing worked.
I am fairly sure i am doing a simple mistake somehow, but i just cannot find it.
Would somebody have a fool proof way to use a service call from a button to provide the entity of a light (like light.living_room) to a script like script.reset_light, so that the script will reset the light entity? This should be easy and i cannot believe nothing i tried worked, but i just do not recognize my mistake.
Any suggestion is welcome. Thanks