zigbee2mqtt-frontend
zigbee2mqtt-frontend copied to clipboard
[Bug -> dev image]: Last Seen Status marked as N/A and no Availability column but working when Frontpage is accessed again
What happened?
Not sure if this has been discussed before. For a couple of weeks I have noticed a weird behavior in the Frontend. I run 2 instances of Z2M on docker on 2 different docker hosts. Each instance has its own container name, runs on two different docker hosts, connects to MQTT with two separate logins, and have a different instance name in MQTT. Version is latest image updated automatically 1.34.0-dev commit: 2c5d3e1 My configuration.yaml contains both :
availability: true
advanced:
homeassistant_legacy_entity_attributes: true
Everything works fine except that the frontend page always shows a "Last Seen" column as "N/A" for all devices. "Availability" column is not displayed at all.
Note that the "Last Seen" and "Availability" information is properly published to MQTT under (ie Z2M[instancename]/availability/[online:offline]) These info are also available in Home Assistant and in the Frontpage on device details view.
When I go in the Frontend to the Settings/Availability page, the setting is indeed flagged for Simple Availability.
If I go out of the Frontpage to another tab then come back to the Frontpage (top left link of the page), the "Last Seen" and "Availability" column displays properly.
If I then do a refresh of this Frontpage, it goes back to displaying "N/A" for Last Seen. The "Availability" column disappears again
Same behavior in Chrome and Waterfox
I have the exact same behavior on both instances of the Frontpage. So it seems to be related to the initial loading of the page. And indeed in the debug window of Chrome (F12) I can see some errors occurring. The below block appears several times :
Unknown last_seen type undefined
P9 @ index-91540039.js:58
ID @ index-91540039.js:85
y2 @ index-91540039.js:41
rC @ index-91540039.js:43
l9 @ index-91540039.js:43
i9 @ index-91540039.js:43
d3e @ index-91540039.js:43
Yy @ index-91540039.js:43
oF @ index-91540039.js:43
Xs @ index-91540039.js:41
m3e @ index-91540039.js:43
kl @ index-91540039.js:43
r9 @ index-91540039.js:43
S @ index-91540039.js:28
L @ index-91540039.js:28
NA.nh.<computed> @ index-91540039.js:18
RI @ index-91540039.js:18
DP @ index-91540039.js:18
Frontend is exposed with SSL Letsencrypt certificate. Everything else seems to work as it should.
Note that I have been running Z2M for a very long time (more than 2 years) with a similar architecture and prior to a couple of weeks ago I definitely did not have this behavior.
What browsers are you seeing the problem on?
Chrome
Relevant stacktrace
No response
Did you download state.json.zip?
I will attach state.json.zip
Hi!
Can you attach complete state.json file from Settings -> Tools -> Download state
?
I believe it is already attached
https://github.com/nurikk/zigbee2mqtt-frontend/files/13697134/state.json.zip
I should have added that this issue was while I used the dev image. Today I was forced to migrate to non-dev image as the just released latest dev image would not start due to some bug. And then the last seen column came back as soon as I started the non-dev version. So this issue is indeed related to the dev image itself.