Closed fribse closed 2 years ago
Thanks for the feedback @fribse. Is the supplied JSON from the moment when you get the error message? If not, is it possible to get the JSON from that exact moment?
Hmm, I'm trying to 'catch' it, it mostly happens first time I load Home Assistant lovelace, so then if I press refresh, it shows it (normally), and it's difficult to catch it from dump1090 fast enough :-)
When you say the first time when you load it, do you mean the first time after restarting Home Assistant, or the first time after you restarted your browser?
First time I load the browser. A few times I've had to do a CTRL+F5 to make it go away, otherwise a simple F5 will clear up the problem.
I can't reproduce the error. It seems like the entity is not loaded the first time you open the page, which is something on your environment. I've added a check on the data from then entity, which throws an error when rendering the table and when there is no data. This fixes the error that you got, but not the cause of it. I don't think I'm able to fix that.
Released in v0.5.2.
Not sure if I caught it this time @fratsloos ?
{ "now" : 1661801970.9,
"messages" : 709610,
"aircraft" : [
{"hex":"3c5427","squawk":"7037","flight":"BCS3317 ","lat":55.686951,"lon":12.304173,"nucp":7,"seen_pos":5.7,"altitude":6025,"vert_rate":-1280,"track":190,"speed":280,"category":"A5","mlat":[],"tisb":[],"messages":167,"seen":4.7,"rssi":-31.6},
{"hex":"4aca6b","squawk":"2504","flight":"SAS1221 ","lat":55.855470,"lon":12.422276,"nucp":7,"seen_pos":9.3,"altitude":10925,"vert_rate":1280,"track":302,"speed":341,"category":"A3","mlat":[],"tisb":[],"messages":306,"seen":7.2,"rssi":-34.0},
{"hex":"4aca6d","mlat":[],"tisb":[],"messages":793,"seen":245.3,"rssi":-34.0},
{"hex":"4520ea","mlat":[],"tisb":[],"messages":1325,"seen":265.3,"rssi":-34.2}
]
}
I'm sorry, I can't reproduce your error. I've used your json but no luck. I see the two planes in the output. Did you update to 0.5.2 and still have the issue?
This morning I see this: But going to the fr24 I see this:
{ "now" : 1662528197.2,
"messages" : 28051,
"aircraft" : [
{"hex":"48415f","squawk":"7675","altitude":38000,"vert_rate":64,"track":232,"speed":427,"mlat":[],"tisb":[],"messages":229,"seen":0.5,"rssi":-33.9},
{"hex":"440052","mlat":[],"tisb":[],"messages":56,"seen":223.1,"rssi":-35.1},
{"hex":"406b62","mlat":[],"tisb":[],"messages":476,"seen":119.9,"rssi":-33.1}
]
}
Today I got this: Taken from dump1090
{ "now" : 1662794567.9,
"messages" : 120377,
"aircraft" : [
{"hex":"5110e9","mlat":[],"tisb":[],"messages":3023,"seen":134.0,"rssi":-33.7},
{"hex":"48ae20","mlat":[],"tisb":[],"messages":448,"seen":292.3,"rssi":-34.4}
]
}
@fribse In your JSON there is no valid data. Both tracked flights are missing data to show on the card. That's why you got the initial error, and after the update the new error.
I think I should implement something (like a warning) for the situation when there are no tracked flights, instead of throwing the exception (current).
Well, it's all up to you of course, I just report what I see, but I'm glad I finally got a result showing the right data :-) I think you should just show 'no flights' or something like that, as soon as there is traffic again, it shows it correctly again.
It took a while, but I made an adjustment to the card when no planes were found. This adjustment can be found in the pre-release I just released.
You can download the pre-release via HACS, by choosing 'Show beta versions' in the redownload option of the card and then installing version 0.6.0-alpha
. Note: This update uses the new version of browser_mod. That must be installed first, unless you don't use popups in the card.
My flight tracker at my other house is currently powered off. With this beta version, the FR24 card is now showing "No aircrafts detected!" rather than the old error. However, in my current situation it is really a little different since the entire REST call should be failing rather than the call succeeding but not have any flight data.
I'm not sure if you can do this or not, but it would be nice if you could have 2 different error messages. The current new one is great for that "normal" situation of the tracker being up and running, but no flights within range. But if the REST call isn't successful, I'd prefer to see some sort of a "error" message indicating that the server call was unsuccessful. Looking at the HA sensor, it seems like the REST interface is giving it a Status of "OK" in both situations. But when the server isn't up, the only attribute displayed is the "Friendly Name".
In the last commit, a modification was made to give a proper error if there is no data, as suggested by @BrettEBowman.
These changes will be available through a pre-release later this week, after some more testing on my side.
Looks great. Thanks!
I've just released version v0.6.0-beta which is available in HACS beta versions with the latest changes.
Describe the bug The frontend sometimes shows
To Reproduce Steps to reproduce the behavior:
Expected behavior Sometimes it works as expected, and shows the list of planes, other times it just shows that odd message
Screenshots Firefox Chrome
Environment (please complete the following information):
Additional context FR24: Linux/generic/static_armel/1.0.29-10 Raspberry Pi 3b+
Configuration
If possible, also supply the JSON of
aircraft.json
.