BasicUI: number item displayed as a switch - no default after restarting OH

I am using Openhabian 4.1.2 on a RPi4, 8G. I am still using BasicUI.

In my items I have something like:

Number szTorModus "Tormodus" <settings> (gSteuerung)

In my sitemap this is displayed as:

Switch item=szTorModus label="Modus" mappings=[1="Zu", 2="Auto", 4="Auf"]

which then looks like this:
grafik

Although all items are persisted after a restart of OH none of the three buttons is highlighted anymore. Since I need to restart OH every once in while I need to go through all the buttons and click the appropriate ones which reflect the value of the number items. Is there any trick to get the buttons highlighted automatically ?

Thanks - Martin

When persisted, integers are converted to decimals I believe.
It should work better with such definition:

Switch item=szTorModus label="Modus" mappings=[1.0="Zu", 2.0="Auto", 4.0="Auf"]

Thank you for the hint. However, I would need to rewrite a bunch of rules. So I’ll try a rule like this:

rule "set switches correctly"
when
    System started
then
   var int i=0 
    i=(szSzene.state as Number).intValue
    szSzene.sendCommand(i)
    i=(szTorModus.state as Number).intValue 
    szTorModus.sendCommand(i)
    i=(X4000_Favourite.state as Number).intValue
    X4000_Favourite.sendCommand(i)
    i=(A3311_Favourite.state as Number).intValue
    A3311_Favourite.sendCommand(i)
end