Conditional code for a scene that already uses a code?

I see the conditional scene code but how do i use it with a scene that is already using luup to say something through sonos?

I have a scene that says “The garage door is open” through Sonos and i want to put it on a schedule at 10pm 11pm etc but only say something when the door is actually open.

This is simple sonos:
luup.call_action(“urn:micasaverde-com:serviceId:Sonos1”, “Say”,
{Text=“The garage door is open”, Language=“en”, Volume=10},
190)

and this is what i think i need to add:
local dID = 66 – Device ID of your Z-Wave Switch
local allow = true – true runs scene if switch is on, false blocks it
local status = luup.variable_get(“urn:upnp-org:serviceId:SwitchPower1”,“Status”,dID)
return ((status == “1”) == allow)

then i will use a schedule to run this at whatever time at night.

how do i put this together?

Thanks,
ja

[quote=“nojosh, post:1, topic:188041”]I see the conditional scene code but how do i use it with a scene that is already using luup to say something through sonos?

I have a scene that says “The garage door is open” through Sonos and i want to put it on a schedule at 10pm 11pm etc but only say something when the door is actually open.[/quote]

local dID = 66           -- Device ID of your Z-Wave Switch
local status = luup.variable_get("urn:upnp-org:serviceId:SwitchPower1","Status",dID)
if (status == "1") then luup.call_action("urn:micasaverde-com:serviceId:Sonos1", "Say", {Text="The garage door is open.  Wop bob uh loo bah uh wop bam boom", Language="en", Volume=10}, 190) end
return

(Assuming all the code you posted is correct, of course.)