Removing circular mask on template sensor pictures - possible?

A quick question - is it possible to override or remove the circular cropping mask that seems to be applied on pictures used on template sensors?

I’m using this code, replicated 4 times for each of the 4 sensors on an HDHomerun Quatro unit, and using picons to show the channel logos. Many are working fine, but some of the wider ones (especially +1 channels) and the ones that are more rectangular based are getting cropped.

template:
  - sensor:
      - name: Quatro Tuner 0
        unique_id: display_hdhr_q_t0
        state: >-
          {%- if state_attr('sensor.hdhomerun_quatro_tuner_0', 'VctName') %}
              {{ state_attr('sensor.hdhomerun_quatro_tuner_0', 'VctName') }}
          {% else %}
              Idle
          {%- endif %}
        icon: "{{ 'mdi:television-off' if is_state('sensor.hdhomerun_quatro_tuner_0', 'IDLE') else 'mdi:television' }}"
        picture: >-
          {%- if state_attr('sensor.hdhomerun_quatro_tuner_0', 'VctName') %}
              /local/hdhomerun/picons/{{ state_attr('sensor.hdhomerun_quatro_tuner_0', 'VctName') | lower }}.png
          {%- endif %}

Gives:

Quatro

Note the cropping on the channel logo, whereas the original file is (sorry not so easy to see, as it’s more or less a white image with transparent background):

channel 4+1

Is it possible to stop that cropping and remove the mask?

1 Like

This has to do with the picture’s border radius in your lovelace theme.

You can achieve what you want but you will have to play with css values and card_mod.

After having installed card_mod and considering that you’re using a regular entities-card with a sensor entity, you can do something like this

type: entities
card_mod:
  style:
    hui-sensor-entity-row$hui-generic-entity-row$: |
      state-badge {
        border-radius: 0px
      }
entities:
    - .....

Have a look also here.

2 Likes

Thanks for that, exactly what I was after :smiley:

Connect

Now I just need to work out why my iPhone can seemingly no longer see my HDHR Connect or Quatro, but that’s not for this forum.