Skip to content
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

Daily energy entities disappear from powercalc UI after reboot #2265

Closed
5 tasks done
mikealanni opened this issue May 30, 2024 · 10 comments
Closed
5 tasks done

Daily energy entities disappear from powercalc UI after reboot #2265

mikealanni opened this issue May 30, 2024 · 10 comments
Labels
bug Something isn't working config-flow daily-fixed

Comments

@mikealanni
Copy link

System Health details

Couldn't find it

Checklist

  • I have read the FAQ to see if there is a known solution to my problem.
  • I have enabled debug logging for my installation.
  • I have filled out the issue template to the best of my ability.
  • This issue only contains 1 issue (if you have multiple issues, open one issue for each issue).
  • This issue is not a duplicate issue of currently previous issues..

Describe the issue

I have created like 5 entries in powercalc gui and there were working with no issue, restart home assistant made them disappeared from powercalc but they are available on entities with red exponential mark saying unavailable "This entity is no longer being provided by the powercalc integration. If the entity is no longer in use, delete it in settings"

Reproduction steps

  1. Create daily energy like fridge
  2. Value like 1
  3. tiggle utilities meter
    4.submit
  4. Restart home assistant
  5. Entry disappeared
    ...

Debug logs

2024-05-30 14:14:58.142 DEBUG (MainThread) [custom_components.powercalc.sensors.daily_energy] Creating daily_fixed_energy energy sensor (name=Test_debug energy, entity_id=sensor.test_debug_energy, unique_id=Test_debug)
2024-05-30 14:14:58.142 DEBUG (MainThread) [custom_components.powercalc.sensors.daily_energy] Creating daily_fixed_energy power sensor (base_name=Test_debug unique_id=Test_debug)
2024-05-30 14:14:58.142 DEBUG (MainThread) [custom_components.powercalc.sensors.power] Creating power sensor (entity_id=sensor.dummy entity_category=None, sensor_name=Test_debug power strategy=fixed manufacturer= model= unique_id=Test_debug_power)
2024-05-30 14:14:58.143 DEBUG (MainThread) [custom_components.powercalc.sensors.utility_meter] Creating utility_meter sensor: Test_debug energy daily (entity_id=sensor.test_debug_energy_daily)
2024-05-30 14:14:58.143 DEBUG (MainThread) [custom_components.powercalc.sensors.utility_meter] Creating utility_meter sensor: Test_debug energy weekly (entity_id=sensor.test_debug_energy_weekly)
2024-05-30 14:14:58.143 DEBUG (MainThread) [custom_components.powercalc.sensors.utility_meter] Creating utility_meter sensor: Test_debug energy monthly (entity_id=sensor.test_debug_energy_monthly)
2024-05-30 14:14:58.143 DEBUG (MainThread) [custom_components.powercalc.sensors.daily_energy] sensor.test_debug_energy: Restoring state: 0
2024-05-30 14:14:58.144 DEBUG (MainThread) [custom_components.powercalc.sensors.power] sensor.dummy: State changed to "on". Power:25.00
2024-05-30 14:14:59.147 ERROR

Diagnostics dump or YAML config

No response

@mikealanni mikealanni added the bug Something isn't working label May 30, 2024
@bramstroker
Copy link
Owner

No errors in the logs?

You should see Creating daily_fixed_energy energy sensor one time for each your config entry, which indicates the entities are being created by powercalc.
In your debugs logs I only see one for "Test_debug", so that's probably a test you did?

@mikealanni
Copy link
Author

Yes I did the test to collect the debug info and only that what I've got. Any daily energy sensors created by powercalc via the UI will disappear after restart the home assistant. So I went a head and created them in the configuration yaml file and they are working with no issue. The only two sensors that never disappeared from powercalc are the Google home that automatically discovered and another one I created for my Tuya smart plug. Maybe because they associate with actual devices and the daily energy all just virtual?

@tubbers
Copy link

tubbers commented Jun 1, 2024

i have this issue too. real devices stay, but any virtual device disappears. I note the entities are still there, but inactive, but the base device is gone
pc
pc2

@bramstroker
Copy link
Owner

bramstroker commented Jun 1, 2024

@mikealanni Issue confirmed with Daily energy. I was able to reproduce and have a fix with #2271
Actually this bug was introduced in very recent version v1.12.3 from 2 weeks ago.

@tubbers For you also this config entry is not visible anymore at "Integration entries"?

Screenshot 2024-06-01 at 08 53 17

Did you create this recently?

If not available anymore please create again, and after that check the logs for errors. Also click three dots and download diagnostics than. Would help me debug the issue.

When the config entry is still visible, also download diagnostics and share.

@laplac
Copy link

laplac commented Jun 1, 2024

I have the same issue. Real device stays like Alexa and virtual device disappear.

@bramstroker
Copy link
Owner

@laplac Could you have a look into the questions I asked to @tubbers ?
And since when do you experience this issue?

@laplac
Copy link

laplac commented Jun 1, 2024

@bramstroker I was on version 1.12.3. I just updated to version 1.12.5 now and will test.

Q. this config entry is not visible anymore at "Integration entries"?
A. The config disappear completely from the integration entries after restart. the entities like energy and utility entities stays but with status "Not provided"

Q. Did you create this recently?
A. Yes on version 1.12.3 . I didn't use Daily Energy feature before until a week ago.

@bramstroker
Copy link
Owner

@bramstroker I was on version 1.12.3. I just updated to version 1.12.5 now and will test.

Q. this config entry is not visible anymore at "Integration entries"? A. The config disappear completely from the integration entries after restart. the entities like energy and utility entities stays but with status "Not provided"

Q. Did you create this recently? A. Yes on version 1.12.3 .

Ah ok thanks. That was exactly what I was able to reproduce and fixed. But not released yet.
This bug was specifically with "Daily fixed energy", not "Virtual power (manually)".
There was a JSON encoding issue while saving the config entry, so the entry would never been actually saved, and thus not surviving restarts.

Will release new version shortly with the fix.

But I was uncertain because of your comment "virtual device disappear" that the issue was broader than only the daily fixed sensors.

@bramstroker
Copy link
Owner

Just released v1.12.6 with the fix.
@tubbers when your issue is not with "Daily energy" sensors please create a separate issue, and provide more information.

Screenshot 2024-06-01 at 12 23 28

@tubbers
Copy link

tubbers commented Jun 9, 2024

I don't have the 3 dots to download, as the devices are missing. So there is no configure option or 3 dots. Only physical devices exist. I upgraded to this new fixed version and recreated the devices. I created both daily energy and virtual devices and both were lost on reboot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working config-flow daily-fixed
Projects
None yet
Development

No branches or pull requests

4 participants