I have a lot of sensors from a modbus system which give a integer as state. This integer is a representation for a string state, e.g.:
operation mode:
{'off': 0,
'manual': 1,
'winter': 2,
'summer': 3,
'summer extra fan': 4}
In the UI I want the sensors to show the string state and also for some of these sensors the state can also be set (by use of modbus.write service and corresponding address).
It would of course be possible to create a template sensor for each of the modbus sensors with a corresponding mapping and using input_selects which are synchronized to the sensors for setting a new state, but this is quite cumbersome.
I would really like to have a possibility to assign a mapping to each sensor (generically), which then would be used in the UI or at least in an attribute.