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.

Error for default vacuum platform with Neato bots

See original GitHub issue

Checklist

  • I have updated the card to the latest version available
  • I have cleared the cache of my browser
  • I have checked if the problem is already reported

The problem

This line: https://github.com/PiotrMachowski/lovelace-xiaomi-vacuum-map-card/blob/f5e13cc0e2c26a2d0f52093cc03ac3955e37ca6d/src/model/generators/icon-list-generator.ts#L166

… assumes that there’s a fan_speed_list attribute on the vacuum, which is optional in the vacuum device type for HA. Neato botvacs, in particular, don’t have said attribute. Seems like checking for null and omitting the fan speed icon would be the safe thing here.

What version of a card has described problem?

2.0.8

What was the last working version card?

No response

What vacuum model do you have problems with?

Neato Botvac D7

Which integration do you use to control your vacuum (link)?

https://www.home-assistant.io/integrations/neato/

What browser (browsers/apps) does have this problem?

All

What version of Home Assistant do you use?

2021.12.1

What type of installation are you running?

Home Assistant Container

Card’s configuration

No response

Javascript errors shown in the browser’s console (if applicable)

xiaomi-vacuum-map-card.js?hacstag=193372044208:557 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'length')
    at Function.generate (xiaomi-vacuum-map-card.js?hacstag=193372044208:557)
    at HTMLElement._setPresetIndex (xiaomi-vacuum-map-card.js?hacstag=193372044208:836)
    at HTMLElement._firstHass (xiaomi-vacuum-map-card.js?hacstag=193372044208:836)
    at HTMLElement.set hass [as hass] (xiaomi-vacuum-map-card.js?hacstag=193372044208:836)
    at HTMLElement.value (hui-masonry-view.ts:44)
    at hui-masonry-view.ts:44
    at Array.map (<anonymous>)
    at HTMLElement.value (hui-masonry-view.ts:44)
    at HTMLElement.value (hui-masonry-view.ts:44)
    at HTMLElement.value (hui-masonry-view.ts:44)

Additional information

No response

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:33 (19 by maintainers)

github_iconTop GitHub Comments

1reaction
rstecklercommented, Jan 5, 2022

My bad. Apparently you can’t just replace the file when it was installed with HACS. I had to delete the matching .gz file that HACS creates (and serves) when it installs a frontend component. Once I deleted the .gz, it started serving the .js file.

…aaaaaand… IT WORKS!

image

Thanks for all the help man. So stoked to have this working.

1reaction
rstecklercommented, Dec 15, 2021

Here’s an example of a working config on Neato:

type: custom:xiaomi-vacuum-map-card
platform: default
title: Dusty (downstairs)
entity: vacuum.dusty
preset_name: Live Map
map_source:
  camera: camera.dusty_cleaning_map
calibration_source:
  calibration_points:
    - vacuum:
        x: 1
        'y': 1
      map:
        x: 1
        'y': 1
    - vacuum:
        x: 1562
        'y': 1916
      map:
        x: 1562
        'y': 1916
    - vacuum:
        x: 1
        'y': 1916
      map:
        x: 1
        'y': 1916
icons:
  - icon: mdi:play
    tap_action:
      action: call-service
      service: vacuum.start
      service_data:
        entity_id: vacuum.dusty
  - icon: mdi:pause
    tap_action:
      action: call-service
      service: vacuum.pause
      service_data:
        entity_id: vacuum.dusty
  - icon: mdi:stop
    tap_action:
      action: call-service
      service: vacuum.stop
      service_data:
        entity_id: vacuum.dusty
  - icon: mdi:home
    tap_action:
      action: call-service
      service: vacuum.return_to_base
      service_data:
        entity_id: vacuum.dusty
  - icon: mdi:map-marker
    tap_action:
      action: call-service
      service: vacuum.locate
      service_data:
        entity_id: vacuum.dusty
tiles:
  - label: Battery
    icon: mdi:battery
    entity: vacuum.dusty
    attribute: battery_level
    unit: '%'
  - label: Status
    icon: mdi:robot-vacuum-variant
    entity: vacuum.dusty
    attribute: status
  - label: Area Cleaned
    icon: mdi:view-grid-outline
    entity: vacuum.dusty
    attribute: clean_area
    precision: 0
    unit: ' sqft'
map_modes:
  - template: vacuum_clean_segment
    predefined_selections:
      - id: 1
        outline:
          - - 921
            - 1066
          - - 250
            - 1066
          - - 250
            - 750
          - - 921
            - 750
          - - 921
            - 1066
        label:
          text: Kitchen
          x: 580
          'y': 900
          offset_y: 30
        icon:
          name: mdi:fridge
          x: 580
          'y': 900
      - id: 2
        outline:
          - - 921
            - 1068
          - - 250
            - 1068
          - - 250
            - 1631
          - - 921
            - 1631
          - - 921
            - 1068
        label:
          text: Dining
          x: 580
          'y': 1300
          offset_y: 30
        icon:
          name: mdi:food
          x: 580
          'y': 1300

Note this doesn’t handle segment cleaning yet. It just shows the segments and allows selection.

Here’s the result: image

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error Codes - Neato Robotics
In this table, you find the errors and alerts that may affect your Neato D8, D9, or D10. The error code is visible...
Read more >
User guide - Neato Robotics
Meet your Neato Intelligent Robot Vacuum. • Neato rotating brush works like the brush in a regular upright vacuum cleaner. Do not use...
Read more >
Programmer's Manual - Neato Robotics
AllMotorsOn. Turns on brush, vacuum, and lds during test. May conflict with motor commands of test so use carefully! DisablePickupDetect. Ignores pickup (wheel ......
Read more >
Error Codes – Neato Robotics
Find answers to frequently asked questions and other how-to information for Neato robot vacuums and accessories. Select an Article.
Read more >
D6 GSG comp.6_RevA_12.2.2019.indd - Neato Robotics
Congratulations on your new robot vacuum. This Wi-Fi enabled ... Table of Contents ... Errors. BATTERY LED is used to show: · Charge...
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