with some reason … i noticed in my scenes that playing with Modes not always get the expected results.
i have in the bedroom a RGB lamp … where only the brightness and the color is changed … and never any modes are used (running with MiLightCU1)
and its working just perfectly … even if the remote is used … the lamp goes always back to the way its supposed to be.
i use a secound lamp now, and try to get some use of the Modes running … based on events …
like - you got mail (mode 6), cats are gone (more 14) … whatever.
the night-light is however mode 3 with the slowest speed. and i have a scene does reset the lamp to exactly that.
every time the mode got somehow changed (or a static color is beeing used) it seems to fail
luup.call_action("urn:dcineco-com:serviceId:MiLightCU1","SetEffectsMode",{newEffectsMode = 3}, rgbunten)
seems to have no effect. or some random results.
so i added to set mode 19 before to force the plugin to do the “reset”
this worked somehwat better but also never got me the right results.
now (out of desperation) i use the RGB1 instead for the scene and do this:
-- reset downstairs lamp (137) to White
local rgbunten = 137
local rgbuntendev = 83
luup.call_action("urn:dcineco-com:serviceId:MiLightCU1","SetEffectsMode",{newEffectsMode = 0}, rgbunten)
luup.sleep(160)
luup.call_action("urn:upnp-org:serviceId:Dimming1", "SetLoadLevelTarget", {newLoadlevelTarget = "100"}, rgbunten)
luup.sleep(160)
luup.call_action("urn:dcineco-com:serviceId:MiLightRGB1","ModeDown",1, rgbuntendev)
luup.sleep(160)
luup.call_action("urn:dcineco-com:serviceId:MiLightRGB1","ModeDown",1, rgbuntendev)
luup.sleep(160)
luup.call_action("urn:dcineco-com:serviceId:MiLightRGB1","ModeDown",1, rgbuntendev)
luup.sleep(160)
luup.call_action("urn:dcineco-com:serviceId:MiLightRGB1","ModeDown",1, rgbuntendev)
luup.sleep(160)
luup.call_action("urn:dcineco-com:serviceId:MiLightRGB1","ModeDown",1, rgbuntendev)
luup.sleep(160)
luup.call_action("urn:dcineco-com:serviceId:MiLightRGB1","ModeDown",1, rgbuntendev)
luup.sleep(160)
luup.call_action("urn:dcineco-com:serviceId:MiLightRGB1","ModeDown",1, rgbuntendev)
luup.sleep(160)
luup.call_action("urn:dcineco-com:serviceId:MiLightRGB1","ModeDown",1, rgbuntendev)
luup.sleep(160)
luup.call_action("urn:dcineco-com:serviceId:MiLightRGB1","ModeDown",1, rgbuntendev)
luup.sleep(160)
luup.call_action("urn:dcineco-com:serviceId:MiLightRGB1","ModeDown",1, rgbuntendev)
luup.sleep(160)
luup.call_action("urn:dcineco-com:serviceId:MiLightRGB1","ModeDown",1, rgbuntendev)
luup.sleep(160)
luup.call_action("urn:dcineco-com:serviceId:MiLightRGB1","ModeDown",1, rgbuntendev)
luup.sleep(160)
luup.call_action("urn:dcineco-com:serviceId:MiLightRGB1","ModeDown",1, rgbuntendev)
luup.sleep(140)
luup.call_action("urn:dcineco-com:serviceId:MiLightRGB1","ModeDown",1, rgbuntendev)
luup.sleep(140)
luup.call_action("urn:dcineco-com:serviceId:MiLightRGB1","ModeDown",1, rgbuntendev)
luup.sleep(140)
luup.call_action("urn:dcineco-com:serviceId:MiLightRGB1","ModeDown",1, rgbuntendev)
luup.sleep(160)
luup.call_action("urn:dcineco-com:serviceId:MiLightRGB1","ModeDown",1, rgbuntendev)
luup.sleep(240)
luup.call_action("urn:dcineco-com:serviceId:MiLightRGB1","ModeDown",1, rgbuntendev)
luup.sleep(240)
luup.call_action("urn:dcineco-com:serviceId:MiLightRGB1","ModeDown",1, rgbuntendev)
luup.sleep(240)
luup.call_action("urn:dcineco-com:serviceId:MiLightRGB1","ModeDown",1, rgbuntendev)
luup.sleep(240)
luup.call_action("urn:dcineco-com:serviceId:MiLightCU1","SetEffectsMode",{newEffectsMode = 3}, rgbunten)
luup.sleep(160)
luup.call_action("urn:upnp-org:serviceId:Dimming1", "SetLoadLevelTarget", {newLoadlevelTarget = "11"}, rgbunten)
this ensures the lamp actually does what i want and have the MiLightCU1 have the right (current) setting as well)
very buggy … but it seems to work.
any idea how to make that better ?