Trying to figure out the best way to control my garage doors and represent state.
Doors are opened/closed by a relay toggled from an ESP8266 (Wemos D1 Mini) configured as a Cover using ESPHome. That works great, but because the door is simply toggled open/close regardless of position, I’m using Aqara door/window sensors on the doors to detect when they’re closed or open.
Ideally, I’d like to have a single button that shows an icon representing the current open/close state of the relevant door, with a toggle action that opens/closes the door when tapped.
I am not seeing any cards that seem suited to this task, however.
Is this a case where I could use conditional logic in the YAML to set the icon of a Button card based on the state of the door/window sensor?
I have been able to get pretty close using a Button card, with the entity set to the door/window sensor, and then using a Service call on the Tap action to call the cover.open service on the appropriate door.
The piece I’m missing (hence the question about conditional) is having the icon match the open/close state of the door based on the sensor (yes, I know I can have the state represented as text, but would be nice to have both that and icon).
Still fairly new to Lovelace, so apologies for the newb question.