lovelace-multiple-entity-row icon indicating copy to clipboard operation
lovelace-multiple-entity-row copied to clipboard

Some way to use jinja or template operations?

Open daytonturner opened this issue 2 years ago • 1 comments

From what I gather, there's no way to use jinja or other template operations within this card, but hopefully someone has an idea of how I could accomplish this?

I have a card like:

entity: sensor.bc_ferries_langdale_to_horseshoe_bay_schedule_1
type: custom:multiple-entity-row
name: Next Ferry
show_state: false
icon: mdi:ferry
entities:
  - attribute: time
    name: Time
  - attribute: carFill
    name: Full
    unit: '%'

It displays two attributes from my sensor, "time" and "carFill" which is great.

I've got another sensor, a google maps transit time, that I've built a jinja template around, to take the "time" attribute from this sensor, and subtract travel time from it, leaving me with a "Time to leave", basically.

Problem is, I cant figure out a way to include jinja to do the timestamp offset calculations in the entities list.

Can anyone think of a way i might do this?

daytonturner avatar May 18 '22 22:05 daytonturner

2 options:

  1. Use a template sensor to acquire your data and then place this sensor into the row.
  2. Place the whole row into a custom:config-template-card and use templates.

ildar170975 avatar May 19 '22 09:05 ildar170975