Display state of sensor which has 3 states

Hi All
I am trying to work out how I can display the state of a sensor which has 3 states, they are 1, 2, or 0.
It is my solis solar inverter, “charge to battery status”, where state 1 is charging state 2 is discharging and state 0 is off (not charging or discharging)
I have been able to set up an automation to send a messages via mqtt to tell me when it changes states, but I would like to be able to just display it on one button on the dashboard, ie green red or yellow.
I would be very greatful for some advice thankyou Ken