# Scene duplication bug

**URL:** <https://community.gladysassistant.com/t/bug-duplication-de-scene/9167>\
**Category:** Développement\
**Created:** [November 3, 2024, 3:20pm UTC](https://community.gladysassistant.com/t/bug-duplication-de-scene/9167 "2024-11-03T15:20:53Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Prof\_Techno](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/prof_techno/32/19038_2.png) [@Prof\_Techno](https://community.gladysassistant.com/u/Prof_Techno)\
**Post date:** [November 3, 2024, 3:20pm UTC](https://community.gladysassistant.com/t/bug-duplication-de-scene/9167/1 "2024-11-03T15:20:53Z")

</div>

So the error feedback is as follows

 ![image](https://gladys-assistant-community.b-cdn.net/uploads/default/original/3X/9/5/95e3c224169d54fcd084d1df8160ba3da2387793.png)

to reproduce this error you just need to create a presence detection scene

then duplicate the scene

go to change the device state and save

If you delete the trigger and don’t recreate it, there are no issues

Good luck finding where this comes from

---

<div class="post-metadata">

**Author:** ![pierre-gilles](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/pierre-gilles/32/5886_2.png) [@pierre-gilles](https://community.gladysassistant.com/u/pierre-gilles)\
**Post date:** [November 4, 2024, 9:19am UTC](https://community.gladysassistant.com/t/bug-duplication-de-scene/9167/2 "2024-11-04T09:19:13Z")

</div>

Hi @Prof_Techno,

I just tried, and I can’t reproduce:

- I created a scene «&nbsp;aaa&nbsp;»:

 ![Screenshot 2024-11-04 at 10.18.10](https://gladys-assistant-community.b-cdn.net/uploads/default/original/3X/3/c/3c6a29254b5d021aaee3a963c7eca774fa30ad54.png)

- I saved it
- I duplicated it into a scene «&nbsp;bbb&nbsp;», I saved:

 ![Screenshot 2024-11-04 at 10.18.40](https://gladys-assistant-community.b-cdn.net/uploads/default/original/3X/3/8/38b526821f1fb591509c716dc30eabcf28cbcbb3.png)

- I saved

Everything works ^^

Do you have more information?

---

<div class="post-metadata">

**Author:** ![GBoulvin](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/gboulvin/32/10006_2.png) [@GBoulvin](https://community.gladysassistant.com/u/GBoulvin)\
**Post date:** [November 4, 2024, 3:35pm UTC](https://community.gladysassistant.com/t/bug-duplication-de-scene/9167/3 "2024-11-04T15:35:37Z")

</div>

I’ve already encountered the problem. But for me, it’s not specifically related to scene duplication.  
If you change the trigger device in the hub without having removed it, it’s impossible to save the scene.  
For example, I replaced the temperature sensor with another one and for that I had to delete the hub and add another one back, even though it had the same values, etc.

---

<div class="post-metadata">

**Author:** ![Psoy](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/psoy/32/9005_2.png) [@Psoy](https://community.gladysassistant.com/u/Psoy)\
**Post date:** [November 4, 2024, 3:41pm UTC](https://community.gladysassistant.com/t/bug-duplication-de-scene/9167/4 "2024-11-04T15:41:42Z")

</div>

Hello,  
I confirm this has already happened to me: after modifying or duplicating a scene I couldn’t save it. I had to delete it and recreate it. I thought I wasn’t waiting long enough for the elements to update. In any case, I’ve already had this problem

---

<div class="post-metadata">

**Author:** ![pierre-gilles](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/pierre-gilles/32/5886_2.png) [@pierre-gilles](https://community.gladysassistant.com/u/pierre-gilles)\
**Post date:** [November 4, 2024, 3:54pm UTC](https://community.gladysassistant.com/t/bug-duplication-de-scene/9167/5 "2024-11-04T15:54:18Z")

</div>

> [@GBoulvin](#):
>
> If you change the trigger device in the box without removing it, it is impossible to save the scene.

Yes, that’s normal behavior!

I just tested: if you change the selected device in a trigger «&nbsp;Device state change&nbsp;», you must then re-enter a value that will trigger the scene

If you don’t enter a value, the scene is not valid and therefore cannot be saved.

However, it’s true that we could add an error on the action or the trigger that is causing the problem to indicate to the user where a value is missing

---

<div class="post-metadata">

**Author:** ![Prof\_Techno](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/prof_techno/32/19038_2.png) [@Prof\_Techno](https://community.gladysassistant.com/u/Prof_Techno)\
**Post date:** [November 4, 2024, 4:58pm UTC](https://community.gladysassistant.com/t/bug-duplication-de-scene/9167/6 "2024-11-04T16:58:44Z")

</div>

no more info

just that changing the trigger prevents saving

---

<div class="post-metadata">

**Author:** ![pierre-gilles](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/pierre-gilles/32/5886_2.png) [@pierre-gilles](https://community.gladysassistant.com/u/pierre-gilles)\
**Post date:** [November 5, 2024, 7:56am UTC](https://community.gladysassistant.com/t/bug-duplication-de-scene/9167/7 "2024-11-05T07:56:02Z")

</div>

What I’m trying to understand is just whether it’s a bug or not. Because, if the scene isn’t filled in correctly, it’s intentional that it prevents you from saving 🙂

If you can make a video recording of the bug, that would be great!

---

<div class="post-metadata">

**Author:** ![Prof\_Techno](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/prof_techno/32/19038_2.png) [@Prof\_Techno](https://community.gladysassistant.com/u/Prof_Techno)\
**Post date:** [November 5, 2024, 5:23pm UTC](https://community.gladysassistant.com/t/bug-duplication-de-scene/9167/8 "2024-11-05T17:23:57Z")

</div>

I’ll do that for you as soon as I can.

---

<div class="post-metadata">

**Author:** ![Prof\_Techno](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/prof_techno/32/19038_2.png) [@Prof\_Techno](https://community.gladysassistant.com/u/Prof_Techno)\
**Post date:** [November 7, 2024, 6:14pm UTC](https://community.gladysassistant.com/t/bug-duplication-de-scene/9167/9 "2024-11-07T18:14:18Z")

</div>

here is the link

[https://streamable.com/lo8guc](https://streamable.com/lo8guc)

---

<div class="post-metadata">

**Author:** ![pierre-gilles](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/pierre-gilles/32/5886_2.png) [@pierre-gilles](https://community.gladysassistant.com/u/pierre-gilles)\
**Post date:** [November 8, 2024, 7:06am UTC](https://community.gladysassistant.com/t/bug-duplication-de-scene/9167/10 "2024-11-08T07:06:49Z")

</div>

Thank you for the video! Indeed, it’s a bug 🙂

I created a GitHub issue:

> <https://github.com/GladysAssistant/Gladys/issues/2161>
>
> https://community.gladysassistant.com/t/bug-dupplication-de-scene/9167
> 
> https:…//github.com/user-attachments/assets/b37c592f-c1e6-4433-8c4c-9fcd209d8637

---

<div class="post-metadata">

**Author:** ![pierre-gilles](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/pierre-gilles/32/5886_2.png) [@pierre-gilles](https://community.gladysassistant.com/u/pierre-gilles)\
**Post date:** [November 8, 2024, 3:31pm UTC](https://community.gladysassistant.com/t/bug-duplication-de-scene/9167/11 "2024-11-08T15:31:30Z")

</div>

Actually it had nothing to do with duplication, it’s just that if you replace one presence sensor with another, the value wasn’t preserved!

It’s fixed in this PR:

> <https://github.com/GladysAssistant/Gladys/pull/2166>
>
> \### Pull Request check-list
> 
> To ensure your Pull Request can be accepted as fa…st as possible, make sure to review and check all of these items:
> 
> \- \[x\] If your changes affects code, did your write the tests?
> \- \[x\] Are tests passing? (\`npm test\` on both front/server)
> \- \[x\] Is the linter passing? (\`npm run eslint\` on both front/server)
> \- \[x\] Did you run prettier? (\`npm run prettier\` on both front/server)
> \- \[x\] If you are adding a new features/services, did you run integration comparator? (\`npm run compare-translations\` on front)
> \- \[x\] Did you test this pull request in real life? With real devices? If this development is a big feature or a new service, we recommend that you provide a Docker image to the community (\[french forum\](https://community.gladysassistant.com/)/\[english forum\](https://en-community.gladysassistant.com/)) for testing before merging.
> \- \[x\] If your changes modify the API (REST or Node.js), did you modify the API documentation? (Documentation is based on comments in code)
> \- \[x\] If you are adding a new features/services which needs explanation, did you modify the user documentation? See \[the GitHub repo\](https://github.com/GladysAssistant/v4-website) and the \[website\](https://gladysassistant.com).
> \- \[x\] Did you add fake requests data for the demo mode (\`front/src/config/demo.js\`) so that the demo website is working without a backend? (if needed) See \[https://demo.gladysassistant.com\](https://demo.gladysassistant.com).
> 
> NOTE: these things are not required to open a PR and can be done afterwards / while the PR is open.
> 
> \### Description of change
> 
> Fix bug when changing the presence sensor of device state change trigger

It will be included in the next version of Gladys!
