Closed neuhausf closed 1 year ago
Hmm. Have not seen this before. At first I thought it might be a change made on the HA side since you're running a newer HA instance than I've been testing with, but if I change to exactly HA 2023.3.5 with the stock release v4 card, I still cannot reproduce this. I do not know what "311" refers to. I can only assume there is something in your entity registry list that is (1) valid as per HA, but (2) invalid as to what the card expects.
In your HA config directory, take a look at /config/.storage/core.entity_registry
file and see if you can find something with 311
in it? (Take care not to write or modify this file)
I'm trying to narrow the problem a bit down. With this version, it still works: https://github.com/dermotduffy/frigate-hass-card/actions/runs/4332693383
That's the new v4.1.0
branch that is significantly different from the currently released v4 branch. Have you tried the head of the v4.1.0
branch? Does that work?
PS: Don't suppose you use openweathermap? That's the only reference to 311 in the HA codebase I could find ;-)
No openweathermap in use :) Only MeteoSwiss and AccuWeather.
Here is everything with 311 in my entity_registry:
Problem exists when using HEAD of 4.1.0
-> the other versions should be up to date too (see first post)
Thanks, registry looks fine. I wonder if the error you are seeing is getting mangled somehow.
Are you getting anything interesting in your Javascript console?
So it seems like the issue is somewhere, on the v4.1.0
branch between #1741 and #1749. Maybe binary search a little and see if you can narrow it down to a smaller range? Be very sure to clear your cache after changing JS as the browser may aggressively cache otherwise.
I guess I found the commit: https://github.com/dermotduffy/frigate-hass-card/actions/runs/4332809782
Weird. That should strictly result in fewer calls to HA, rather than more calls.
Javascript console: I think there is the same info, as in the card error itself + an error about media_player.radio not found. I removed the media_player entity, but the error is still the same.
About diagnostics: I don't get a diagnostics window in the errourness version.
I just reverted to https://github.com/dermotduffy/frigate-hass-card/actions/runs/4332693383 and it works again. Here I get diagnostics:
Card diagnostics. Please review for confidential information prior to sharing
{
"ha_version": "2023.3.5",
"card_version": "4.0.0",
"browser": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36",
"date": "2023-03-19T16:08:51.272Z",
"frigate_version": {
"b432101987bd7fbaa1198c9e722a7c26": "4.0.0-beta4/0.12.0-e454daf"
},
"lang": "en",
"timezone": "Europe/Zurich",
"git": {
"build_version": "4.0.0-HEAD+g8333464",
"build_date": "Sat, 04 Mar 2023 20:22:45 GMT",
"commit_date": "Sat, 4 Mar 2023 12:21:16 -0800"
},
"config": {
"type": "custom:frigate-card",
"cameras": [
{
"camera_entity": "camera.camera_tuer",
"live_provider": "go2rtc",
"webrtc_card": {
"url": "rtsp://192.168.1.137:8554/camera_tuer"
}
},
{
"camera_entity": "camera.camera_carport",
"live_provider": "go2rtc",
"webrtc_card": {
"url": "rtsp://192.168.1.137:8554/camera_carport"
}
}
]
}
}
If I see this correctly, this commit has no build artifact: https://github.com/dermotduffy/frigate-hass-card/commit/9870446a9f2869d0370795162dfa7b247261fab2 -> so maybe the change in src/types.ts could be a problem? or a caching issue?
I think you have at least two issues here (one is something wrong with the parsing of the registry entities, the second is something with a specific media_player).
Can you comment on media_player.radio
? What is it and why is it not in the entity registry? (Perhaps this is something manually configured?).
Ah, I think the 311
is obvious in retrospect: can you show me the 311th entry in the response is? You can drill down in the response in the Javascript console, then paste in here what 311th entry is ...
As I don't know if its 0 based, 310 is also included:
By the way: I commented out the media_player in configuration.yaml and this error is gone. But the other error still occurs.
Here is the full error including all entities: https://gist.github.com/neuhausf/dc1f9561b1e08672f75470a959932cf1
OK -- I think the issue is the unique_id
field for the 311th entry is a number, and not a string as the card is expecting. It really should be a string as per the HA expectations:
https://github.com/home-assistant/core/blob/dev/homeassistant/helpers/entity_registry.py#L119
... so this might be feedback to the developers of the "nuki" platform that they are using malformed unique_id in their entity. However, I think the card can also be more tolerant here -- it should not care.
As for the media_player.radio
, can you clarify what that entity is? I think I probably also need to harden this logic, but want to know what entity type that is first.
Hm, the unique_id is from the Nuki integration. Any chance to change this?
As for the media_player: It's from the frontier-silicon platform. I use it like this:
media_player:
- platform: frontier_silicon
host: 192.168.1.152
name: Radio
Hm, the unique_id is from the Nuki integration. Any chance to change this?
You could always shut down your HA instance, modify the entity registry file by hand, and change it to a string. That could very likely break that integration though, since it will be expecting a number. The real fix is (1) for the integration authors to not use a number, and (2) for the card to not care either way!
(2) will be an easy fix for me I suspect, so I wouldn't worry about it, and just give me a few days to get a fix together.
Thanks for the info on the media_player. I'll also fix that.
I tried to change the unique_id. Nuki still started, but added a duplicate entry with the wrong formatted ID again. Iām gonna inform the maintainer. So your fix is very welcome! Thanks a lot for taking the time to track this down! Have a great week š
@neuhausf Try this build artifact and hopefully both of your issues are resolved: https://github.com/dermotduffy/frigate-hass-card/actions/runs/4462902003
You are correct: This build fixes both issues - no more errors in Chrome console. Thank you very much for providing a fault-tolerant solution š ! P.S. The diagnostics menu seems to be broken in this build?
I do also have the same problem
@jahegu This issue is closed. Please open a new issue with debug information if you'd like assistance. Thanks!
Card 4.0.0-beta4, Frigate Integration 4.1.0 and Frigate 0.12.0-beta10 with HA 2023.3.5
Javascript errors shown in the web inspector (if applicable):
Any hints? Which key "311" does the error refer to?