Custom Secondary Info for Entities Card

Not yet…but I’m not at all surprised that you asked!

The ability to format absolute or relative dates in a template would certainly be helpful. @thomasloven, given the potential reusability, is this something you would consider for card-tools?

1 Like

Not sure if anyone else would find this useful, but I used to use the old Custom UI to show the light brightness as percentage (1% - 100%)as secondary info, and nothing when the light was turned off.

And I’ve now done it with this :slight_smile:


Here's the code
sensor:
  - platform: template
    sensors:

      office_light_brightess:
        value_template: >-
          {% if is_state("light.office_light", "on") %}
            {{ "%2d" | format(states.light.office_light.attributes.brightness | int / 2.55 ) }}%
          {% else %}
          {% endif %}

  - entity: light.office_light
    name: "Office Light"
    type: "custom:secondaryinfo-entity-row"
    secondary_info: "[[ sensor.office_light_brightess.state ]]"
3 Likes

I’ll take a look at it

1 Like

Thanks for this new version. Working great now and without the flickering :grinning:.

Hi
I have tried to use this custom card but it does not work.
When i use this below it makes my light.dining_rm disappear from the frontend.
I am using 0.86.4 lovelace mode: yaml and have the card-tools.js aswell.

 resources: 
  - url: /local/lovelace/card-tools.js?v=297fcc
    type: js
  - url: /local/lovelace/secondaryinfo-entity-row.js
    type: module

 badges: []
 icon: 'mdi:sofa'
 path: default_view
 theme: slate
 title: Sitting Room
 cards:
      - type: entities
        show_header_toggle: false
        title: ''
        entities:
          - entity: input_boolean.door_alarm_mode
          - entity: light.dining_rm
            name: 'Ceiling Dining Room'
            type: "custom:secondaryinfo-entity-row"
            secondary_info: "[[ sensor.brightness_dining_rm.state ]]"

If i comment out the type: and secondary_info: my light comes back in the frontend.
Any help please. Thanks in advance.

Edit: Done the normal cache refresh but still not showing.

Edit: I am getting an error.

ERROR (MainThread) [frontend.js.latest.201901211] https://xxxx.xxxx.net/lovelace/default_view:0:0 Uncaught

Just to make sure you didn’t miss it:
resources: goes outside the views:

Yes I have this for my ui-lovelace.yaml

resources:

  - url: /local/lovelace/card-tools.js?v=297fcc
    type: js
  - url: /local/lovelace/layout-card.js?v=a313b7
    type: js
  - url: /local/lovelace/entity-attributes-card.js?v=0.1.1
    type: js
  - url: /local/lovelace/tracker-card.js?v=0.2.0
    type: js
  - url: /local/lovelace/light-slider-element.js?v=0.1
    type: js
  - url: /local/lovelace/compact-custom-header/compact-custom-header.js?v=0.2.9
    type: js
  - url: /local/lovelace/tiles-card.js?v=0.1
    type: js
  - url: /local/lovelace/slider-entity-row.js?v=ba8f50
    type: js
  - url: /local/lovelace/vertical-stack-in-card.js?v=v0.1.0
    type: js

  - url: /local/lovelace/secondaryinfo-entity-row.js?v=0.1.1
    type: module
  - url: /local/lovelace/weather-card.js
    type: module
  - url: /local/lovelace/button-card.js?v=0.0.2
    type: module
  - url: /local/lovelace/mini-media-player-bundle.js?v=0.9.8
    type: module
  - url: /local/lovelace/surveillance-card.js?v=0.0.1
    type: module
  - url: /local/lovelace/mini-graph-card.js?v=0.0.1
    type: module
  - url: /local/lovelace/custom-weather-card-chart.js?v=0.2.4
    type: module
  - url: /local/lovelace/mini-graph-card-bundle.js?v=0.2.0
    type: module



title: Home
views:
  - !include lovelace/main_view.yaml
  - !include lovelace/01_overview_view.yaml
  - !include lovelace/02_tv_view.yaml
  - !include lovelace/03_secruity_view.yaml
  - !include lovelace/04_front_view.yaml
  - !include lovelace/05_back_view.yaml
  - !include lovelace/06_tracker_view.yaml
  - !include lovelace/07_heating_view.yaml
  - !include lovelace/08_temperature_view.yaml
  - !include lovelace/09_garage_view.yaml
  - !include lovelace/10_eliott_view.yaml
  - !include lovelace/11_liam_view.yaml
  - !include lovelace/12_bedroom_view.yaml
  - !include lovelace/bed_tv_view.yaml
  - !include lovelace/13_enviroment_view.yaml
  - !include lovelace/14_equipment_view.yaml
  - !include lovelace/15_automations_view.yaml
  - !include lovelace/16_dockers_view.yaml
  - !include lovelace/17_history_view.yaml
  - !include lovelace/18_media_view.yaml
  - !include lovelace/19_card_tracker_view.yaml
2 Likes

Thank you @MizterB! This custom code allowed me to combine my humidity sensor into my thermostat entry in my lovelace entities card

Before
.before

After
after

cards:
  - type: entities
    title: Home
    id: home_main
    show_header_toggle: false
    entities:
      - lock.august_lock        
      - entity: climate.home
        type: "custom:secondaryinfo-entity-row"
        secondary_info: "Humidity [[ sensor.home_humidity.state ]]%"
1 Like

@MizterB and @thomasloven did you guys by any chance already collaborate on making this work for slider-entity-row? Would love to show the brightness of my lights as secondary info to the slider.

2 Likes

Thanks for this, I just noticed I can use an input select in the secondary info, I use it to show the state and current power consumption of my washer / dryer:

Untitled-1

The input select is changed via automations based on consumption; washing, drying, idle

  - entity: binary_sensor.laundry_in_progress
    name: 'Washer / Dryer'
    icon: 'mdi:washing-machine'
    type: "custom:secondaryinfo-entity-row"
    secondary_info: "[[ input_select.washer_status.state ]] - [[ sensor.popp_123658_plug_in_switch_plus_power_meter_power.state ]] W"

I was finally able to update past V85 and so far I’m really loving the component. My new lovelace is pretty much to the level of detail in my old UI and more. Thanks!

Is there any way that this could be expanded to be used in more cards other than just the entities card?

And is there a way to add it to the custom resource tracker?

@MizterB and @thomasloven Just wanted to bring this to your attention since you might have overlooked my comment.

I would really love to show secondary info beneath the slider row. I mentioned last week that I wanted to show the brightness of my lights, but they’re obviously already shown right next to the slider.

What I really want to show is the last triggered date, but that’s all content. It doesn’t really matter what I show in there as long as it is possible.

1 Like

This shouldn’t require any changes to the custom slider - it already uses a hui-generic-entity-row, which is the wrapper for the secondary info element that I modify.

But on my end, this could be a substantial change, as I’d need to allow my custom entity row to extend other custom entity rows. While common for custom cards, I don’t know of any other components doing this for entities. That would also substantially increase the complexity of configuration.

It’s something I can play with, with but no promises on when/if it can be delivered. But I’ll take any suggestions on how to do it.

@thomasloven - any additional thoughts on adding date formatting to the card-tools template engine?

Oh, right. I forgot about that.
Do you think you could open an issue on github to remind me?

Done. Thank you!

This card is awsome!
I haven’t noticed but you can even use three sensors in one single row:

48

Excellent. Again, thank you all.

1 Like

Hi @Romquenin

Can you show your code for this please?

Is it possible to add custom_updater support? Thank you for the great card.

I just added support for custom_updater (I think). The necessary JSON file is now available in the repository, with config instructions in the README. There have been a lot up updates to custom_updater recently, it would be great if someone could confirm that this works fine as a ‘3rd party’ card. Thanks!