Show Batt low on Lovelace House Map

So far I can show when a door or window is open or closed but how do I also add battery low?
Do I have to add another element since it is a different entity?
How do I tell it which image to put on top?
So far this is what I have.

elements:
  - type: image
    entity: binary_sensor.lumi_lumi_sensor_magnet_aq2_opening
    image: /local/window_small.jpg
    state_image:
      'on': /local/window_open.jpg
      'off': /local/window_small.jpg
      unknown: /local/window_unknown.jpg

Another question: For when the device goes unknown, is my formatting correct? I haven’t been able to test that yet.

Yes, you put another image, based on your other entity.
The new one will be at the same indentation as the previous one.
The latest is on top, like a cake, going bottom → up.

The 3 states are:

'on': ...
'off': ...
unavailable: ...
1 Like

Thank you!

Since the battery level isn’t an on or off value how do I get the batt low image to show up if the battery goes below 15% I see the state of it. it is a value between 1-100

I tried this but it’s obviously wrong…

      - type: image
        entity: sensor.door_main_r_battery_battery
        state_image:
          'on': /local/batt_low.png
        value_template: >-
          {{ state_attr('sensor.door_main_l_battery', 'battery_level') | float <
          15 }}
        style:
          left: 56.6%
          top: 5%
          width: 3%

OK, I made some progress but now the image won’t load

      - type: image
        entity: sensor.door_main_r_battery
        state_image:
          low: /local/batt_low.png
        value_template: >-
          {{ state_attr('sensor.door_main_l_battery', 'battery_level') | int <
          80 }}
        state:
          - value: true
            image: low
        style:

what I mean by won’t load is that it is trying to load but has a spinning icon where the image should be

Doesn’t seem possible, you’ll have to create a template sensor based on the real one and do a customisation of the icon there

I forgot to say thanks! I did what you said and I was able to test it. Now it works great!

1 Like