Git Product home page Git Product logo

Comments (15)

BrettEBowman avatar BrettEBowman commented on May 27, 2024 1

I'm using the latest Goolge Chrome on Windows 10 for the browser.

Here's the YAML for the card:

entity: sensor.msp_piaware_flights
columns:
  - flag
  - registration
  - flight
  - icon
  - altitude
  - speed
  - distance
hide:
  empty:
    - distance
popup: true
zone: zone.home
sort: distance

I did look at the .json and it looked like flights that were showing up that way did have lat and long values. So maybe the problem has something to do with the math to determine the distance. The values for my zone.home are latitude: 44.97865681506032, longitude: -93.05218862841296.

Another possible clue that I've noticed is that when I leave that page displayed and it gets updated, the flights often are no longer sorted by distance. When I just opened the page for the very first time today to get the YAML for this post, I noticed that the first time, all of the flights had distance values. But then when it refreshed, a couple had the "NaN". It makes me wonder if there might be a problem with variable reinitialization or something like that.

from fr24_card.

BrettEBowman avatar BrettEBowman commented on May 27, 2024 1

Sure, I can manually download and install to test. Should I use the develop branch or that specific bugfix branch?

from fr24_card.

BrettEBowman avatar BrettEBowman commented on May 27, 2024 1

That testing was from my primary home zone which was the first one.

from fr24_card.

fratsloos avatar fratsloos commented on May 27, 2024

@BrettEBowman Can you supply me with the JSON for when you have that result?

from fr24_card.

BrettEBowman avatar BrettEBowman commented on May 27, 2024

Here's a .json file as well as what the fr24 card displays. (Both from approximately the same time, so they should roughly match up.)

aircraft.zip

from fr24_card.

fratsloos avatar fratsloos commented on May 27, 2024

Thanks, @BrettEBowman. I've tested it with this JSON, and I don't see the NaN. This might be because of the client. What browser or app are you using when you get the NaN?

Can you also give me YAML of the card confirguration?

from fr24_card.

fratsloos avatar fratsloos commented on May 27, 2024

Thanks, that is useful info. I'm looking into it. It might have something to do with the coordinates of the zone. When I used your card config I had no issue. When I added an extra zone with your coordinates I did get a NaN.

from fr24_card.

BrettEBowman avatar BrettEBowman commented on May 27, 2024

FYI I have another HA server at my other house. And I've seen the NaNs there, too. It's zone info is: latitude: 35.62409358633958, longitude: -82.62928962707521.

from fr24_card.

fratsloos avatar fratsloos commented on May 27, 2024

As mentioned I found the NaN in my test environment when I used your configuration and the first zone you gave. With the second zone I didn't have it. But that might be because of the content of aircraft.json. Same as I didn't get it with my local data.

I used a different method to calculate the distance. This time based on the documentation of Google. With his method I don't see the NaN with your data and configuration.

Before:
before

After:
after

Are you able to test this branch before I merge it into the code?
I didn't see an option to use anything other than master or a version in HACS. So if you want to test it you may have to download it. See the instructions on https://github.com/fratsloos/fr24_card/blob/master/readme/installation.md.

Just saw a typo on that page, will fix that with the next release :)

from fr24_card.

fratsloos avatar fratsloos commented on May 27, 2024

You should use the bugfix branch connected to this issue.

from fr24_card.

BrettEBowman avatar BrettEBowman commented on May 27, 2024

It's possible that I didn't manually install properly... I copied the files from the dist folder onto my HA server in the folder where the fr24 files were. There weren't .gz versions in the downloaded dist folder, so I created those. I restarted the HA supervisor, opened my Flights dashboard, and did a forced Ctrl-F5 refresh.

At first, it seemed better, but then I started getting the NaNs again. I captured a couple of aircraft.json files and corresponding displays.

aircraft1.zip

from fr24_card.

BrettEBowman avatar BrettEBowman commented on May 27, 2024

I think I figured out what I did wrong in the installation. I didn't change the Resource mapping, so it still had references to the HACS package. When I redid it, then the page started working OK. And I'm not seeing the NaNs. So, I think the change fixed the problem.

from fr24_card.

fratsloos avatar fratsloos commented on May 27, 2024

Thanks for testing. The compressed files (.gz) are created by HACS. I'll check the new JSON files in the coming days. Just to be sure, were you testing from the first or second zone?

from fr24_card.

fratsloos avatar fratsloos commented on May 27, 2024

I think I figured out what I did wrong in the installation. I didn't change the Resource mapping, so it still had references to the HACS package. When I redid it, then the page started working OK. And I'm not seeing the NaNs. So, I think the change fixed the problem.

Great! :) Just to be sure I'll test with the new JSON files as well before I release the fix.

Don't forget to switch back to the HACS implementation after testing.

from fr24_card.

fratsloos avatar fratsloos commented on May 27, 2024

The fix is published in the latest release: v0.5.1.

from fr24_card.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.