“I want to display an image that I automatically scrape with Selenium inside a card in Home Assistant. I’ve tried a few approaches but none have worked so far… any ideas?”
This is the only method that worked for me, but the image appears very small
type: custom:button-card
entity: input_text.satelite
show_entity_picture: true
entity_picture: '[[[ return states["input_text.satelite"].state ]]]'
show_name: false
show_state: false
aspect_ratio: 16/9
styles:
card:
- background-size: cover # la imagen ocupa todo el fondo
- background-repeat: no-repeat
- background-position: center
- background-image: url('[[[ return states["input_text.satelite"].state ]]]')
- box-shadow: none
- border-radius: 0px
Try using the Markdown Card.
Use this in the Markdown Card:
}})
In the following example, input_text.test contains /local/test.jpg (a file located in /config/www). The JPG image's size is 2560x1440 pixels. The displayed image size is constrained by the card's dimensions (it is automatically resized to fill the entire card).
1 Like
Work! thanks very much!
1 Like

