hass-virtual icon indicating copy to clipboard operation
hass-virtual copied to clipboard

Reloading the Integration creates everything anew

Open doctorkb opened this issue 1 year ago • 15 comments
trafficstars

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

doctorkb avatar Jan 30 '24 18:01 doctorkb

Which version are you on?

twrecked avatar Feb 03 '24 20:02 twrecked

Virtual Components 0.9.0a6, HAss Core 2024.1.6

doctorkb avatar Feb 03 '24 23:02 doctorkb

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

twrecked avatar Feb 04 '24 12:02 twrecked

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".

doctorkb avatar Feb 05 '24 16:02 doctorkb

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.

frankfrommelt avatar Jun 26 '24 13:06 frankfrommelt

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

twrecked avatar Jun 27 '24 02:06 twrecked

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...

frankfrommelt avatar Jul 01 '24 12:07 frankfrommelt

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.

twrecked avatar Jul 01 '24 22:07 twrecked

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.

ildar170975 avatar Jul 11 '24 23:07 ildar170975