benct / lovelace-multiple-entity-row

Show multiple entity states and attributes on entity rows in Home Assistant's Lovelace UI
MIT License
798 stars 60 forks source link

Some way to use jinja or template operations? #254

Open daytonturner opened 2 years ago

daytonturner commented 2 years ago

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?

ildar170975 commented 2 years ago

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.