Lovelace: Bringing back entity-filter (monster-card)

Do not use when. Use state under include. When is for showing/hiding the whole card based on an arbitrary condition

Thanksā€¦ I got it figured out.

Iā€™ve been trying to use this to display a map showing just those people who are away from home and for the map to not display if nobody is away from home. I also want a few zones to show on the map. Without the zones, it works:

- type: custom:monster-card
    show_empty: false
    card:
      type: map
      title: People away from home
    filter:
      include:
        - entity_id: device_tracker.person1
        - entity_id: device_tracker.person2
        - entity_id: device_tracker.person3
      exclude:
        - state: home

However, if I include the zones like this:

- type: custom:monster-card
    show_empty: false
    card:
      type: map
      title: People away from home
    filter:
      include:
        - entity_id: device_tracker.person1
        - entity_id: device_tracker.person2
        - entity_id: device_tracker.person3
        - entity_id: zone.home
        - entity_id: zone.work
        - entity_id: zone.another_place
      exclude:
        - state: home

the card displays even when everyone is at home. Is there any way to have the zones display on the map, but be hidden if everyone is at home?

@Steven_Rollason I donā€™t think you need monster-card. You probably are good with a combination of:
https://www.home-assistant.io/lovelace/entity-filter/ and https://www.home-assistant.io/lovelace/conditional/

Even for monster-card, you should not put zone in the filter it should be under when (based on docs). Please have a look at the two cards I linked from the official lovelace docs.

Iā€™ve tried that, but ran into a couple of issues.
The first is that entity-filter doesnā€™t support negative state checks, and checking for the state being ā€œnot_homeā€ isnā€™t the same as checking for it not being ā€œhomeā€ (it only picks up people who are not in any zone, from what I have found).
The second is that the conditions in the conditional card appear to be ANDed and not ORed, as if I use the following:

conditions:
      - entity: device_tracker.person1
        state_not: "home"
      - entity: device_tracker.person2
        state_not: "home"

It only shows the card if both people are away from home and not, as I want, if either of them are away. Am I doing something wrong or is this not possible?

I am getting this error when trying to add monster-card:

Custom element doesn't exist: monster-card.

{
  "type": "custom:monster-card",
  "card": {
    "type": "glance",
    "title": "Monster"
  },
  "filter": {
    "include": [
      {
        "domain": "sensor",
        "attributes": {
          "battery_level": "< 25"
        }
      }
    ]
  }
}

I have the monster-card.js in the www/ folder, copied the code as raw. Java version is latest. Restarted several times, and trying several browsers and even computers. same message.
Anyone knows what could be wrong?

Do you have a reference to the card?

resources:
  - url: /local/monster-card.js?v=1
    type: js

yup. it is in the ui-lovelace.yaml, right?

yes.

And you have the correct path to the file? I canā€™t think of anything elseā€¦ (and for the future, you donā€™t have to restart HA when editing ui-lovelace.yaml, this will save you a lot of precious time :slight_smile: )

Naaah, but I thought that the addition of the .js file might require a restart. Yes the path should be correct. Strange :S

Iā€™m having trouble using another custom card as the card to display in monster-card. The custom card works fine on its own, but when used in monster-card I get the following error:

Uncaught TypeError: this.lastChild.setConfig is not a function

Iā€™m thinking that this is probably this custom card script not being fully loaded at the time monster-card runs. Is this likely to be the reason and is there a way I can fix this?

Hello everyone, this might be an easy question to answer but I was not able get the solution. Is there a way to filter items depending on their value(State). For instance only show the temperature sensors if the temperature it shows is below 25 degrees. I have custom battery sensors with dynamic icons and want to show them on a monster card. But was not able to filter out the ones with state values below 25. Thanks in return.

Found the answer:

- type: custom:monster-card
  card:
    type: entities
    title: Low Battery
  filter:
    include: 
    - entity_id: "sensor.*_battery"
    exclude:
    - state: '>= 30.0'
2 Likes

I have the same problem as WonderMoose
Every time I refresh wtih f5 i get the error message

Custom element doesnā€™t exist: monster-card.

For every monster-card i have. It only blinks for a short while, then it works lika a charm.

Have tried a fresh ui-lovelace.yaml, restarts, redownload the monster-car.js, set java version to latest.

Any idea what the problem might be?

Same issue here, running Homeassistant v0.78.

The blinking of errors is a known issue -or a feature one might say- of the lovelace gui. I donā€™t know if a solution is in works.

Is there a solution to this problem yet? I get it on all cards I have tried with the exception of

resources:
  - url: /local/alarm_control_panel-card.js?v=1
    type: js
  - url: /local/button-card.js
    type: module

The following give me the ā€œdoesnā€™t existā€ error:

  - url: /local/monster-card.js?v=1
    type: js
  - url: /local/custom_ui/weather-card.js
    type: js

Is it possible to filter same as ā€œattributesā€ but with ā€œlast_updatedā€ info?
Iā€™m looking for a way to include only sensors that were changed/updated in the last 60 minutes.
For motion sensors I found ā€˜no motion sinceā€™ attribute that works for me, but thereā€™s no such thing for door/window sensors.

Any thoughts?

As long as that information is as a custom ā€œattributeā€ on the entity it can be used. Check your dev-info panel for the entity that you want this information filtered for and see what you have.

Thereā€™s no such attribute.
At the end finished by making just a template sensor and getting the value from: states.binary_sensor.door_window_sensor_xxxxx.last_updated

Is it possible somehow to display the batterylevel under the entities instead of the state of the entity? (I am using monster card to show me sensors with low battery level)