Dynamic icon for command_line switches

Hello,
I have a command line switch to open/close my shutters:
volets:

  •  command_on: curl "http://192.168.1.27/core/api/jeeApi.php?apikey=XXXX"*
    
  •  command_off: curl "http://192.168.1.27/core/api/jeeApi.php?apikey=XXXX"*
    
  •  command_state: 'wget -O- "http://192.168.1.27/core/api/jeeApi.php?apikey=XXXX"'*
    
  •  value_template: '{{ value == "1" }}'*
    
  •  friendly_name: Volets*'
    

I want to have an ico of open shutter when it’s on, and closed shutter when off.
Any idea how to do it (i’m new to HA)
thanks !

Use your commands in a template cover:

Set the device class to “shutter”

1 Like

Or the

2 Likes

I did not realise that existed. Much better idea.

thanks both of you :slight_smile:
But i didn’t understand how to set a specific icon for each state of the shutter with the command line cover

You dont have to. This:

device_class: shutter

will do it for you.

1 Like

the device class seems not to be an option for command line cover

You should be able to add it with customize then.

1 Like