How to change Dashboard names in the title bar via msg.payload

Hi, I have the same problem. Did someone manage it?
I found a half solution. Actually, I have two needs: set like a led inside the title bar and a text, changing respectively color and content via msg.
Now, I'm able to change the led color using CSS custom properties (variables), like:

<style>
:root {
  --main-bg-color: {{ms.color}};
}
.status-bar {
background-color: var(--led_bar_color);
border-radius: 50%;
}
</style>

The problem is that this solution works only for the tab of the template node conteining the CSS. Infact, in order to make it works I have to set the template type property as "widget in group". If I set it as "added to site head section" it doesn't work, as well as if I put the style section in the same template that I use for modifying the title bar, adding a clock, and set as head section.
So, finally with this solution, when I move to other tabs the led disappear.

Regarding the text value, I haven't found any solution jet. I even tryed wit the same approach but the CSS custom properties variables seems not working in this case. Like:

<style>
:root {
 --new-text: {{ms.text}};
}
.pvw-text:after {
  content: var(--new-text);
}
</style>