4 toggle button

I have fan with 3 speeds control using 2 relays.

Both relays OFF is fan OFF
1st relay ON is speed 1
2nd relay ON is speed 2
1st and 2nd relays ON is speed 3

Help me with configuration.
I want in dashboard 4 toggle button like on picture.

Make 4 scripts that turn the relays on/off. Then make input_buttons that point the scripts.

Thank you works it.
I would still need to change the color of the icon depending on what speed was selected.