AalianKhan / mushroom-strategy

A strategy to automatically generate a dashboard using mushroom cards
MIT License
371 stars 37 forks source link

How to use custom entities of configuration.yaml? #67

Closed superabbite1 closed 11 months ago

superabbite1 commented 11 months ago

The custom entities in configuration.yaml do not have area information. How can these entities be used?

DigiLive commented 11 months ago

Entities need a unique_id to be listed in HA entity-register and to assign them to an area.

Did you read the Adding devices to areas section in the readme?

Maybe it's a solution for your situation!?

AalianKhan commented 11 months ago

Unfortunately, some entities created via the configuration.yaml file are not able to have a unique_id. You can use the extra_cards option for areas to add a card on the top of the view.

For example

strategy:
  type: custom:mushroom-strategy
  options:
    areas:
      family_room_id:
        name: Family Room
        icon: mdi:television
        icon_color: green
        order: 1
        extra_cards:
          - type: custom:mushroom-entity-card
            entity: cover.curtain
superabbite1 commented 11 months ago

For example, I have customized the following code entities in configuration.yaml. How should I configure the area so that mushroom can recognize it?

cover:
  - platform: template
    covers:
      custom_cover:
        device_class: gate
        friendly_name: "curtain test"
        position_template: "{{ states('input_number.cover_position') }}"
        open_cover:
          service: select.select_option
          data:
            entity_id: select.remote_ir_1706309535964229632
            option: open
        close_cover:
          service: select.select_option
          data:
            entity_id: select.remote_ir_1706309535964229632
            option: close
        stop_cover:
          service: select.select_option
          data:
            entity_id: select.remote_ir_1706309535964229632
            option: stop
AalianKhan commented 11 months ago

You would enter a random unqiue_id

cover:
  - platform: template
    covers:
      custom_cover:
        device_class: gate
        friendly_name: "curtain test"
        unique_id: Q1NUj4D3mPVI822TKQXlrcgL
        ...
superabbite1 commented 11 months ago

thanks