LUUP code in Scenes for GE/Jasco Dimmer

I am trying to set the LoadLevelLast on my GE dimmer switches via LUUP. I would prefer to use PLEG but SetLoadLevelLast is not an option in the Action parameters. So I’m trying to use the scene Luup section to set the new value. I’ve tried several variations of what the code could be but I’ve not have any success in changing the value. It used to work on my Vera 3 but since I upgraded to the Vera Plus I can’t get it to go. I had copied the string I have used in the past…


where the 65 is the desired new value and 9 is the device ID. I’ve tried putting spaces after the commas etc using other characters like {newLoadLevelLast…} Can’t seem to get the system to change it.

Anybody have ideas?


Z-wave dimmers can’t do what you want. Which is override the last known light level when the switch is off. You can only set the load level when the light is on. The question get asked a lot, it is just not possible. The best you can do is set conditions (like using PLEG or Reactor) that trigger the first time the light is turned on when certain conditions exist to go to the light level you want. Or find times when you can flash the light, by quickly turn the light on to the new level then turn it off, at a time that humans aren’t going to notice.

Unfortunately it has worked in the past or I’d believe you. Trust me. When I set my system up 3 or 4 years ago now I literally wrote a manual for myself on my setup so I could recreate it if I have a crash. My issue is I have a vacation rental and people don’t understand the dimmer switches so they constantly dim it down thinking they turned it off. I had it set that if it got to 4% or lower it would turn the switch off and set it to a set level to come back onto. My old post is on the old forum where someone helped me with the LUUP code I posted and it was working. But… you make an interesting point that the variable can’t be set if the switch is off… Something I now have to work out in my brain.


This is the right idea. But, make sure you’re not fighting the broken quotes that result from improper formatting of the post on this forum software. If you copy-paste something that looks like the above, it will likely not run. Here’s a “clean” version with correct formatting that you can copy-paste:

luup.variable_set("urn:upnp-org:serviceId:Dimming1", "LoadLevelLast", "65", devicenum)

Also don’t temporarily paste to or save in Word or any other fancy editor, which will also corrupt the quotes (it wants to make them typographically pretty so it substitutes them with other similar characters, but those new characters are not valid for code).

Interesting, does setting LoadLevelLast actually work with the physical switches on on the GE Dimeers? I tried setting it with the Homeseer dimmers I have. I found that setting LoadLevelLast only worked if you next turned on the light with the Vera (aka via automation). But if you turn on the light with the physical switch, it still returns to the last level the switch was physically at when turned off regardless of what LoadLevelLast is set to.

Yes, the state variable is a Vera thing, it has nothing to do with what the switch itself thinks it should do. When you send a binary “turn on” via the UI/app/automation to the device, if it’s a dimmer Luup will override that and send a dimming command with LoadLevelLast instead. So the behavior you describe is, unfortunately, expected.

There’s a setting TurnOnBeforeDim that will send the binary on first, but it still sends the dim to LoadLevelLast, which is unfortunate. If there was a value there, or another variable, to suppress that dim command altogether, it would be highly desirable, but I don’t know if it exists.

Some switches have “default” dimming values in their (physical) device configuration that you can set. If you have one default setting for that device, then you can set it there via the “Device Options” tab in the Vera UI for that device (and you also need to set LoadLevelLast because they are not coordinated).

If the desired default setting changes, for example by time of day, then Device Options isn’t really an option because it requires (inexplicably) a Luup reload. There are various posts around here about how to set a device configuration value using SendData without requiring a Luup reload.

Of course, that only helps manual operation. You can try to keep LoadLevelLast and the device config in sync. You’d need to work pretty hard to stay on top of it, though.

Yeah, since I have instant status switches, I just detect the first time they are turned on in the morning and bump them up to 100%, which is hardly noticeable on my rig since they respond fast, which kind of resets them for the day which was enough for my configs. And assume the rest of the time they are doing what people want.