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

Picture-elements card no longer documents the ability to control colours of icon based on state #26071

Open
KennethLavrsen opened this issue Feb 2, 2023 · 20 comments

Comments

@KennethLavrsen
Copy link
Contributor

KennethLavrsen commented Feb 2, 2023

Feedback

The Picture-Elements card has as its main selling element that you can create a very powerful graphical display of your house and include entities for both control or visual status.

When you use a backgroud picture and icons - the standard colours from the theme are not always optimal.
And the power of the picture-elements card is that you can choose alternative icons or alternative graphics for an entity.

For example you can have a sofa with a sensor and you change the colour of the sofa shows as an icon based on the state. You are likely to not want to use the same on and off colours as used in the genetic theme.

The 2023.2.0 introduced much more control of theme colours for each type of entity. I can change the on and off colours of all binary sensors in my theme. But the point with the picture-elements card is that I can show a few single binary sensors entities with state colours that are different from all the other binary-sensors incl those used other places in the same picture-elements card.

The picture-elements card provides that you can set the style for every element.

The documentation used to describe exactly how to define the on and off colours. It was broken in 2022.12. And even more broken in 2023.2. But the ability is still there. Just not documented. And it has become much more difficult because now you have to really know what is going on with CSS and theme styles to control the colours. I would not be able to update the docs. I would make a PR if I understood how it works now.

Removing the documentation is really just to show that none seem to care for the picture-elements card any longer.

The picture-elements card should have this documented. I have managed to get a few items working and it is a bit of a cut and try without documentation. Using the theme style names seems to be much more picky with how you do it.

Before December you only needed to know two style names (paper names) and that would override whatever colour defined in the themes. And that is how it is supposed to be. If I want the bed to be blue when vacant and red when occupied while all other binary_sensors are grey/yellow then I should be able to.

When you see people brag about their cool Home Assistant dash boards, it is always a picture-elements card where you see a house groundplane or a 3D perspective drawing with cool things displayed with state colours. This is a flag ship Lovelace card. I do not understand why it is not getting any love anymore.

URL

https://www.home-assistant.io/dashboards/picture-elements/

Version

2023.2.0

Additional information

No response

@github-actions
Copy link

github-actions bot commented Apr 3, 2023

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved.
If this issue is still relevant, please let us know by leaving a comment 👍
This issue has now has been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the Stale The PR had no activity for quite some time, and is marked as Stale label Apr 3, 2023
@KennethLavrsen
Copy link
Contributor Author

Still the case and with the css changes it us hard to do without a good reference to the css names and syntax

@github-actions github-actions bot removed the Stale The PR had no activity for quite some time, and is marked as Stale label Apr 3, 2023
@alex1255
Copy link

I still have the problem too! It is also very difficult for me to determine the colors. Always have to find out the style elements very laboriously with the Chrome developer tools.... Unfortunate

@github-actions
Copy link

github-actions bot commented Jun 9, 2023

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved.
If this issue is still relevant, please let us know by leaving a comment 👍
This issue has now has been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the Stale The PR had no activity for quite some time, and is marked as Stale label Jun 9, 2023
@KennethLavrsen
Copy link
Contributor Author

Ping

@ildar170975
Copy link
Contributor

ildar170975 commented Jun 9, 2023

@KennethLavrsen
Before:
--paper-input-item-active-color (if spelled correctly) was used by "binary" domains and sun.sun.
So Docs could mention this var as a "universal" method.

Now:
Each domain may have its own variable.
So Docs should cover ALL possible domains - or not to mention ANY variable - or simply have this link to required info.

Anyone may propose a PR to edit docs, including you.

@github-actions github-actions bot removed the Stale The PR had no activity for quite some time, and is marked as Stale label Jun 9, 2023
@KennethLavrsen
Copy link
Contributor Author

Yes. I know how it is and it has become awful. My hope was that the front end devs would implement a bit extra ciode, either as yaml for the card or an additional layer of CSS to be used in situations like the picture elements card where you want to change a single entity and not an entire domain. You could never use such css in a theme as it would alter everything but it could work for control of individual entities. Documenting the current situation for picture-elements would be a couple of screens of detailed CSS soup that only few will understand. I am personally very weak on the subject of CSS and I simple follow recipes by helpful community members in the forum

@ildar170975
Copy link
Contributor

ildar170975 commented Jun 9, 2023

like the picture elements card where you want to change a single entity and not an entire domain

It may be easily done like this:

type: picture-elements
elements:
  - type: state-icon
    entity: input_boolean.test_boolean
    style:
      top: 10%
      left: 30%
      '--state-input_boolean-on-color': red
      '--state-input_boolean-off-color': cyan
  - type: state-icon
    entity: input_boolean.test_boolean
    style:
      top: 10%
      left: 70%
      '--state-input_boolean-on-color': magenta
      '--state-input_boolean-off-color': brown
  - type: state-label
    entity: input_boolean.test_boolean
    style:
      top: 20%
      left: 50%
image: /local/images/test/white.jpg

image

image

Probably the best way is NOT to mention any particular CSS vars in Picture elements docs at all... It is specified that style section may contain CSS properties, this is enough. Particular methods to style particular things should be added as examples, but they cannot cover all cases (here - all domains, all states).

@KennethLavrsen
Copy link
Contributor Author

Yes, BUT

that only works for input_booleans. If it is a binary sensor the css would be e.g '--state-binary_sensor-inactive-color': green

There are many binary types and each have their css which you have to know. That makes sense for themes. But it makes it hard for a simple non dev user that just want some alternative on off colors for a few entities.

before the same paper css worked for any bool/binary/switch. Now you need a two page manual to explain which css to use when. Surely you and I know now. But I think about the noob users

@ildar170975
Copy link
Contributor

that only works for input_booleans

Similar for other domains:
image

There are many binary types and each have their css which you have to know.

They are all described here.

But I think about the noob users

Agree, but I at some moment of time I stopped thinking about noob users since HA became more and more "noob-oriented" (with loss of usability for experienced users), for instance:

  • use names instead of unique entity_ids (more than 1 year was needed to restore displaying entity_id in "Dev tools -> Set state");
  • use nice but sometimes useless more-info for switches, booleans & lights.

As for the current issue - well, I have nothing against "enriching" Docs...

@github-actions
Copy link

github-actions bot commented Aug 8, 2023

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved.
If this issue is still relevant, please let us know by leaving a comment 👍
This issue has now has been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the Stale The PR had no activity for quite some time, and is marked as Stale label Aug 8, 2023
@KennethLavrsen
Copy link
Contributor Author

Still relevant

@github-actions github-actions bot removed the Stale The PR had no activity for quite some time, and is marked as Stale label Aug 9, 2023
@github-actions
Copy link

github-actions bot commented Oct 9, 2023

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved.
If this issue is still relevant, please let us know by leaving a comment 👍
This issue has now has been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the Stale The PR had no activity for quite some time, and is marked as Stale label Oct 9, 2023
@KennethLavrsen
Copy link
Contributor Author

Ping bot

@github-actions github-actions bot removed the Stale The PR had no activity for quite some time, and is marked as Stale label Oct 9, 2023
Copy link

github-actions bot commented Dec 9, 2023

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved.
If this issue is still relevant, please let us know by leaving a comment 👍
This issue has now has been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the Stale The PR had no activity for quite some time, and is marked as Stale label Dec 9, 2023
@KennethLavrsen
Copy link
Contributor Author

Ping

@github-actions github-actions bot removed the Stale The PR had no activity for quite some time, and is marked as Stale label Dec 9, 2023
Copy link

github-actions bot commented Feb 7, 2024

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved.
If this issue is still relevant, please let us know by leaving a comment 👍
This issue has now has been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the Stale The PR had no activity for quite some time, and is marked as Stale label Feb 7, 2024
@KennethLavrsen
Copy link
Contributor Author

Ping

@github-actions github-actions bot removed the Stale The PR had no activity for quite some time, and is marked as Stale label Feb 7, 2024
@ildar170975
Copy link
Contributor

@MankiniChykan your post is unrelated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants