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

Occasional startup error when reloading with rename_entities: true #184

Open
jamesshannon opened this issue Aug 30, 2024 · 1 comment
Open

Comments

@jamesshannon
Copy link

Describe the bug
I'm using rename_entities. About 20% of the time that I start up (via reloading the YAML) I get an error that prevents the startup and makes the entities unavailable. Reloading a second time (without making any changes) fixes the issue.

I'm not doing anything edge-casey with the entity names. I set the entity IDs before my first-ever startup of IU and haven't renamed them.

To Reproduce
Steps to reproduce the behavior:

  1. Create a config with rename_entities. (See my config file below.)
  2. Startup IU
  3. Reload the IU YAML ~10 times, looking at the logs / entities after each start.
  4. On one of the reloads, you're likely to get an error log entry and entities will be Unavailable in dev tools.
  5. Reload again. IU should start up normally. No error log entries.

Expected behavior
Should start up consistently each time.

Additional Info
I note that the log message reference c1_z1 and c1_m, which seems like the non-renamed entity names. I don't know where these IDs would have come from.

I checked for entities named c1 (by filtering in Dev Tools Current Entities screen for [c1_]) and there are no entities that are returned.

Config YAML:

controllers:
  - name: "Front Yard Flowers SWV"
    controller_id: frontyard_flowers_swv
    zones:
      - name: "Front Yard Flowers"
        zone_id: flower_pots
        entity_id: "switch.flowers_swv_switch"
        schedules:
          - time:
              sun: "sunrise"
            duration: "00:03:30"
          - time: "15:00"
            duration: "00:03:00"

rename_entities: true

Irrigation Unlimited log file
I'm currently logging level INFO, so there are no debug logs from successful startup.

2024-08-30 10:51:53.190 ERROR (MainThread) [homeassistant.components.binary_sensor] Platform irrigation_unlimited does not generate unique IDs. ID c1_m is already used by binary_sensor.irrigation_unlimited_frontyard_flowers_swv - ignoring binary_sensor.irrigation_unlimited_frontyard_flowers_swv
2024-08-30 10:51:53.190 ERROR (MainThread) [homeassistant.components.binary_sensor] Platform irrigation_unlimited does not generate unique IDs. ID c1_z1 is already used by binary_sensor.irrigation_unlimited_frontyard_flowers_swv_flower_pots - ignoring binary_sensor.irrigation_unlimited_frontyard_flowers_swv_flower_pots
@rgc99
Copy link
Owner

rgc99 commented Sep 5, 2024

It appears the old entities haven't finished deleting before the new ones are created. By swapping the order it seems to fix this.

rgc99 added a commit that referenced this issue Sep 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants