Problem duplicating a scene: A scene with the same name already exists

I created scenes a long time ago using HTTP requests to control Z-Wave devices via Domoticz.

Since I integrated my Z-Wave devices directly into Gladys, I want to duplicate these scenes to keep a copy and adapt them with the Z-Wave integration.

The problem I’m encountering is the following :

  • I renamed a scene that was called « Chauffe-eau Arrêt » to « Chauffe-eau Arrêt-0 »
  • I save the modification
  • I duplicate this scene and want to call it « Chauffe-eau Arrêt »
  • I get an error message telling me « A scene with the same name already exists. »

The solution I found :

  • I duplicate this scene and call it « Chauffe-eau Arrêt-0 »
  • I save the modification
  • I exit the scene
  • I go back into the scene « Chauffe-eau Arrêt » and edit it.
1 Like

Hello,

Today I’m encountering a similar but more annoying problem:
I created a scene a week ago Zoé Status Charge (**)
After creating it, I realized that I might need to make a scene for each status.
So I renamed that scene Zoé Status Charge OFF

Today I want to try to make a single scene for all statuses, otherwise I’d have to make 8 scenes, one for each status.

So I opened my scene Zoé Status Charge OFF, which I wanted to duplicate and name Zoé Status Charge

Problem: A scene with the same name already exists.

I look at my list of scenes and there isn’t one with that name?!?!
And then, after digging around a bit, I remember that I’d already created a scene with that name (**)…

Darn, that name can no longer be used…

Hi @gaetanb76 ,
j’ai eu aussi le même problème que toi pour des scènes qui ont déjà le même nom.
En fait quand tu crées une scène, elle est enregistrée avec ce nom (et des - en remplacement des espaces).


Ensuite on peut modifier le nom de la scène (et sauvegarderà MAIS le nom original ne changera pas.

Donc si plus tard tu veux (re)créer une scène avec ton nom de départ (« test de nom » dans mon exemple) et bien ça va coincer.

Bon, j’ai vu que tu avais déjà la méthode bypass :wink:

1 Like

Indeed @mutmut is right, it’s the selector that’s causing the issue.
We need to add a bit of randomness to the end of the selector to avoid this kind of collision

like « test-de-nom-1b3d »

I’m creating an issue :

If I remember correctly, the issue had already been reported some time ago, with the same kind of solution proposed.
Personally I had the same case a few days ago too; it took me a few seconds to understand ^^

It’s often not a big deal, but it can be annoying from time to time.

Yes, but until now I was thinking about a global solution (for all the selectors), which is a titanic undertaking. I figure this might be an issue that mainly affects the scenes, so let’s do the scenes first, and then it’ll be fixed in 10 minutes.

2 Likes

Added random characters to the end of selectors for new scenes and duplicated scenes:

It’s merged, it will be included in the next Gladys release!

4 Likes

Fixed in Gladys Assistant 4.52.0 :