Hi,
I have several pictures of my heating pump which are shown on my dahsboard related to the device status.
On computer or mobile, the card gets different ratios depending on resolution and window given space.
That leads to the point that the ratio of the card gets different but the picture inside is alwas shown top centered.
Tired couple of YAML configuraitons with Gemini, CGPT or Deepseek but none of their YAML configurations worked.
What I want it to look like is a total centered alignment, do you have any ideas on that?
type: picture
grid_options:
columns: 2
rows: 2
image: /api/image/serve/8be107cb7f8318300cc29961a6537f76/512x512
hold_action:
action: none
visibility:
- condition: state
entity: binary_sensor.thz_5_5_eco_heizkreispumpe
state: "on"
tap_action:
action: none
Configuration on the Dashboard
Dashboard Card YAML
Look and alignment when ratio changes, top centered
Look on my mobile with also another ratio, top centred
Here are some Examples from AI, none of them worked.
type: picture
image:
media_content_id: media-source://image_upload/d39dc0744d2f1316bf9da758c95e6d15
media_content_type: image/png
metadata:
title: not-zusatzheizung _gross.png
thumbnail: /api/image/serve/d39dc0744d2f1316bf9da758c95e6d15/256x256
media_class: image
navigateIds:
- {}
- media_content_type: app
media_content_id: media-source://image_upload
visibility:
- condition: state
entity: binary_sensor.thz_5_5_eco_elektrische_nacherwaermung
state: "on"
grid_options:
columns: 2
rows: 2
card_mod:
style: |
img {
display: block;
margin-left: auto;
margin-right: auto;
}
type: picture-elements
image:
media_content_id: media-source://image_upload/d39dc0744d2f1316bf9da758c95e6d15
media_content_type: image/png
metadata:
title: not-zusatzheizung _gross.png
thumbnail: /api/image/serve/d39dc0744d2f1316bf9da758c95e6d15/256x256
media_class: image
navigateIds:
- {}
- media_content_type: app
media_content_id: media-source://image_upload
elements:
- type: image
entity: binary_sensor.thz_5_5_eco_elektrische_nacherwaermung
image: /api/image/serve/d39dc0744d2f1316bf9da758c95e6d15/original
style:
left: 50%
top: 50%
width: 100%
transform: translate(-50%, -50%)
object-fit: contain
visibility:
- condition: state
entity: binary_sensor.thz_5_5_eco_elektrische_nacherwaermung
state: "on"
grid_options:
columns: 2
rows: 2
type: markdown
content: >
<div style="text-align: center;">
<img src="/api/image/serve/d39dc0744d2f1316bf9da758c95e6d15/original" style="max-width: 100%; height: auto;">
</div>
visibility:
- condition: state
entity: binary_sensor.thz_5_5_eco_elektrische_nacherwaermung
state: "on"
grid_options:
columns: 2
rows: 2








