State pattern


i write a custom binding to display data from a fronius solar system.
I can define a pattern for the state for example:

<channel-type id="pac">
    <label>AC powery</label>
    <description>AC power</description>
    <state pattern="%d W" readOnly="true"></state>

In this solution the unit (W) is fix, but the solar system return a unit for each value.
Can i change the pattern at runtime?

Thanks & Greetings