Change assumed state switch flash icon button to custom

Hello community,

Beginner in Home assistant, I try desperately to change my assumed state switch flash button.

here is my (basic) code :

switch:
  - platform: command_line
    switches:
      fenetre_1:
        command_on: echo -ne "\x01\x06\x00\x01\x05\x00\xDB\x5A" > /dev/ttyUSB0
        command_off: echo -ne "\x01\x06\x00\x01\x05\x00\xDB\x5A" > /dev/ttyUSB0
        friendly_name: Cuisine
      fenetre_2:
        command_on: echo -ne "\x01\x06\x00\x01\x05\x00\xDB\x5A" > /dev/ttyUSB0
        command_off: echo -ne "\x01\x06\x00\x01\x05\x00\xDB\x5A" > /dev/ttyUSB0
        friendly_name: Salon

and

homeassistant:
  customize:
    switch.fenetre_1:
      icon: mdi:window-shutter
    switch.fenetre_2:
      icon: mdi:window-shutter

(I will add icon state for entity later…already have this skills :-))

I already have a look about custom-ui but to be clear, i don’t find how to change these icons…
If it is so difficult, I will check for a pre-build addon.

Any suggestion for me ?

Thanks for your help.

Regards
Guillaume

use assumed_state: false to change from the lightning bolts to a normal toggle and use device_class: garage_door to get the icons to change for you without using crazy templating. List of device classes.

switch:
  - platform: command_line
    switches:
      fenetre_1:
        command_on: echo -ne "\x01\x06\x00\x01\x05\x00\xDB\x5A" > /dev/ttyUSB0
        command_off: echo -ne "\x01\x06\x00\x01\x05\x00\xDB\x5A" > /dev/ttyUSB0
        friendly_name: Cuisine
        assumed_state: false
        device_class: garage_door
      fenetre_2:
        command_on: echo -ne "\x01\x06\x00\x01\x05\x00\xDB\x5A" > /dev/ttyUSB0
        command_off: echo -ne "\x01\x06\x00\x01\x05\x00\xDB\x5A" > /dev/ttyUSB0
        friendly_name: Salon
        assumed_state: false
        device_class: garage_door

If the device class isn’t allowed for a command_line switch you could do this in the customise GUI.

Hello Dave,

Thank you for your help.
In fact, with your suggestion, when I push UP button follow to STOP, I can’t puch UP again.
I must push to DOWN button.
With assumed state, I can push again.

Does it mean that just change my flash icon with another is not natively possible ?

Regards
Guillaume

What happens if you just use the device_class and leave out the assumed_state?