anyway, I made a simple test by replacing cover.set_cover_position with persistent_notification.create and it works as expected.
that means there something not quite right with that service call rather than script variables in general.
Ah, calling scrip.turn_on requires variables. Calling the script directly as a service does not.
There are two ways to achieve this. One way is using the generic script.turn_on service. To pass variables to the script with this service, call it with the desired variables
The other way is calling the script as a service directly. In this case, all service data will be made available as variables.
EDIT: Just to clarify, the root cause of your issue is that entity_id and modus were blank because you were using data instead of service_data in your button card.
It would be much better to have data/data_templatewherever we can use service: xxx.
Edited for clarity. service requires data and it has nothing to do with templates. It’s just a question of consistency as I see it. Lack of that creates post like this.
I assume he mean’t that it should be consistent across Home Assistant. E.g. in automations it’s data and in the tap action of lovelace it’s service_data
spot on
I think I understand and appreciate why there is no consistency in HA but for me personally it does not mean that any thought about imperfection of things is heresy.
I also appreciate that people might be absolutely happy with the state of things and won’t try to disturb them in their nirvana as I’m here solely to learn and share my knowledge with those who want it.
I have a similar problem, I would like to make a stripe button-card to start the timers I use in my kitchen, but I don’t want an extra press to restart the timer, because a press should only work if the timer is idle
button-card code