šŸ”¹ Auto-entities - Automatically fill cards with entities

Yessss, it works !.. Thank a lot, i was struggeling for long time now :Dā€¦ And indeed some items have a - but that is just fineā€¦

Thanks again

Has anyone figured out how to filter by the new entity categories in Auto-entities? Does it need an enhancement to support that?

Hey =)
i have two booleans.
and the second should only be shown when the first is activated ā€¦

input_boolean.weekend
input_boolean.task_1

also:
if input_boolean.weekend is active then show me input_boolean.task_1. // if not, then not

that has to go somehow via a template value ā€¦ but that just doesnā€™t want to.
maybe I think wrong too?

card:
  type: entities
  entities:
    - entity: input_boolean.task_01
filter:
  include:
    - entity_id: input_boolean.weekend
      state: '{{ is_state(''input_boolean.weekend', ''on'') }}'

Why not using a stock Conditional row inside Entities card?

can you tell me how ? =)

type: entities
entities:
  - input_boolean.test_boolean
  - type: conditional
    conditions:
      - entity: input_boolean.test_boolean
        state: 'on'
    row:
      entity: input_boolean.test_boolean_2
1 Like

madness ā€¦ thatā€™s not more?
Thanks alot!

can we somehow manage that the card is only shown when ā€œinput_boolean.test_booleanā€ is activated?
now it is so that you can still switch here, and as soon as it is active, the boolean ā€œtest_boolean_2ā€ is shown.

This is far beyond auto-entities main topic here, it should not be discussed here.

type: conditional
conditions:
  - entity: input_boolean.test_boolean
    state: 'on'
card:
  type: entities
  entities:
    - input_boolean.test_boolean
    - type: conditional
      conditions:
        - entity: input_boolean.test_boolean
          state: 'on'
      row:
        entity: input_boolean.test_boolean_2

Also you may use state-switch custom card.

1 Like

Hi everyone,
I opened an issue/feature request on Github but I am not sure if this will be implemented or implementable.

So I was wondering if anybody had any idea if somehow I could use auto-entities to create variables which I could then feed into my target card?

This is what it looks like, but I am having to use input_select for the entity drop-down, something that auto-entities would be ideal for .
image

type: entities
entities:
 - entity: input_select.days_back_to_show
   name: Number Of Days To Show
 - entity: input_select.sensors_to_show
   name: Select Sensor
type: custom:config-template-card
entities:
  - input_select.days_back_to_show
  - input_select.sensors_to_show
variables:
  sensor: states['input_select.sensors_to_show'].state
  span: states['input_select.days_back_to_show'].state+'d'
  days: |
    -states['input_select.days_back_to_show'].state+'d'+'1d'
card:
  type: custom:apexcharts-card
  graph_span: ${span}
  span:
    start: day
    offset: ${days}
  series:
    - entity: ${sensor}
      stroke_width: 2
      group_by:
        func: raw

Anybody have an idea?

Not clear how auto-entities may replace input_select.
Auto-entities card creates a list of objects which can be passed into another card.

The problem is that auto-entities does not work for both entity: and entities:.

So in this code,

type: entities
entities:
  - entity: input_select.sensors_to_show
    name: Select Sensor

auto-entities cannot populate the entities: section. If the entities card used entitiy: and then a list, it should work. But that is not the case. So I think it is an issue of which part of a card code auto-entities looks at and replaces with its entity list.

auto-entities ignores entities:

Input_select is simply a list of entities, as created by auto-entities. So it should work if auto-entities populated the entities:section.

The input_select.set_options service accepts a list which cannot be populated by auto-entities.

It can usually. This is what it was created for.

Wrong , it is a list of strings.

Hmmm, you are right. It is a list of entity strings.

Is there a way of converting this list?

type: custom:auto-entities
show_empty: false
card:
  type: custom:config-template-card
  entities:
filter:
  include:
    - domain: sensor

The referenced card: Config-Template-Card

Are you sure that filling input_select options should be performed inside a card?
Probably you should fill it outside by some script, and you can use templates for it as a part of script syntax.
Once again - you are trying to mix unmixable things: auto-entities cannot be used for populating input_select.

Hi!
Can I know how you did to associate a realistic icon specific to each device?
Thank you for your help :slight_smile:

Well I used the NMAP integration, which created a ā€œknown_devices.yamlā€ file. And in there I put

picture: /local/path to image/image.png

Did this for all the discovered devices. But the NMAP integration changed some time ago. So iā€™m not using this anymore. Still looking for a new way to track all devices on my network.

Hope this helps a little.
If youā€™re trying and it wont work, let me know. Iā€™ll try to see if I can help.

1 Like

Try customizing entity_picture inside customize section for these device_tracker entities.

Hello all, hello @Ildar_Gabdullin ,

I was wondering if auto-entities could also work with Apexcharts without creating one chart with multiple but rather one chart per entity.

Code for multiple charts without auto-entities
type: vertical-stack
cards:
  - type: custom:apexcharts-card
    layout: minimal
    graph_span: 48h
    experimental:
      color_threshold: true
    update_interval: 10 s
    yaxis:
      - show: false
        max: 21
        min: 0
    header:
      title: Living Room Temperature
      show: true
      show_states: true
      colorize_states: true
    apex_config:
      legend:
        show: false
      datalabels:
        enabled: true
      grid:
        show: false
      chart:
        height: 100px
    series:
      - entity: sensor.eq_3_temperature_living_room
        stroke_width: 2
        group_by:
          func: last
        fill_raw: zero
        color_threshold:
          - value: 4.5
            color: blue
          - value: 20
            color: red
        type: line
        opacity: 1
        curve: smooth
      - entity: sensor.eq_3_temperature_living_room
        stroke_width: 0
        group_by:
          func: last
        fill_raw: zero
        type: area
        color_threshold:
          - value: 4.5
            color: blue
          - value: 20
            color: red
        opacity: 0.1
        curve: smooth
  - type: custom:apexcharts-card
    layout: minimal
    graph_span: 48h
    experimental:
      color_threshold: true
    update_interval: 10 s
    yaxis:
      - show: false
        max: 21
        min: 0
    header:
      title: Dining Room Temperature
      show: true
      show_states: true
      colorize_states: true
    apex_config:
      legend:
        show: false
      datalabels:
        enabled: true
      grid:
        show: false
      chart:
        height: 100px
    series:
      - entity: sensor.eq_3_temperature_dining_room
        stroke_width: 2
        group_by:
          func: last
        fill_raw: zero
        color_threshold:
          - value: 4.5
            color: blue
          - value: 20
            color: red
        type: line
        opacity: 1
        curve: smooth
      - entity: sensor.eq_3_temperature_dining_room
        stroke_width: 0
        group_by:
          func: last
        fill_raw: zero
        type: area
        color_threshold:
          - value: 4.5
            color: blue
          - value: 20
            color: red
        opacity: 0.1
        curve: smooth
  - type: custom:apexcharts-card
    layout: minimal
    graph_span: 48h
    experimental:
      color_threshold: true
    update_interval: 10 s
    yaxis:
      - show: false
        max: 21
        min: 0
    header:
      title: Master Bedroom Temperature
      show: true
      show_states: true
      colorize_states: true
    apex_config:
      legend:
        show: false
      datalabels:
        enabled: true
      grid:
        show: false
      chart:
        height: 100px
    series:
      - entity: sensor.eq_3_temperature_master_bedroom
        stroke_width: 2
        group_by:
          func: last
        fill_raw: zero
        color_threshold:
          - value: 4.5
            color: blue
          - value: 20
            color: red
        type: line
        opacity: 1
        curve: smooth
      - entity: sensor.eq_3_temperature_master_bedroom
        stroke_width: 0
        group_by:
          func: last
        fill_raw: zero
        type: area
        color_threshold:
          - value: 4.5
            color: blue
          - value: 20
            color: red
        opacity: 0.1
        curve: smooth
  - type: custom:apexcharts-card
    layout: minimal
    graph_span: 48h
    experimental:
      color_threshold: true
    update_interval: 10 s
    yaxis:
      - show: false
        max: 21
        min: 0
    header:
      title: Guest Toilet Temperature
      show: true
      show_states: true
      colorize_states: true
    apex_config:
      legend:
        show: false
      datalabels:
        enabled: true
      grid:
        show: false
      chart:
        height: 100px
    series:
      - entity: sensor.eq_3_temperature_guest_toilet
        stroke_width: 2
        group_by:
          func: last
        fill_raw: zero
        color_threshold:
          - value: 4.5
            color: blue
          - value: 20
            color: red
        type: line
        opacity: 1
        curve: smooth
      - entity: sensor.eq_3_temperature_guest_toilet
        stroke_width: 0
        group_by:
          func: last
        fill_raw: zero
        type: area
        color_threshold:
          - value: 4.5
            color: blue
          - value: 20
            color: red
        opacity: 0.1
        curve: smooth
  - type: custom:apexcharts-card
    layout: minimal
    graph_span: 48h
    experimental:
      color_threshold: true
    update_interval: 10 s
    yaxis:
      - show: false
        max: 21
        min: 0
    header:
      title: Office Temperature
      show: true
      show_states: true
      colorize_states: true
    apex_config:
      legend:
        show: false
      datalabels:
        enabled: true
      grid:
        show: false
      chart:
        height: 100px
    series:
      - entity: sensor.eq_3_temperature_office
        stroke_width: 2
        group_by:
          func: last
        fill_raw: zero
        color_threshold:
          - value: 4.5
            color: blue
          - value: 20
            color: red
        type: line
        opacity: 1
        curve: smooth
      - entity: sensor.eq_3_temperature_office
        stroke_width: 0
        group_by:
          func: last
        fill_raw: zero
        type: area
        color_threshold:
          - value: 4.5
            color: blue
          - value: 20
            color: red
        opacity: 0.1
        curve: smooth
  - type: custom:apexcharts-card
    layout: minimal
    graph_span: 48h
    experimental:
      color_threshold: true
    update_interval: 10 s
    yaxis:
      - show: false
        max: 21
        min: 0
    header:
      title: Kitchen Temperature
      show: true
      show_states: true
      colorize_states: true
    apex_config:
      legend:
        show: false
      datalabels:
        enabled: true
      grid:
        show: false
      chart:
        height: 100px
    series:
      - entity: sensor.eq_3_temperature_kitchen
        stroke_width: 2
        group_by:
          func: last
        fill_raw: zero
        color_threshold:
          - value: 4.5
            color: blue
          - value: 20
            color: red
        type: line
        opacity: 1
        curve: smooth
      - entity: sensor.eq_3_temperature_kitchen
        stroke_width: 0
        group_by:
          func: last
        fill_raw: zero
        type: area
        color_threshold:
          - value: 4.5
            color: blue
          - value: 20
            color: red
        opacity: 0.1
        curve: smooth
  - type: custom:apexcharts-card
    layout: minimal
    graph_span: 48h
    experimental:
      color_threshold: true
    update_interval: 10 s
    yaxis:
      - show: false
        max: 21
        min: 0
    header:
      title: Master Bathroom Temperature
      show: true
      show_states: true
      colorize_states: true
    apex_config:
      legend:
        show: false
      datalabels:
        enabled: true
      grid:
        show: false
      chart:
        height: 100px
    series:
      - entity: sensor.eq_3_temperature_master_bathroom
        stroke_width: 2
        group_by:
          func: last
        fill_raw: zero
        color_threshold:
          - value: 4.5
            color: blue
          - value: 20
            color: red
        type: line
        opacity: 1
        curve: smooth
      - entity: sensor.eq_3_temperature_master_bathroom
        stroke_width: 0
        group_by:
          func: last
        fill_raw: zero
        type: area
        color_threshold:
          - value: 4.5
            color: blue
          - value: 20
            color: red
        opacity: 0.1
        curve: smooth
  - type: custom:apexcharts-card
    layout: minimal
    graph_span: 48h
    experimental:
      color_threshold: true
    update_interval: 10 s
    yaxis:
      - show: false
        max: 21
        min: 0
    header:
      title: Walk-in Temperature
      show: true
      show_states: true
      colorize_states: true
    apex_config:
      legend:
        show: false
      datalabels:
        enabled: true
      grid:
        show: false
      chart:
        height: 100px
    series:
      - entity: sensor.eq_3_temperature_walk_in
        stroke_width: 2
        group_by:
          func: last
        fill_raw: zero
        color_threshold:
          - value: 4.5
            color: blue
          - value: 20
            color: red
        type: line
        opacity: 1
        curve: smooth
      - entity: sensor.eq_3_temperature_walk_in
        stroke_width: 0
        group_by:
          func: last
        fill_raw: zero
        type: area
        color_threshold:
          - value: 4.5
            color: blue
          - value: 20
            color: red
        opacity: 0.1
        curve: smooth
Code with auto-entities but each entity is one series

(Please ignore the config-template-card, it matters not)

type: custom:config-template-card
entities:
  - input_select.days_back_to_show
variables:
  span: states['input_select.days_back_to_show'].state+'d'
  days: |
    -states['input_select.days_back_to_show'].state+'d'+'1d'
card:
  type: vertical-stack
  cards:
    - type: custom:auto-entities
      filter:
        include:
          - entity_id: sensor.eq_3_temperature*
            options:
              entity: this.entity_id
              stroke_width: 2
              group_by:
                func: last
              fill_raw: zero
      card:
        type: custom:apexcharts-card
        graph_span: ${span}
        span:
          start: day
          offset: ${days}
        experimental:
          color_threshold: true
        update_interval: 10 s
        now:
          show: false
          color: red
          label: Now
        yaxis:
          - min: 0
        apex_config:
          grid:
            show: false

Adapt this example for your needs:

type: custom:auto-entities
card:
  type: vertical-stack
card_param: cards
filter:
  include:
    - entity_id: "sensor.cleargrass_1_*"
      options:
        type: history-graph
        entities:
          - entity: this.entity_id

Also - do not overload people with unimportant details, give Minimal Working Example.
Then people will help you faster!

P.S. I removed options for sort, show_empty etc to simplify the idea.