Good news! PS works for single nodes! See the attached results. Note, I modified your code for OnChangeSceneID to run these tests to:
And to this the second time. Note I appended "UP" to the PS command for this trial. I think it is needed so that all controllers know which nodes have a scene stored:
Code:
dim oMember, oDevice
dim sCmd: sCmd = "ON,UP"
if sysevent.newVal and this.SceneID > 0 then
' Set light level for each member
for each oMember in this.GetObjectsByType(Schema.Modules.Leviton.Classes.SceneMember.Path, false)
set oDevice = oMember.Device
if oDevice.IsOfExplicitType(Schema.Modules.Leviton.Classes.Dimmer.Path) then ' Dimmer
this.Parent.Parent.SendCommand ">N" & oDevice.NodeID & "L" & this.ConvertBrightness(oMember.Brightness) & ",UP", true
else ' Switch
if oMember.PowerState = false then sCmd = "OF,UP"
this.Parent.Parent.SendCommand ">N" & oDevice.NodeID & sCmd, true
end if
this.Parent.Parent.SendCommand ">N" & oDevice.NodeID & "PS" & this.SceneID & ",255", true
this.Programmed = now
next
end if
set oMember = nothing
set oDevice = nothing
And to this the second time. Note I appended "UP" to the PS command for this trial. I think it is needed so that all controllers know which nodes have a scene stored:
Code:
dim oMember, oDevice
dim sCmd: sCmd = "ON,UP"
if sysevent.newVal and this.SceneID > 0 then
' Set light level for each member
for each oMember in this.GetObjectsByType(Schema.Modules.Leviton.Classes.SceneMember.Path, false)
set oDevice = oMember.Device
if oDevice.IsOfExplicitType(Schema.Modules.Leviton.Classes.Dimmer.Path) then ' Dimmer
this.Parent.Parent.SendCommand ">N" & oDevice.NodeID & "L" & this.ConvertBrightness(oMember.Brightness) & ",UP", true
else ' Switch
if oMember.PowerState = false then sCmd = "OF,UP"
this.Parent.Parent.SendCommand ">N" & oDevice.NodeID & sCmd, true
end if
this.Parent.Parent.SendCommand ">N" & oDevice.NodeID & "PS" & this.SceneID & ",255,UP", true
this.Programmed = now
next
end if
set oMember = nothing
set oDevice = nothing