rianadon / opensprinkler-card

Home Assistant card for collecting OpenSprinkler status
Other
66 stars 8 forks source link

Duplicate station names not handled correctly #9

Closed klusekb closed 3 years ago

klusekb commented 3 years ago

I have two OpenSprinkler controllers - one for the front yard and one for the backyard. There are multiple stations defined for each - 3 and 4, respectively. The remaining stations ("S0x") are unused.

I added both controllers to Home Assistant. There were no problems with the first one (front). However, when I added the second one (back), I only saw two stations instead of eight. I figured out that I only saw the two stations with unique names. The stations with names that were also present in "back" (including all the unused "S0x") were not visible.

I renamed the two stations I cared about, giving them unique names, removed and re-added the controller and the renamed stations are visible now. This makes me think that in a system with multiple sprinkler controllers, duplicate names are not handled properly.

The two controllers have unique names: os

The entities have unique names as well: stations

The "front" sprinkler card shows all stations, including the unused ones: front

The "back" sprinkler card only shows the station with unique names: back

Might it be a display issue?

rianadon commented 3 years ago

Tricky tricky.

  1. It looks like Home Assistant adds the _2 to the end of the would-be-identical entity ids so that they are unique
  2. The card expects the entity ids of the status entities to end with _status
  3. s05_station_status_2 does not end with _status. Hence it is not displayed 😭

With #5 now merged, I think it might be safe to do away with the entity id checks. Thanks for giving me a great excuse to release yet another version!

klusekb commented 3 years ago

It appears to be working. Thanks!