Jasco/GE switch dilemma using PLEG

Hello all. I just converted my trusted old Vera 3 to a Vera Plus.

Here’s the dilemma:

  • I have Jasco/GE dimmer digital switches.
  • If you just hold the paddle down it dims down to 1% but doesn’t actually go off
  • I am trying to make the system see that if any of the dimmers go below 4% that they should shut off and set the last load to XX so that the next time you turn the light on it it turns on to that %.

I had this working before by doing the following:

  • Create a virtual switch in vera for let’s say “Dining Light” so “Dining Light VS”

  • I go into PLEG and create a Logic input:

    • Property Name: PD1
    • Comment: Dining LIght
    • Property: LoadLevelStatus
  • I go into Conditions and create:

    • Condition Name: CD1
    • Comment: Dining Light
    • Code: PD1 > 0 AND PD1 < 5
  • I go into Logic Actions and:

    • Choose CD1
    • Comment: Dining Light
    • Immediate selected
    • Select Device to Add to Current Interval: Dining Light VS
    • Action: Set target
    • New Target Value: 1

Then over in scenes in Vera I create a scene that says whenever the Dining Light VS is turned on, turn off the Dining Light (device) and the Dining Light VS

I then add the LUA code: luup.variable_set(“urn:upnp-org:serviceId:Dimming1”,“LoadLevelLast”,“65”,20) Where 20 is the device ID and 65 is what I want the LoadLevelLast to be set at.

I’ve done this before and it worked fine. I even wrote down all the steps. But for some reason it’s end result is that it does turn off the light at 4% or lower, it does set the LastLoadStatus to 65%. But when I go to turn the light back on it goes to 4% and turns off again… It’s as if the act of the dimmer increasing hits that 4% mark and PLEG instantly sees that and shuts it off again. It’s in a death loop and it looks like the switch is broken.

Anyone have any ideas? I’ve tried setting a delay for the PLEG to run but that didn’t help.

I managed to figure it out. Added each dimmer into Pleg. Added a virtual switch for each dimmer into Pleg. Set a condition on each switch that if the loadleveltarget is greater than 0 and less than 5. Then added the logic action that if the condition is true pleg sets the target level on the dimmer to zero (off) and turns on the the virtual switch. Then in scenes I created two for each instance. The first said that if the virtual switch is turned on then immediately turn on the dimmer to X% (like 65% or whatever) then add a delayed action to turn off the virtual switch after 1 sec. Then a second scene that says if the virtual switch is turned off, turn off the light. It’s the only way I could see to set the lastloadlevel on the dimmer that didn’t go into a death loop. Using lua code changed the value but it didn’t work as intended. Strange but I figured out a way around it. It’s what separates from the animals. :slight_smile:

Ok… I REALLY need help here. None of my above solutions are working. I don’t know how to write LUA code well enough to know how to make this work.

Again, I’m trying to get my ge/jasco dimmer switches to turn off automatically when they are dimmed to below 5% but then when you turn them on it goes to a set %.

ie Turn on light, dim the light down to less than 5% (so you think it’s off but it isn’t), the system turns the dimmer off but then sets it to think the last time it was on was at let’s say, 50% so that when you turn it on again it goes to 50%.

In PLEG I only see LoadLevelLast when I’m when I’m setting up the device properties. It’s in the drop down there. But when I go to Logic Actions “LoadLevelLast” is not a variable listed so I can’t set it to a certain percentage.

Putting in the LUA code luup.variable_set(“urn:upnp-org:serviceId:Dimming1”,“LoadLevelLast”,“50”, diviceID) does not work anywhere I’ve put it. In PLEG or in UI7 scenes. (It used to work with my Vera3)

PLEASE HELP!

Thanks