question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Map errors on empty list of filtered entities

See original GitHub issue

using

        - type: custom:auto-entities
          show_empty: false
          card:
            type: map
            default_zoom: 4
          filter:
            template: |
              {% set km = states('input_number.quakes_near')|float %}
              {% set location = states('input_select.quakes_near') %}
              {% for s in states.geo_location|selectattr('attributes.source','eq','usgs_earthquakes_feed') %}
              {% if distance(s.entity_id,location) < km %}
                {{- s.entity_id -}}{{',' if not loop.last else ''}}
              {% endif %}
              {% endfor %}

95% of the time the map wont show, while the template is providing a list of geo_location entities. Error in the log:

Error: Either entities or geo_location_sources must be specified
Schermafbeelding 2021-04-21 om 23 04 42 Schermafbeelding 2021-04-21 om 17 17 52

every now and then I see it pop up:

Schermafbeelding 2021-04-21 om 16 57 59

this card is part of a bigger conditional entities card, which all show, except for the map, which is the small red line obviously:

Schermafbeelding 2021-04-21 om 17 19 08

I’ve also made this template into an attributes_template of another sensor, so the backend would do the work, but that doesn’t make a difference.

{{state_attr('sensor.earthquakes_near','raw_list')}}

can’t we do this?

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:10 (6 by maintainers)

github_iconTop GitHub Comments

github_iconTop Results From Across the Web

List of Map filter results in an extra empty item - Stack Overflow
You are building maps by filtering on each ones contents. And one of them will be empty since no values were passed (but...
Read more >
ContentDocumentLink filter error on ContentDocumentID ...
recently I encountered another very weird issue where I was not getting results for map.keySet() or Set<id> even if I put them in...
Read more >
Indexer errors and warnings - Azure Cognitive Search
This article provides information and solutions to common errors and warnings you might encounter during indexing and AI enrichment in Azure ...
Read more >
5 Common Hibernate Mistakes That Cause Dozens of ...
5 Common Hibernate Mistakes That Cause Dozens of Unexpected Queries ; 1 1. Not Initializing Lazily Fetched Associations. 1.1 ; 2 2. Using...
Read more >
Geocoding Service | Maps JavaScript API - Google Developers
To retrieve all the political entities that contain a specific address, you should use ... An empty list of types indicates there are...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found