Disane87 / spoolman-homeassistant

Spoolman home assistant integration 🏠
MIT License
42 stars 4 forks source link

Spools get shuffled around when a spool is archived #103

Open hvraven opened 3 months ago

hvraven commented 3 months ago

System Health details

System Information

version core-2024.3.0
installation_type Home Assistant Container
dev false
hassio false
docker true
user root
virtualenv false
python_version 3.12.2
os_name Linux
os_version 6.1.77
arch x86_64
timezone Europe/Berlin
config_dir /config
Home Assistant Cloud logged_in | false -- | -- can_reach_cert_server | ok can_reach_cloud_auth | ok can_reach_cloud | ok
Dashboards dashboards | 3 -- | -- resources | 2 views | 3 mode | storage
Recorder oldest_recorder_run | 20. März 2024 um 08:22 -- | -- current_recorder_run | 21. März 2024 um 08:19 estimated_db_size | 3979.16 MiB database_engine | sqlite database_version | 3.44.2
Spotify api_endpoint_reachable | ok -- | --

Checklist

Describe the issue

I observe that the integration gets confused when spools are archived in spoolman while Home Assistant is running. It appears that the IDs no longer match the spool. The picture below shows one of my spools in storage. Each jump in the remaining amount is when a spool was archived. The displayed color also no longer matches the spool. When I restart home assistant the assignment is corrected, instead the archived spools are marked as no longer existent

grafik

Reproduction steps

  1. Add some spools
  2. Archive a spool

Debug logs

follow later when I have a new spool to archive.

Diagnostics dump

No response

spitfire commented 3 months ago

I've seen some discrepancy between HA and Spoolman itself, could it be the same issue (Spoolman is right on which one is being used, HA integration attributes values to the wrong spool)?

Zrzut ekranu 2024-03-22 o 12 17 53 Zrzut ekranu 2024-03-22 o 12 18 04

I haven't used the dark blue, black is being used.

Disane87 commented 3 months ago

Thank you for filing that issue and your investigation! I guess this issue seems to be related with reloading the spools (entities) in HA when something has changed.

I need to reproduce this and hope I can encounter this problem.

Actually I'm trying to handle a complete reload the spools from Spoolman automatically because these oddities are mostly gone if HA is restarted or the integration is reloaded manually (in the integration settings). Would be nice if you can test this with your issue if it's gone after that. If that works and the problem is gone, I have to find a way to reload the spools periodically new with all current data.