Picture Entity Card
The Picture Entity card displays an entity in the form of an image. Instead of images from URL, it can also show the picture of camera
entities.
Background changes according to the entity state.
To add the Picture Entity card to your user interface, click the menu (three dots at the top right of the screen) and then Edit Dashboard. Click the Add Card button in the bottom right corner and select from the card picker.
YAML Configuration
The following YAML options are available when you use YAML mode or just prefer to use YAML in the Code Editor in the UI.
Configuration Variables
Camera entity_id
to use. (not required if entity
is already a camera-entity).
URL of an image. To use a locally hosted image, see Hosting.
Forces the height of the image to be a ratio of the width. Valid formats: Height percentage value (23%
) or ratio expressed with colon or “x” separator (16:9
or 16x9
). For a ratio, the second element can be omitted and will default to “1” (1.78
equals 1.78:1
).
Defines the manner in which the image is stretched/clipped to fit the card area. cover
: The image keeps its aspect ratio and fills the given dimension. The image will be clipped to fit. contain
: The image keeps its aspect ratio, but is resized to fit within the given dimension. fill
: The image is resized to fill the given dimension. If necessary, the image will be stretched or squished to fit.
Override the used theme for this card with any loaded theme. For more information about themes, see the frontend documentation.
Action taken on card tap. See action documentation.
Action taken on card tap and hold. See action documentation.
Action taken on card double tap. See action documentation.
How to use state_filter
Specify different CSS filters
state_filter:
"on": brightness(110%) saturate(1.2)
"off": brightness(50%) hue-rotate(45deg)
Examples
Basic example:
type: picture-entity
entity: light.bed_light
image: /local/bed_light.png
Different images for each state:
type: picture-entity
entity: light.bed_light
state_image:
"on": /local/bed_light_on.png
"off": /local/bed_light_off.png
Displaying a live feed from an FFmpeg camera:
type: picture-entity
entity: camera.backdoor
camera_view: live
tap_action:
action: call-service
service: camera.snapshot
data:
entity_id: camera.backdoor
filename: '/shared/backdoor-{{ now().strftime("%Y-%m-%d-%H%M%S") }}.jpg'
The filename needs to be a path that is writable by Home Assistant in your system. You may need to configure allowlist_external_dirs
(documentation).