How to edit a card properties through a service call

Hello everyone,
I’m trying to figure out how to modify the properties of a card, specifically the custom:button-card.
In particular, I would like to understand how, through a button that calls a service, to modify a property, for example “show_name”, in order to change its value from “true” to “false” and vice versa.
I’ve already done it inside the card itself but I’ve never done it externally through a service call or something similar.

Thank You very much in advance for any advice you would give.

Matteo

You cannot call a service at the server side to directly access the frontend. What you can do is manipulate an entity state, and use that entity state in the frontend in a template (assuming the card supports that, which is the case for custom button card).

You could either use an input_text to set the text server side, or set an inut_boolean and use that to determine the text in the button card.

I really apreciate your answer but, I am sorry for that, I don’t understand what I have to do. Neither reading three times and searching in the docs.

So can u help me more please?

UPDATE: ok I think about it again and perhaps I understand what u mean. I will give it a try in the way I understand what you wrote.

Thank you
Matteo