Quantcast
Channel: Configuration - Home Assistant Community
Viewing all articles
Browse latest Browse all 96121

Person entity_picture based on state

$
0
0

@RvdHNL wrote:

Ok, I’m quite lost after reading like 4355 topics, browsing through loads of yaml’s on Github and still cannot get it to work…

Issue: I want to display a different image based on home or not_home state.

The view I want it in (names obviously removed):
defaut.yaml

cards:
  - type:                           glance
    show_header_toggle:             false
    show_name:                      false
    show_state:                     true
    entities:
      - entity:                     person.name
      - entity:                     person.name
      - entity:                     person.name
      - entity:                     person.name

Config:
configuration.yaml:

homeassistant:
  customize: !include family.yaml

In family.yaml i tried many options:
1:

person.name:
  device_trackers:
    - device_tracker.name
  entity_picture:  '/local/img/name_home.png'
  state_filter:
    not_home:       grayscale(90%)

2:

person.name:
  device_trackers:
    - device_tracker.name
  entity_picture:  '/local/img/name_home.png'
  state_image:
    home:          '/local/img/name_home.png'
    not_home:      '/local/img/name_not_home.png'

3:

person.name:
  device_trackers:
    - device_tracker.name
  entity_picture:  >
    {% if is_state(config.entity, 'home' %}  '/local/img/name_home.png' {% else %} '/local/img/name_not_home.png' {% endif %};

Can anyone point me in the right direction?

Posts: 12

Participants: 3

Read full topic


Viewing all articles
Browse latest Browse all 96121

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>