Autmatic greyscale bass on state

HI,

trying to customize a device_tracker’s entity_picture with not_home to greyscale.

  templates:
    entity_picture: >
      if (state === 'home') return '/local/devices/hue.png';
      return '/local/devices/hue.png;filter:grayscale(100%)';

doesn’t work, doesn’t error either and simply show the hue.png icon

while this works in a tiles setup:

if (state === 'home') return 'background-image: url(\"/local/family/w.jpg\");background-size: 75px 75px';
              return 'background-image: url(\"/local/family/w.jpg\");background-size: 75px 75px;filter:grayscale(100%)';

I realize that’s not the same of course, but had hoped to do something like this in the device_tracker, whiteout the need for a created greyscale .png and use

  templates:
    entity_picture: >
      if (state === 'home') return '/local/devices/hue.png';
      return '/local/devices/hue_not_home.png';

or

entity_picture: >
  return '/local/devices/hue_' + state + '.png;

which is of course rather easy to do… just would like to know if the former greyscale ‘function’ is available in custom-ui somehow.

thanks for having a look