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: