Triggering Luup from other Luup

I have a few scenes with hand-rolled luup code. I dumped the HTTP requests for my cams via wireshark so I could reproduce them in vera via luup. I want to link them via scenes. For example, I have a bedtime scene that I would like to trigger other scenes containing luup code, mainly to ensure things go back to a default state at night, like ensuring cams I disables during the day to go back to their schedule at night. At this point I’m copy-pasting the luup code from the other scenes (disablecam1, disablecam2, enablecam1, etc) into the bedtime scene. Is there a more elegant way of handling this besides copy-paste?

Ideal scenario is I setup scenes to enable and disable cams via luup wget (done). But at bedtime I would like to ensure the cams are set back to their normal schedule/settings. I would like to call the scenes that set the cams back to schedule from my bedtime scene so I don’t have to copy-paste and maintain the luup code in two places (bedtime scene, cam-specific scene. Am I approaching this from the wrong perspective?

(I searched and searched, couldn’t find an elegant method for calling scenes from other scenes. I might have either high expectations for elegance, or missing something. Sorry but I did search first!)

luup.call_action("urn:micasaverde-com:serviceId:HomeAutomationGateway1","RunScene",{ SceneNum="<SCENE_NUM>" }, 0)

Replace <SCENE_NUM> with the number of the scene you want to call.

Thanks PurdueGuy!

Thanks PurdueGuy. I had seen that info in the Luup Scenes Events wiki but this blurb threw me off:

However, normally you don't need to luup.call_action in Lua code. Rather, whatever actions, or commands, you want to run, you put into the scene itself, and the only Lua code is to simply check if some condition is true and abort the scene if the condition isn't met.

Maintaining the same code in multiple places is not appealing (read->maintenance nightmare, learned my lessons years and years ago, etc). You confirmed that this is perhaps the more elegant approach I was looking for. Thanks again!

No problem. I think that paragraph just mean don’t put in call-actions to turn lights on/off, adjust locks, etc.

Some things have to be done via LUUP unless/until MCV makes some things possible.