The idea would be to be able to duplicate a scene. (useful when you need to do the same scene x times)
The best would be, when copying, to ask which device should be taken into account.
Example:
An initial scene that signals a low battery for device X.
You duplicate the scene and specify that it is for device Y (note that I am not talking about also customizing the message sent if you use the « send a message » action)
Analysis of the scene to be copied and retrieval of the values of the « devices » variables
A page that displays the device value for each device of the copied scene in a « select box » first. For each « select box », the rest of the choices will be of the same type as the device of the copied scene.
The user will therefore be able to change their devices
A « save » button to validate their choices.
For this, of course, in the properties of the devices that gladys can query, the « type » property of the device must be entered and common to the same type of device.
I don’t know how a scene is coded (static mode (raw text file) or dynamic (via a database)) or how devices are referenced.
I recognize that this can be a gas plant especially if you are in static mode.
Hello, I just made a small PR to add scene duplication. When you click the copy button, it redirects to a new page to choose the new name for the duplicated scene.
I just integrated it into my PROD Gladys because I integrated my Z-Wave devices and therefore I need to create countless scenes to manage my devices (for toggle ON/OFF I already need 2 scenes and when I have a 5-button switch . It « works » except that (and I don’t think this is related to this new feature) but when you modify an element, for example, the device associated with an action « Control a device », the value field changes automatically. Similarly, when you modify a trigger « Device state change », the condition remains, the value also remains but when saving, I have an error because « null » is sent in the request.
Thanks @Romuald_Pochet for your feedback,
I will try to reproduce it on my side to see if I haven’t broken anything. Does your issue appear on all scenes or just the one you duplicated?
I tried to reproduce it but since I don’t have many materials connected to my dev instance (I often reset the database to have a clean instance), I didn’t find anything. I would rather advise you to file a bug on the GitHub.
I just tested your PR, (struck-through = not tested) :
On trigger :
Device state change
Scheduled trigger
At each sunrise
At each sunset
Return home
Leaving home
Home is empty
Home is no longer empty
User enters the zone
User leaves the zone
A calendar event occurs
On action :
Turn on the light (keeping the same one and editing it),
Turn off the lights (keeping the same one and editing it),
Turn on the plugs (keeping the same one and editing it),
Turn off the plugs (keeping the same one and editing it),
Wait,
Send a message (keeping the same one and editing it),
Retrieve the last state (keeping the same one and editing it),
Continue only if (keeping the same one and editing it),
User seen at home (keeping the same one and editing it),
User left the home (keeping the same one and editing it),
Check presence (keeping the same one and editing it),
Make an HTTP request,
Time condition,
Start the scene (keeping the same one and editing it),
If the home is empty (keeping the same home and editing it),
If the home is not empty (keeping the same home and editing it),
Control a device (keeping the same one and editing it),
Condition on a calendar event,
I can’t reproduce @Romuald_Pochet’s case on « Control a device » (well, if you change the device the value does indeed fall back but that’s part of the base scene construction) but if I save immediately it works and if I put back the previous value (e.g. switch to On), likewise it saves correctly.
Note: If it’s possible to change the icon that would be perfect. Even though in most cases it won’t be the case, there are use cases where it can be useful ^^
Quick follow-up on this topic — if anyone drops by here, development is no longer active and we are therefore looking for someone to take over development
The PR above was a good start, the work can be picked up again; you just need to address the various comments/feedback left on the PR.
@pierre-gilles: I’ve done the rebase and the changes on the PR but I can’t reopen it.
Could you check on your end if you can do it ?
Otherwise I’ll have to create a new one