Entities Card configuration - where's the YAML?

Just getting going with the Utility meter integration to try and track energy use - cheap and peak rates.

Here’s a screen shot

The paused and collecting lines are attributes of the two sensors.

Freely admit I don’t know what I’m doing but to add these had to go into the code editor in the entities card config and add the attribute info - bit of trial and error but it works.

two questions:
Where is the configuration code saved? It’s not in configuration.yaml Sometimes just quicker to text edit than go via the UI

Is there any way to display the attribute without the name and ideally without the vertical space so something like:

Daily Cheap Energy 0kW
paused

I continue to be amazed at the capabilities of HA but sometimes hard to know what’s possible.

Many thanks for your help

If you edit via the UI then the dashboard is in “storage” mode and is stored as JSON in the .storage folder. It’s not recommended to edit these files directly.

You can create YAML dashboards and store them in the config directory (or a sub-folder), they are edited entirely in text and the UI editors can’t be used.

Multiple Dashboards - Home Assistant (home-assistant.io)

A halfway house is to use a storage dashboard and open it in the raw UI editor (see below)

Helpful - thanks

I found the menu with raw config editor - never seen it before!

Looks like a decent solution

It would be great if there was an option to use any attribute as secondary_info, I think that would do what you’re asking for. Sadly, you can’t without installing custom components.

There are two that spring to mind:
custom-cards/secondaryinfo-entity-row: Custom entity row for HomeAssistant, providing additional types of data to be displayed in the secondary info area of the Lovelace Entities card (github.com)

or

thomasloven/lovelace-template-entity-row: :small_blue_diamond: Display whatever you want in an entities card row. (github.com)

I’d use the 2nd one for two reasons

  1. it can do a lot more, you may want that sometime, so it could help to reduce the number of custom cards you use.
  2. Thomas Loven’s cards are generally stable and fixed when HA updates break them (nothing against the other card / maintainer, I don’t use his card, it/he may be great!).

If you use a markdown card, then you can do a lot.
anything in content inside {{ }} will be interpreted as a value to print out, so
{{ states('sensor.octopus_go_monthly_peak_rate') }} could be one line and {{ state_attr('sensor.octopus_go_faster_peak_rate','status') }} could be another.

Try to write
Monthly Peak Energi {{ states('sensor.octopus_go_monthly_peak_rate') }} Wh to get the same text.

You can also do calculations, like
Monthly Peak Energy {{ states('sensor.octopus_go_monthly_peak_rate')/1000 }} kWh

Or calculations between states, like
Stupid value {{ states('sensor.octopus_go_monthly_peak_rate')*states('sensor.octopus_go_monthly_cheap_rate') }}

And the card can sooooo much more.

Thanks. Learn something new everyday!

Will give it a go.

I’ve had a go with the template entity row card - almost there:

Screenshot 2022-10-30 135125

But the units aren’t shown.

Here’s the relevant YAML

type: entities
        entities:
          - type: custom:template-entity-row
            entity: sensor.octopus_go_faster_cheap_rate
            secondary: '{{states.sensor.octopus_go_faster_cheap_rate.attributes.status}}'
          - type: custom:template-entity-row
            entity: sensor.octopus_go_faster_peak_rate
            secondary: '{{states.sensor.octopus_go_faster_peak_rate.attributes.status}}'
          - entity: sensor.octopus_go_monthly_cheap_rate
          - type: attribute
            entity: sensor.octopus_go_monthly_cheap_rate
            attribute: status

Can’t see anything in the docs about units, any ideas?

thanks

Tackled this a different and better way

type: entities
entities:
  - type: custom:template-entity-row
    name: 'Now: {{states.select.octopus_go_faster.state}}'
  - entity: sensor.octopus_go_faster_cheap_rate
  - entity: sensor.octopus_go_faster_peak_rate
  - entity: sensor.octopus_go_monthly_cheap_rate
  - entity: sensor.octopus_go_monthly_peak_rate
title: 'Octopus Go '

Far better - card shows more easily what is going on and less YAML juggling.