Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

icon for states #61

Closed
i00 opened this issue Mar 19, 2020 · 7 comments
Closed

icon for states #61

i00 opened this issue Mar 19, 2020 · 7 comments
Labels
enhancement New feature or request

Comments

@i00
Copy link

i00 commented Mar 19, 2020

Hi... If something is boolean ... can you have another icon like:

icon: mdi:...
icon_off: mdi:...

That allows the icon to be changed depending on the entities state?
Thanks

@benct benct added the enhancement New feature or request label Mar 25, 2020
@benct benct closed this as completed in #71 Jun 9, 2020
@i00
Copy link
Author

i00 commented Jun 10, 2020

Sorry ... how does #71 fix this? ... I noticed you stated that you now do intend to make the card implement templating soon tho... so I guess I wait for that.

@benct
Copy link
Owner

benct commented Jun 10, 2020

Uhm... I really have no idea how this got linked to #71... Reopening it.

Edit: seems like the guy who made the PR linked to this issue, which made Git close this when I merged it..

@benct benct reopened this Jun 10, 2020
@drzony
Copy link
Contributor

drzony commented Jun 16, 2020

#71 makes it possible to have icons that represent the state, I have linked the issue since if you set icon to true in the latest version, then it will display the icon based on state (depending on HA support, for example in my case the icon changes based on whether update is available in zigbee2mqtt).
I have linked the issue since it may solve @i00 problem without templating.
Here is an example how to get a changing light icon in a row:

  - entity: light.my_bulb
    name: My Bulb
    secondary_info: last-changed
    show_state: false
    state_color: true
    type: 'custom:multiple-entity-row'
    entities:
      - entity: light.my_bulb
        icon: true
        name: false
        state_color: true
      - entity: binary_sensor.my_bulb_available
        icon: true
        name: false

@i00
Copy link
Author

i00 commented Jun 18, 2020

@drzony ... sorry how does that allow for two different icons depending on state?

@drzony
Copy link
Contributor

drzony commented Jun 18, 2020

@i00 Home Assistant changes icons based on state internally. For example binary sensor looks like that:
image
Battery icons change based on value:
image
I'm not saying that this solves all your needs, but it may help until templating is done.
Unfortunately GitHub's issue linking is a bit weird, so when I wrote "Possibly fixes #61" it assumed that my pull request fixes it and closed this issue on merge.

@emouawad
Copy link

Thanks for all contributors - love this card 😃
+1 for templating

@benct
Copy link
Owner

benct commented Oct 19, 2020

This will be supported with templating (#35) whenever I get around to implementing that.

@benct benct closed this as completed Oct 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants