Picture Entity Card


Displays the entity in form of an image. Instead of images from URL it can also show the picture of camera entities.

Picture entity card Background changes according to the entity state.

Configuration Variables

type

(string)(Required)

picture-entity

entity

(string)(Required)

An entity_id used for the picture.

camera_image

(string)(Optional)

Camera entity_id to use. (not required if entity is already a camera-entity).

camera_view

(string)(Optional)

“live” will show the live view if stream is enabled.

Default value:

auto

image

(string)(Optional)

URL of an image.

state_image

(map)(Optional)

Map entity states to images (state: image URL, check the example below).

aspect_ratio

(string)(Optional)

Forces the height of the image to be a ratio of the width. You may enter a value such as: 16x9, 16:9, 1.78.

name

(string)(Optional)

Overwrite entity name.

show_name

(boolean)(Optional)

Shows name in footer.

Default value:

true

show_state

(boolean)(Optional)

Shows state in footer.

Default value:

true

tap_action

(map)(Optional)

Action to take on tap

action

(string)(Required)

Action to perform (more-info, toggle, call-service, navigate, none)

Default value:

more-info

navigation_path

(string)(Optional)

Path to navigate to (e.g. /lovelace/0/) when action defined as navigate

Default value:

none

service

(string)(Optional)

Service to call (e.g. media_player.media_play_pause) when action defined as call-service

Default value:

none

service_data

(string)(Optional)

Service data to include (e.g. entity_id: media_player.bedroom) when action defined as call-service

Default value:

none

hold_action

(map)(Optional)

Action to take on tap-and-hold

action

(string)(Required)

Action to perform (more-info, toggle, call-service, navigate, none)

Default value:

more-info

navigation_path

(string)(Optional)

Path to navigate to (e.g. /lovelace/0/) when action defined as navigate

Default value:

none

service

(string)(Optional)

Service to call (e.g. media_player.media_play_pause) when action defined as call-service

Default value:

none

service_data

(string)(Optional)

Service data to include (e.g. entity_id: media_player.bedroom) when action defined as call-service

Default value:

none

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
  service_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 whitelist_external_dirs (documentation).