MiLight/Easybulb/LimitlessLED Plugins

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 ?

Thanks for the info, @nullx8. I’m working on MiLightCU1 at the moment to bring it in line with the others. While I’m testing, I’ll see if I can improve the mode control.

Mode switching on the RGB lamp is tricky as you have found. If the lamp misses one of the many up/down commands the plugin cannot tell. The new Sync button/action may be of some use to you with this.

Note also that you can force a reset of the mode by setting it to 0 before then setting the mode you want.

well its not like a broken leg since i have the RGB Plugin installed since day 1 anyway for debugging reasons, so a few calls to the dev-plugins dont hurt :wink:

effectmode 0 (on CI1 plugin) has the same results … i try that before doing the ModeDown way via the RGB plugin.
use effectmode 0 lets the lamp flash trough the modes …
but setting afterwards another effect … always seems to miss 1 or 2 … (sets mode 2 instead of 3 or somethings like that)

maybe its a timing issue.
i try put sleeps in between … and also try direct UDP talking to the lamp instead …
always the same result.

but with some strange reason … using the RGB calls (ModeDown) … gives a correct result in 9 out of 10 times.
the one time i just run the scene once more … and all is good.

this seems to be only Mode-related … color changes always working at 99%.
my bedroom lamp has 4 color/brightness settings controlled by the vera it uses on different scenatios …
like TV on, wakup for morning shift, wakup for late shift, sleep light … even if my wife use the remote (very rarely as the vera take care of this very well) … the lamp always gets back to the supposed settings.

while iam writing this … there is another difference.
the lamps are the same. but the lamp with the mode issues uses a V3 Bridge … where the other use a V1 bridge … i may change them for a test in a few days …

Thanks for the update, @nullx8. There are a few things we can try:

I’ve just uploaded the new version of MiLightCU1. I didn’t find any processing problems with mode switching but I have seen occasional missed steps when cycling between high and low modes. To help with this, I have added an option that will force a reset of Effects Mode whenever it is changed. This is enabled by including FMR in the Options variable. Separate with a comma when you have multiple options. The reset will not happen when changing from a solid colour (Hue) to the Effects Mode that was previously used.

It’s interesting that you are getting the problems with the V3 bridge. It should not make a difference… There is one thing you could try: There is now an option for adjusting the Inter Command Time. This defaults to 50ms. I wonder if increasing this would help with your problem. Add ICT=100 to Options to increase it to 100ms. It will make every operation a little slower but it’s worth a try.

The easy way to set the options is by pasting this into Test Luup code (Lua) and running it:

local dID = 104 -- Device ID of your MiLightCU1 local options = "RDL,FMR,ICT=100" luup.call_action("urn:dcineco-com:serviceId:MiLightCU1","SetOptions",{newOptions=options},dID)

When set this way, the new options will take effect immediately with no need for a restart.

I have uploaded a new version of MiLightCU1 - for Mi-Light RGB lamps. The new version includes some features that were premiered in the MiLightRGBW plugin:

The Sync button or action will re-assert the current plugin settings to re-synchronize a lamp that has been adjusted with a remote control or Smartphone app.

There are six buttons for setting commonly used colours. Hue can also be set by name by using a new action: SetColor newColor= where is one of red, green, blue, cyan, yellow or magenta.

The Options variable may be used to set configuration options to reflect user preferences. See MiLightCU1.pdf in the plugin package for details on the options and how to set them.

@nullx8, I made a small change to the Effects Mode reset when the FMR option is enabled. If the new mode is > 10, the mode will be reset upwards to 20 rather than downwards to 1. This reduces the number of steps required to set the new mode so may help with reliability. Only I_MiLightCU1.xml is changed.

Hi Rex

I’m looking to create a visual alarm system - allowing the lights i have to flash e.g Red when something is wrong with Vera or when an armed sensor is tripped.

Now for me, the ideal model would be that when initated - the current state of the lights is captured and returned to once the alarm lighting sequence has been activated.

Considering your knowledge of scripting, plus the bulbs and their various modes - have how best do you think this should be done ?

Hi Chris,

The obvious way to do this would be to write scene Luup to capture all the important variables from each device, then set each device into Alarm state, wait a while then painstakingly restore all the devices with the appropriate actions depending on the saved variables and finally turn them off if that’s how they were to start with. Very messy. :o

However, try this: Create a new MiLightRGBW device and set its Group to 0. This device will attempt to control all the lamps on the bridge. Set whatever fiendish parameters you want for your Alarm state. When you have finished, use the Sync button on your normal devices to bring them back to sanity.

When you want your psychedelic event, fire the Sync action for the new device. When you want normality resumed, fire the Sync actions for the normal devices. I would stagger these by a few seconds else you may clog-up the bridge.

Hi Rex

Nice idea ! - I can call the new device simply ‘Alarm Lighting’

So for a scene like this, how best would you code the flashing of the lights ?

I can set the Hue to Red, but rather than a sequence of on and off commands with a specified interval - Is there a disco mode that just does one colour , or something built in that would make it flash ?

How long have you had these lamps? You haven’t played with Disco Mode yet? Try number 6. Set Disco Rate for maximum annoyance.

;D I had only tried disco via the iOS remote control and that just seemed to cycle through the colours …

But disco mode 6 it is - now if I could just get the sounds of the alert from Star Trek to go via Sonos I could really freak people out !!!

[quote=“RexBeckett, post:170, topic:175037”]Especially for Garrett, I have uploaded a new MiLightRGBW. If you add the option TDM to the Options variable on the Advanced tab, LoadLevelStatus and the slider on the UI will behave like that of a traditional dimmer and go to zero when you turn the lamp off.

Only I_MiLightRGBW.xml and MiLightRGBW.pdf have changed.[/quote]

I’ve just applied the TDM option and now all my apps behave as you would expect them to, showing the light icon off. It just keeps getting better - I’m tempted to order more bulbs!

[quote=“eldrix4, post:192, topic:175037”][quote=“RexBeckett, post:170, topic:175037”]Especially for Garrett, I have uploaded a new MiLightRGBW. If you add the option TDM to the Options variable on the Advanced tab, LoadLevelStatus and the slider on the UI will behave like that of a traditional dimmer and go to zero when you turn the lamp off.

Only I_MiLightRGBW.xml and MiLightRGBW.pdf have changed.[/quote]

I’ve just applied the TDM option and now all my apps behave as you would expect them to, showing the light icon off. It just keeps getting better - I’m tempted to order more bulbs![/quote]
I’m glad you like the new option. Am I the only person who likes to see the dimmer level when the lamp is off? Whatever, that’s the point of the options: freedom to configure it the way you want it. Like ordering burgers. ;D

Go ahead - get more lamps. I’m sure you have lots of light-sockets waiting to be brought into the 21st century. 8)

that is exactly what i’m trying to accomplish with my downstairs lamp.

the default is mode 3 in super-slowmo … to have some smoth color change.
but on disarm or comming home i want the lamp to change the mode/colors based on recent events.
what i’m doing now is simply change the mode of the lamp … and then turn it back off.

the coming home/disarm scene simply power it back on … and it will “display” the mode set before by serval scenes/triggers.

right now i have implemented.

  • “You Got Mail”
  • missed Phonecalls
  • Motionsensor where triggered while away (well i get a push message for that anyway, its just because i can)
  • after i get the Cat-flap z-waved i will also have “cats are out”

and if away is on, the lamp does change the modes on fixed times and stays on … to simulate the tv.
(i store the previous setting in a extra variableset i created for this)

Hi @nullx8

How are you running your alert lighting - are you scripting or using the Advanced Tab in the Scene (see mine below)?

I’m trying to get all my lights to do the same thing - Disco 6 is a perfect for DANGER :slight_smile: as it even makes me want to leave the house

With all zones (0) being used on one device, it’s really hit of miss if it works, (plus the goal is for each individual light to re-sync back to it’s previous state) however there seems to be no consistency with how it behaves. - But I need to play a bit more to find out what order it prefers.

I can run this and it does not apply disco mode 6 - it just turn the current state which is White light, to 100 and then returns (syncs) back to the lights original 50% White Light setting.

With all zones (0) being used on one device, it's really hit of miss if it works, there seems to be no consistency with how it behaves,.
Maybe it is pushing the capabilities of the bridge to lamp link just too far. It is going to result in a large number of commands in a short space of time. You could try adding the option [b]ICT=100[/b] to increase the inter-command time to 100ms. It may not help but it is worth a try. Just do this for the group 0 device.

Hi Rex

I have added - ICT=100 in the Options variable, but no luck - it can sometime work, but if i try it again, it seems to miss the disco mode request.
All lights turn on quickly every time, maybe the disco command requires a bit more programming. but if it can work once, why not a second/third time…

What every i choose has to be consistent - i’ll try moving the Disco request back another second or two and see if that helps

It seems sometimes the disco mode request (after running the scene) can become unresponsive - even if i go in the the Alert Lighting device, it shows disco mode 6 selected, but i can see it is not running, and even if I click again on SetMode it does not run…

However if I click on something else e.g Blue and then come back to SetMode - the disco mode runs…
(it’s like it gets stuck)

Are you planning to add a slider for the colour changes, with their values next to it?
That way you can slide up and down the supported spectrum and can know the exact Hue number/value you want/like ?

[quote=“parkerc, post:199, topic:175037”]Are you planning to add a slider for the colour changes, with their values next to it?
That way you can slide up and down the supported spectrum and can know the exact Hue number/value you want/like ?[/quote]
Vera only allows one slider per device and that is being used for dimming. AutHomation has a nice colour-picker. 8)