twrecked / hass-virtual

Virtual Components for Home Assistant
GNU General Public License v3.0
167 stars 28 forks source link

Reloading the Integration creates everything anew #93

Open doctorkb opened 9 months ago

doctorkb commented 9 months ago

When I restart Home Assistant, it behaves as expected, making appropriate changes to the entities. However, when I just reload the integration, it forgets everything from before and creates new entities

twrecked commented 9 months ago

Which version are you on?

doctorkb commented 9 months ago

Virtual Components 0.9.0a6, HAss Core 2024.1.6

twrecked commented 9 months ago

Can you try the latest build? I might have been using the wrong directory during upgrades.

doctorkb commented 9 months ago

Just tried 0.9.0a9 -- it still recreates the entities with new names.

This occurs when I go to the Virtual Devices integration, then select the three dots next to "Imported Virtual Group" and select "Reload".

frankfrommelt commented 5 months ago

Same for me even with the latest build b10. Whenever I press "reload" a new round of entities is created (_2, _3, _4, ...). When restarting HA (I just updated core) no new entities are created.

twrecked commented 5 months ago

Found it. I'd forgotten the to remove on reload. I'll test and push a fix.

frankfrommelt commented 4 months ago

OK, in v 0.9.0b11 a reload does not create the counting _2, _3, _4, ... entities any more. So, in general we should considers this bug as being fixed. Thank you. Sadly, for me, it re-created all the switch.virtual_xyz_3 entities I had as switch.virtual_xyz entities (removing the numbering on re-load). So, no I have to touch all the automations etc. none more (hopefully last) time...

twrecked commented 4 months ago

Yes. I pushed a possible fix but I've been busy all weekend and didn't get a chance to update any issues.

I had to delete and reload my devices to revert my naming after verifying and then testing the fix. Not ideal I'm sorry.

ildar170975 commented 4 months ago

Just updated to the latest 0.9.0.beta.11 from 0.8.x & started testing. Noticed this behaviour, probably related to the current issue:

  1. Open some Light device.
  2. Associate it with some area.
  3. Make some changes in "virtual.yaml".
  4. Reload config entry.
  5. See that this device is again not associated with an area.
dawon commented 1 month ago

Just plain reloading of the config without any changes does reset friendly names and areas of all entities...

0.9.0.beta.17