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

Room/Areas views: option to group by devices #45

Open
floco opened this issue Sep 9, 2023 · 9 comments
Open

Room/Areas views: option to group by devices #45

floco opened this issue Sep 9, 2023 · 9 comments
Assignees
Labels
enhancement New feature or request

Comments

@floco
Copy link

floco commented Sep 9, 2023

Is your feature request related to a problem? Please describe.
I have many devices that are composed of multiple types/classes of entities. Example a cat feeder, locks, plugs with power measurement that are composed of binary sensors, sensors, switches, lights. So the grouping by entity class/domain does not work really well in my case. My rooms/areas are way too cluttered. So when looking for an info I end up going searching for the device where entities are neatly grouped under it.

Describe the solution you'd like
It would be great to have an option for the generation of the views under each areas/rooms to group by device then by class/domain.
I feel this would be a good compromise for the automatic dashboard of each rooms.

Describe alternatives you've considered
An alternative would be to create an area for each devices I use the most, but that will clutter the front page.
Or go back to creating my own dashboard.

Additional context
Example of native home assistant device view showing multiple entities based devices
image

@floco floco added the enhancement New feature or request label Sep 9, 2023
@AalianKhan
Copy link
Owner

Generating the views in a different format will need a lot of work in the backend.
I am thinking of adding an option to create a "device card" for certain devices you choose. The device card will just show all the linked entities in a popup. What do you think?

@AalianKhan AalianKhan added the Needs Feedback Something needs clarification or a response is expected label Sep 14, 2023
@floco
Copy link
Author

floco commented Sep 15, 2023

Thanks @AalianKhan for considering this feature. 😀
yes I was thinking having an additional parameter at areas level, where we could specify different "sub-strategies" type to generate the areas view. Like in this case "by_device" instead of default "by_entity"

strategy:
  type: custom:mushroom-strategy
  options:
    areas:
      family_room_id:
        name: Family Room
        type: by_device

But I understand this means adding a complete new way to generate views...

Having an option for a device card might also work: like being able to display the main entity of the device in the view and displaying all other entities of the device in a popup.
But in that case, the view would still have to know somehow that the entities of this device are already handled and not display them in the view. Or hide them all using the hide filter feature that is being developed here: #48 and then use templates to retrieve them in the "device popup view" like so:

type: custom:auto-entities
card:
  type: grid
  columns: 2
  square: false
card_param: cards
filter:
  template: |-
    {% for x in device_entities("da693b86a8bb0765172816a57a05a6f0") -%}
      {{
        {
          'type': 'custom:mushroom-entity-card',
          'entity': x,
          'name': state_attr(x, 'friendly_name')|replace('FRESHELEMENT3 ', '')

        }
      }},
    {%- endfor %}

image

@AalianKhan AalianKhan removed the Needs Feedback Something needs clarification or a response is expected label Sep 19, 2023
@bzzzggz
Copy link

bzzzggz commented Sep 26, 2023

I agree that grouping sensors by device will make the dashboard much easier to read. Recently configured dryer and washer. This is my Laundry room view. It's very confusing and hard to follow what's going on.
image

@AalianKhan
Copy link
Owner

AalianKhan commented Sep 26, 2023

Would you guys prefer a card? that when clicked gives you a popup (will require another custom integration, browser-mod)
Or just creating a title with all entities associated with that device are displayed under it?

@AalianKhan AalianKhan self-assigned this Sep 26, 2023
@floco
Copy link
Author

floco commented Sep 26, 2023

Thanks again for considering this :-)
Both options make sense and would allow a much better auto organisation of multi-entities devices.

The first option (device card with detail popup) would allow to really declutter the dashboard. But on the other hand the "device" card should ideally still show the main information or action, or you would have to click to see it. And then the dashboard creator would have to define/customise which main info/action to display in the "device" card (unless there is a way to guess it) and then means it's no longer auto-generated and/or everything is two clicks away.

So I think the second option (device name as the title and then list the device's entities under it, sorted by domain/class) would work great for me.

What do you think @bzzzggz ?

@bzzzggz
Copy link

bzzzggz commented Sep 26, 2023 via email

@bzzzggz
Copy link

bzzzggz commented Sep 26, 2023

Screenshot_20230927_075258_SmartThings
Something similar like this?

@floco
Copy link
Author

floco commented Sep 27, 2023

I agree, first option would look the best, I can see the appeal of that.

But technically I have no idea how the strategy can guess the main "entities" to make available directly on the card...

Like you said there are so many different devices. Imagine a powerstrip with multiple plugs or a cat feeder when you want to distribute food manually but also see how much food was distributed today. Depends on each use case ...
In the example below, what matters to me is to action the plug and to see the current and all rest can be in popup card.
Screenshot 2023-09-27 at 06 49 18
Could it attempt to guess somehow but still leave the choice to the user to change it if needed ?

For the popup view, we could use what HA does in the device view, where it classifies entities in 4 categories: controls, sensors, configuration, diagnostic, and put the main things on top (like in above screenshot). Usually that classification makes the most sense. But I don't know if that info is accessible through templates ?

@floco
Copy link
Author

floco commented Sep 28, 2023

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

3 participants