Hypfer / lovelace-valetudo-map-card

Display the map from a valetudo-enabled robot in a home assistant dashboard card.
MIT License
243 stars 36 forks source link

Android Chrome camera.undefined_map_data #118

Closed mafrosis closed 2 years ago

mafrosis commented 2 years ago

Hi, sorry for opening yet another issue with the card not working 😄 . It works for me on desktop Chrome on macOS, but does not work on Android Chrome (!)

This card was working on both devices when I was on version v2021.12.05

I have:

Screenshot_20220303-163914

Screen Shot 2022-03-03 at 16 48 46
TheLastProject commented 2 years ago

It really sounds like your Android Chrome is caching an old version of the card. I don't use Chrome so I don't know if it has a dedicated way to really clear the cache more reliably on Android because it really doesn't seem cleared.

Or your desktop is using the old version and you didn't read the release notes and thus your config is incorrect for the new version.

TheLastProject commented 2 years ago

Probably the last one actually, given undefined_map_data.

mafrosis commented 2 years ago

Hmm. Clearing caches is a nuisance I've been fortunate to ignore in last 10 years or so since I did web dev 😎

How does undefined_map_data indicate I didn't read release notes properly? ie, which step would fix that? As I wrote above, I did the MQTT dance to refresh the data, and I got a new entity_id to boot.

Can I be more surgical with the "cache clear"? Like, what exactly is stale here... A cached JS file? A cookie? Some webstorage?

TheLastProject commented 2 years ago

It implies the new vacuum option isn't set, causing it to use the value undefined: https://github.com/TheLastProject/lovelace-valetudo-map-card/releases/tag/v2022.01.0

The caching is probably a stale JS file yeah.

mafrosis commented 2 years ago

I updated the card to the new vacuum. entity, and it works on desktop browser, so config must be right.

My Android browser must be caching, which, when I clear the cache, is clearly not clearing the cache.

mafrosis commented 2 years ago

I installed a new browser (DuckDuckGo) which I've never used before. Same issue. Can you consider how it's possible to work on one client and not on another? Thanks. Screenshot_20220305-160806

TheLastProject commented 2 years ago

What is your card's config?

Ricetato commented 2 years ago

Hi, I just thought I'd chime in that I am also experiencing this "Entity not available: camera.undefined_map_data" issue since today. I've tried clearing local storage/cache/cookies for my HA domain on desktop (Edge), swapped to private browsing, my mobile (Android HA app) and also a laptop (also Edge). I've got a few more devices I could chuck at this but don't think that's going to make a difference. I've tried removing the plugin entirely and re-installing, removed the MQTT integration & re-adding it, and rolling back to Nov version of the card didn't seem to do anything so suspect something else might've broke it.

This morning I did decide to swap to the 64bit image for my RPi so moved the config over and installed Mosquitto in a container (wasn't an official 32bit image), there wasn't any issues after this process though. I also hit update on HACS and a few other frontend extensions around the same time before I noticed it. The other Frontend extensions I updated are:

I tried uninstalling each extension individually (removed an extension, restart server, re-install and repeat for each extension). No change for any extension.

@mafrosis do you have any overlap in changes?

Here's my config for the card if it helps at all, it's embedded within a vertical stack card but I get same the error regardless of if its in the stack.

type: custom:valetudo-map-card
entity: camera.map_data
vacuum_entity: vacuum.dreame_f9
title: null
rotate: 0
crop:
  top: 0
  bottom: 0
  left: 0
  right: 0
min_height: 160
TheLastProject commented 2 years ago

@Ricetato Your config is obviously wrong. Please read: https://github.com/TheLastProject/lovelace-valetudo-map-card/issues/118#issuecomment-1057749277

Ricetato commented 2 years ago

Ah yeah.. just typical case of the user being a dunce, didn't RTFM 🤦‍♂️

Cheers @TheLastProject!

mafrosis commented 2 years ago

Turns out that the Android device was showing the correct error, and the desktop was working because I hadn't updated my ui-lovelace.yaml to use vacuum: and not entity_id:.

Factors that got me into this mess (which took a couple hours of tinkering to unpick):

Thanks for your help, and you were right indeed - another case of user error. Perhaps with so many user errors coming up over this issue, the release notes for breaking changes need to be more detailed? 🤷

Whatever the lesson is, if we didn't like hacking around debugging this kind of thing from time to time then we wouldn't be using HA in the first place!!