-
Notifications
You must be signed in to change notification settings - Fork 282
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Group power sensors not loaded during startup #2962
Comments
Will have a further look and ask more questions later. |
Yeah I only noticed it started happening quite recently when HA's statistics kept suggesting to remove the unavailable sensors. I will try downgrading and dig further |
Yeah your issue is definitely different then the |
Yeah I think there's some funky edge case going on. Yes my bad the sensors are not created on startup. I tried downgrading it didn't help (even with 1.67.1), deleting and recreating the affected sensors and groups didn't help either. But then I've added another virtual power sensor for a different switch with a new group and it's working fine...? I checked the history it seemed to started to happen from the 10th ish Will try to debug further to to see if i can find a way to reproduce it properly |
Hi, I lost some sensors as well when upgrading from 1.16.7 to 1.17.1:
They have in common that there is a manual power configuration. Example 1:
example 2 & 3:
|
downgrading didn't fix ?! No warnings nor errors in the log either. Edit: downgrade did fix it. Need to change state to get them back |
@erkr thanks for chiming in. Which downgrade fixed it in the end? So do you know which version introduced the regression exactly? |
@bramstroker Your are welcome :). I downgraded to 1.16.7 (from 1.17.1). Then I updated to previous release 1.17.0 and that release has the same issue. |
@erkr Your issue seems exactly the same as #2911 |
Yeah, didn't realise that difference tbh until I discovered that the sensors get back after the first state change. |
@erkr please see my comments on #2911, was able to reproduce the template sensor unavailable issue. Probably still unrelated to the issue @kbullet reported here, but makes sense for @kbullet to retest after I fixed the other issue and create a new release. |
@bramstroker i'm still unable to reproduce my issue with a completely new group, virtual power sensor of a different switch... Though FYI a workaround I found out to seem to have fixed it, is to create an energy sensor for the virtual power sensor (deleting the created energy sensor afterwards seems to work still). It is quite strange hope that can give you some clues. Though I'll leave couple of my groups that are affected untouched to test your fix/new release. |
Could you share some diagnostics for groups which are working and groups which are not? Click 3 dots and "Download diagnostics" |
@bramstroker awesome, thanks! Apologies I've been away to be able to test your fixes and give you more info. Will report back once I get home next weekend. p.s. Thanks for this amazing integration and keep up the good work! |
@bramstroker just upgraded to the latest version unfortunately my issue still persists. here's the diagnostics of the affected groups and sensors. https://pastebin.com/wZvyKfnf i've included both when sensors are missing/unavailable & reloading the sensors manually hope that is of help. Though I think this might be some super weird edge case |
@kbullet the config entries looks perfectly fine and exactly as expected. Too further investigate we really need to focus on the logs, and having that extended with more debug logs when needed. Let's please focus on one entity / problem at a time, otherwise it gets very confusing for me because I'm working on numerous issues constantly. And need to reread / distill all available information each time. |
Apologies, as i mentioned in one of my previous posts the workaround I found that I applied to the "bathroom lights" entities is to create an energy for the power sensor which seems to somehow fix the issue. The living room lights entities is the one I left untouched with the issue still persisting hence I took those logs. |
Please bear with me I didn't remember this, and don't read each issue all comments again :-) So on your latest shared diagnostics for {
"_energy_entity": "sensor.living_room_lights_energy",
"create_energy_sensor": true,
"group_member_sensors": [
"01JBEF9JHZV7CC7N3T0N7S4YZ9",
"01JBEFAW9PDWYRGM3AABHJKCHN"
],
"name": "Living Room Lights",
"sensor_type": "group"
} Might be a good idea to compare that with the diagnostics for |
No worries at all, I did a comparison before I could not see anything out of the ordinary. "data": {
"_energy_entity": "sensor.bathroom_lights_energy",
"create_energy_sensor": true,
"group_member_sensors": [
"01JBEDS4K1D9TSCEAKGT1JR8S2",
"01JBEDTCEF9BXD3WK4ATK7QXSR"
],
"name": "Bathroom Lights",
"sensor_type": "group"
}, The only thing I could see that was different is the living room power sensor is using the group's entry_id instead of the name. Though I did try changing that in the config entry before and for sanity check just did again but it didn't help. e.g. "data": {
"_power_entity": "sensor.bathroom_lights_group_1_power",
"create_energy_sensor": false,
"create_utility_meters": false,
"entity_id": "switch.dual_relay_bathroom_left",
"fixed": {
"power": 21.0
},
"group": "Bathroom Lights",
"ignore_unavailable_state": false,
"mode": "fixed",
"name": "Bathroom Lights Group 1",
"sensor_type": "virtual_power",
"unique_id": "pc_0xa4c138d4f2de8691_switch_left_zigbee2mqtt"
}, vs "data": {
"_power_entity": "sensor.living_room_lights_group_1_power",
"create_energy_sensor": false,
"create_utility_meters": false,
"entity_id": "switch.sonoff_zbminil2_relay_living_room_1",
"fixed": {
"power": 27.0
},
"group": "01JBEF823ARPGABWQ441Q2F2C9",
"ignore_unavailable_state": false,
"mode": "fixed",
"name": "Living Room Lights Group 1",
"sensor_type": "virtual_power",
"unique_id": "pc_0x842712fffe4117de_update_zigbee2mqtt"
}, Anyhow no worries, I can use the workaround if we can't narrow it down. Maybe we can close this for now and reopen it if someone can reproduce it properly. Cheers for all of your support and help! |
@kbullet I don't see anything obvious as well, everything looks fine. Might very well be related to the issue somehow. You might try removing the |
Yeah removing the group property did nothing aswell, it is really funky setting create_energy_sensor to true once, somehow fixes the issue. I did not see any difference in the logs or configs (once it is set to true i cannot reproduce it at all for it not to load on startup even removing the newly created energy sensor and reverting back to false). But yeah I don't want to waste much more of your time on this maybe something dodgy is going on specifically on my setup. |
Yes, I think we need to close. I'm getting frustrated when things are not working as expected, and always want to get to the bottom. |
Home Assistant Community Store
Home Assistant Cloud
Dashboards
Recorder
Sonoff
Checklist
Describe the issue
Not sure why but with one of the recent update, Each time restarting homeassistant I need to reload the existing groups i've created to get the power sensors to be initialised correctly. Everything else is loaded correctly. I don't see anything significant or failures in the debug logs.
Reproduction steps
Debug logs
The text was updated successfully, but these errors were encountered: