Dynamic name for picture_entity card using sensor output

Hello!

I’ve got a picture-entity card that shows the current moon phase, based on the moon integration. What I’d like to do is also add the next moon rise time as a caption on the card, using AstroWeather’s sensor.astroweather_moon_next_rising, probably by changing the name of the card.

The following code has been working just fine for the picture-entity, but I can’t seem to parse how to get the name working. Is this possible and I just have the syntax wrong?

Code:

type: picture-entity
entity: sensor.moon_phase
show_name: true
show_state: false
name: {{ as_timestamp(states('sensor.astroweather_moon_next_rising')) |  timestamp_custom("%I:%M %p") }}
tap_action:
  action: none
hold_action:
  action: none
double_tap_action:
  action: none
state_image:
  first_quarter: /local/images/moon_phases/first_quarter.PNG
  full_moon: /local/images/moon_phases/full_moon.PNG
  last_quarter: /local/images/moon_phases/last_quarter.PNG
  new_moon: /local/images/moon_phases/new_moon.PNG
  waning_crescent: /local/images/moon_phases/waning_crescent.PNG
  waning_gibbous: /local/images/moon_phases/waning_gibbous.PNG
  waxing_crescent: /local/images/moon_phases/waxing_crescent.PNG
  waxing_gibbous: /local/images/moon_phases/waxing_gibbous.PNG

Produces:
Screen Shot 2023-02-02 at 1.19.21 PM

Error message:
Screen Shot 2023-02-02 at 1.23.18 PM

Thank you for any insight you can provide :slight_smile:

You cannot use templates to define an option here.
What you can do - place the card inside custom:config-template-card (CTC) and define a template.
For details - go to CTC docs in GitHub or to the already present long thread for CTC (“share your project”).