#Dynamic Custom Group Helper Icon

1 messages · Page 1 of 1 (latest)

lucid lion
#

I have group helpers set as occupancy sensors for all my rooms. I'd like to be able to change the icons for these entities to a custom icon based on on/off state using Jinja, but none of the options in customize.yaml are working. The icons are all just coming up blank, which makes me think something is happening, just not what is intended.

Formats I've tried:

binary_sensor.lounge_room_occupied:
  icon: >-
    {{ is_state('binary_sensor.lounge_room_occupied','on') | iif('mdi:sofa','mdi:sofa-outline') }}
binary_sensor.bedroom_occupied:
  icon: >-
    "mdi:bed-king{{'' if is_state('binary_sensor.bedroom_occupied','on') else '-outline'}}"
binary_sensor.bathroom_occupied:
  icon_template: "mdi:bathtub{{'' if is_state('binary_sensor.bathroom_occupied','on') else '-outline'}}"
#

I have tried removing the Show as and Icon customizations from them in the helper entitiy front end.

chrome sonnet
#

Customize.yaml does not support templates

lucid lion
#

So is the only solution to recreate them as template sensors?

chrome sonnet
#

That's an option

#

There's also card-mod, etc for individual cards

lucid lion
#

Could have sworn there was a post about a year ago claiming they updated the parser to make templates work anywhere. Must be confusing it. Thanks anyway!