Support state-based icon overrides (e.g. icon-on, icon-off)

Summary
Currently, binary sensors (like window/door) automatically switch icons based on state (mdi:window-open / mdi:window-closed) (for icon-on and icon-off respectively). But if a user selects any other custom icon (e.g. mdi:window-closed-variant), the icon becomes static and loses state-based switching.

Yes, I know this is possible using templates, conditional cards, etc. But it shouldn’t be needed.

Feature Request
Allow users to optionally define state-based icon overrides directly in the UI or configuration.yaml:

icon-on: mdi:window-open-variant
icon-off: mdi:window-closed-variant

Bonus points for also allowing image urls instead of icons.

This would enable visually consistent setups without needing to create template sensors or complex Lovelace cards.

Why it matters

  • Better UX flexibility
  • Lower complexity
  • Minimal implementation

Thank you

For anyone else who’s been annoyed that using a nicer icon (like the -variant set) breaks state-based icon switching — this is your chance to finally fix it.

This feature would save tons of template and UI hacks for something that should “just work.”

Please upvote if you’ve ever been forced to choose between nice-looking and functional.