Author Topic: How do I configure Advanced Device Features through PLEG?  (Read 311 times)

Online tamorgen

  • Full Member
  • ***
  • Posts: 117
  • Karma: +1/-0
How do I configure Advanced Device Features through PLEG?
« on: December 28, 2018, 08:05:46 am »
Good morning,
I'm trying to figure out how to change advanced configuration settings of my switches and outlets through PLEG.  I've got all the conditions and triggers set up, but I don't see the configuration items I'd like to change.

What I'm trying to do, is when the house modes plugin changes state to Night, I want to turn off the blue light on my bedroom GE Jasco switches and outlets, so it doesn't keep us from getting to sleep.  One of the outlets is right in the line of sight of my wife, and she complains about it rather constantly.  I'd like to keep the blue LED on during the day and such, but I'm don't want them on when we're sleeping.

Another advanced function I'd like to perform is controlling the dim rate of a light when it's turned on automatically, so it's not so jarring.

I've found this page with the variables that need to be changed, but nothing seems to match up on the logic actions page.

https://www.ezzwave.com/advanced-operation/

Thanks for any advice you can provide.
« Last Edit: January 03, 2019, 08:04:43 am by tamorgen »

Online tamorgen

  • Full Member
  • ***
  • Posts: 117
  • Karma: +1/-0
Re: How do I configure Advanced Device Features through PLEG?
« Reply #1 on: December 29, 2018, 10:04:26 am »
I thought I figured it out, but it doesn't seem to work.  I found the PutByte action under Logic Actions.  The conditions are being met (off of a schedule), but the LEDs are remaining on.  I've attached the status report from my fidgeting this morning.

The items pertaining to this are:

sStatusLEDOn   Day of Week   06:00:00   1,2,3,4,5,6,7   None   Day of Week   22:00:00   1,2,3,4,5,6,7   None

cStatusLEDOn      sStatusLEDOn   false   0   0
cStatusLEDOff      ! sStatusLEDOn   true   2018-12-29 09:42:38.677   0

Action: cStatusLEDOn
MB Floor Jen[203]   PutByte   StartAddress=3 StopAddress=3 Value=0
MB Floor Tim[190]   PutByte   StartAddress=3 StopAddress=3 Value=0
MB Fan Light[191]   PutByte   StartAddress=3 StopAddress=3 Value=0
Master Bed Fan[192]   PutByte   StartAddress=3 StopAddress=3 Value=0

Action: cStatusLEDOff
MB Floor Tim[190]   PutByte   StartAddress=3 StopAddress=3 Value=2
MB Fan Light[191]   PutByte   StartAddress=3 StopAddress=3 Value=2
Master Bed Fan[192]   PutByte   StartAddress=3 StopAddress=3 Value=2
MB Floor Jen[203]   PutByte   StartAddress=3 StopAddress=3 Value=2

Online tamorgen

  • Full Member
  • ***
  • Posts: 117
  • Karma: +1/-0
Re: How do I configure Advanced Device Features through PLEG?
« Reply #2 on: January 02, 2019, 03:57:24 pm »
Still no progress.  I thought I might have to send a Reconfigure command after setting the parameter, but that isn't doing anything either.  Anybody have experience with this?  Would Luup be better for this?

Online tamorgen

  • Full Member
  • ***
  • Posts: 117
  • Karma: +1/-0
Re: How do I configure Advanced Device Features through PLEG?
« Reply #3 on: January 03, 2019, 08:04:10 am »
Some progress last night.  I tried using Luup from Apps --> Develop Apps --> Test Luup code (Lua), and entered a series of commands to turn the LED on and off, and it worked pretty much right away, as far as I can tell.  Took 10 or 15 seconds to get from my computer to my bedroom to check, so I can't say if it was instantaneous or not, but it was good enough for the purposes I needed.

To turn the LEDs off:
Code: [Select]
luup.call_action('urn:micasaverde-com:serviceId:ZWaveNetwork1','SendData',{Node='48',Data='112 4 3 1 2'},1)
luup.call_action('urn:micasaverde-com:serviceId:ZWaveNetwork1','SendData',{Node='49',Data='112 4 3 1 2'},1)
luup.call_action('urn:micasaverde-com:serviceId:ZWaveNetwork1','SendData',{Node='50',Data='112 4 3 1 2'},1)
luup.call_action('urn:micasaverde-com:serviceId:ZWaveNetwork1','SendData',{Node='56',Data='112 4 3 1 2'},1)

To Turn the LEDs back on:
Code: [Select]
luup.call_action('urn:micasaverde-com:serviceId:ZWaveNetwork1','SendData',{Node='48',Data='112 4 3 1 0'},1)
luup.call_action('urn:micasaverde-com:serviceId:ZWaveNetwork1','SendData',{Node='49',Data='112 4 3 1 0'},1)
luup.call_action('urn:micasaverde-com:serviceId:ZWaveNetwork1','SendData',{Node='50',Data='112 4 3 1 0'},1)
luup.call_action('urn:micasaverde-com:serviceId:ZWaveNetwork1','SendData',{Node='56',Data='112 4 3 1 0'},1)

I used a PLEG schedule to activate this code, and it didn't seem to work.  Any idea why it wouldn't work from PLEG, but would work from Apps?

Action: cStatusLEDOn
LUA:
luup.call_action('urn:micasaverde-com:serviceId:ZWaveNetwork1','SendData',{Node='48',Data='112 4 3 1 0'},1)
luup.call_action('urn:micasaverde-com:serviceId:ZWaveNetwork1','SendData',{Node='49',Data='112 4 3 1 0'},1)
luup.call_action('urn:micasaverde-com:serviceId:ZWaveNetwork1','SendData',{Node='50',Data='112 4 3 1 0'},1)
luup.call_action('urn:micasaverde-com:serviceId:ZWaveNetwork1','SendData',{Node='56',Data='112 4 3 1 0'},1)

Action: cStatusLEDOff
LUA:
luup.call_action('urn:micasaverde-com:serviceId:ZWaveNetwork1','SendData',{Node='48',Data='112 4 3 1 2'},1)
luup.call_action('urn:micasaverde-com:serviceId:ZWaveNetwork1','SendData',{Node='49',Data='112 4 3 1 2'},1)
luup.call_action('urn:micasaverde-com:serviceId:ZWaveNetwork1','SendData',{Node='50',Data='112 4 3 1 2'},1)
luup.call_action('urn:micasaverde-com:serviceId:ZWaveNetwork1','SendData',{Node='56',Data='112 4 3 1 2'},1)

I've attached my latest status report.  Any help would be greatly appreciated.

Offline Joenoo

  • Jr. Member
  • **
  • Posts: 63
  • Karma: +2/-0
Re: How do I configure Advanced Device Features through PLEG?
« Reply #4 on: January 03, 2019, 08:47:21 am »
I don't have any experience with this, but what happens if you run the action manually by pressing the button 'run' in the tab 'Logic Actions' in PLEG? Does the action execute or not?
VeraPlus, Vera3, RfxcomE, 4X Greenwave NP310-f, 4x Philips Hue, 3x Aeotec ZW089, 3x ZME WallC-S, 2x ZME 05461, 2x Milight, 3x Fibaro Dimmer 2, 1x Vison ZP3102, 4x Sensative Strip. Mobile: Tasker, AutoVera, Autonotification, Autotools, Autolocation, Homewave.
Vera user since: 2014

Online tamorgen

  • Full Member
  • ***
  • Posts: 117
  • Karma: +1/-0
Re: How do I configure Advanced Device Features through PLEG?
« Reply #5 on: January 03, 2019, 09:10:33 am »
I need to double check, but I don't believe it did.  I was trying a bunch of different things last night, and I'm pretty sure I tried that.  I believe I found another thread a while back saying that Luup commands run the through PLEG for device parameters wasn't working for them either.  I need to track that thread down and see if there was a resolution to it.

My next step is to try and just run the code through a normal Vera scene since it's just a simple schedule I want to run.  I'm trying to move away from the scenes and do more things through PLEG, but I may need to apply the KISS principle here to make it work, since I know the code works through the App developer tools.

Offline wilme2

  • Hero Member
  • *****
  • Posts: 1262
  • Karma: +32/-13
Re: How do I configure Advanced Device Features through PLEG?
« Reply #6 on: January 03, 2019, 03:00:25 pm »
Another advanced function I'd like to perform is controlling the dim rate of a light when it's turned on automatically, so it's not so jarring.

See post below.

http://forum.micasaverde.com/index.php/topic,50391.0.html
Long Live UI5!  (OK finally made the switch to UI7 in January 2018, and am pretty happy....)

Online tamorgen

  • Full Member
  • ***
  • Posts: 117
  • Karma: +1/-0
Re: How do I configure Advanced Device Features through PLEG?
« Reply #7 on: January 03, 2019, 05:00:13 pm »
Another advanced function I'd like to perform is controlling the dim rate of a light when it's turned on automatically, so it's not so jarring.

See post below.

http://forum.micasaverde.com/index.php/topic,50391.0.html

Excellent, thanks!  I'll give that a shot!

Online tamorgen

  • Full Member
  • ***
  • Posts: 117
  • Karma: +1/-0
Re: How do I configure Advanced Device Features through PLEG?
« Reply #8 on: January 03, 2019, 05:08:49 pm »
I don't have any experience with this, but what happens if you run the action manually by pressing the button 'run' in the tab 'Logic Actions' in PLEG? Does the action execute or not?

So, I have some results, and I'll have to wait until this evening for it to automatically do it's thing to be sure, but I believe I fixed the issue.

1)  The LUUP commands worked running from a Scene....well, 3 out of 4 devices.  The 4th device, is a GE 14287 smart fan switch".  It's actually one of their newer switches, however, according to this thread, the LED isn't configurable from parameters, but only physically from the device.  Looks like that road has been gone down before.  Although there is some suggestion that it might be configurable with a custom xml file (don't want to go there).

2)  Deleting that node from the PLEG Luup entry, the "run" button did change the status of the LEDs.  It's likely there was an error on the code execution (need to learn to how to look at log entries on this thing).

Online tamorgen

  • Full Member
  • ***
  • Posts: 117
  • Karma: +1/-0
Re: How do I configure Advanced Device Features through PLEG?
« Reply #9 on: January 03, 2019, 06:58:27 pm »
Another advanced function I'd like to perform is controlling the dim rate of a light when it's turned on automatically, so it's not so jarring.

See post below.

http://forum.micasaverde.com/index.php/topic,50391.0.html

Excellent, thanks!  I'll give that a shot!

So, the linked thread talks about setting the load level, but not really about ramping it over a period of time.  That is the actually the device I have in my living room by hapenstance, but what I need to do is ramp it up slowly over 45 seconds or a minute, something like that.  I'd probably want to ramp it up to 60%, 5 or 10 percent at a time.  My thought is initially turn it on to 20%, then at 10 second intervals, bring it up another 10%..  I'm pretty sure I'll need to use counters and timers for this; just not sure how.

Offline Don Phillips

  • Hero Member
  • *****
  • Posts: 1442
  • Karma: +39/-36
Re: How do I configure Advanced Device Features through PLEG?
« Reply #10 on: January 03, 2019, 07:46:05 pm »
For ramping up a light, you can run multiple device commands in a single action in PLEG on a delay.  For my wake up action, I run 6, 10 second ramps going from 5% to 100%, so my 2 nightstand lamps slowly ramps up. Better than an alarm clock (which sounds 1 min later as a backup to a Vera restart).
Vera 3, 1.7.1030, CT101, Everspring motion sensor, GE/Jasco switch, Leviton outlet, AeonLabs sensor, NuTone garage door, Blue Iris, Sricam SP011, iPhone locator, APCUPSD, VeraMate, VeraAlerts, PLEG, House Modes, Countdown Timer, DVR, Virtual/Multi Switch, Weatherunderground, LB60Z-1 bulb, Hue, Alexa

Offline wilme2

  • Hero Member
  • *****
  • Posts: 1262
  • Karma: +32/-13
Re: How do I configure Advanced Device Features through PLEG?
« Reply #11 on: January 04, 2019, 11:18:16 am »
So, the linked thread talks about setting the load level, but not really about ramping it over a period of time.  That is the actually the device I have in my living room by hapenstance, but what I need to do is ramp it up slowly over 45 seconds or a minute, something like that.  I'd probably want to ramp it up to 60%, 5 or 10 percent at a time.  My thought is initially turn it on to 20%, then at 10 second intervals, bring it up another 10%..  I'm pretty sure I'll need to use counters and timers for this; just not sure how.

No, that thread, as well as the link you posted talked about setting parameter 7 and 8 to time how long a DIM command takes to ramp...  The thread is really us talking about the settings are somewhat counter-intuitive.  And you may need to set the undocumented parameter 6 in some of the newer z-wave plus GE/Jasco switches.  From https://www.ezzwave.com/advanced-operation/


Code: [Select]
Dim Rate Adjustments
Both the number of steps (or levels) that the dimmer will change and the timing of the steps can be modified to suit personal preferences. The timing of the steps can be adjusted in 10 millisecond intervals. As an example, the default setting for parameter 8 is ?3?. This means that the lighting level will change every 30 milliseconds when the Dim Command is received. A value of 255 would mean that the level would change every 2.55 seconds. Combined, the two parameters allow dim rate adjustments from 10 milliseconds to 4.2 minutes to go from maximum-to-minimum or minimum-to-maximum brightness levels.
1. When Receiving a Z-Wave Dim Command

Parameter 7 (number of steps or levels)
Parameter 8 (timing of the steps)
Length: 1 Byte
Valid Values:
Parameter 7 (default = 1) Valid Values: 1-99
Parameter 8 (default = 3) Valid Values: 1-255
« Last Edit: January 04, 2019, 11:20:10 am by wilme2 »
Long Live UI5!  (OK finally made the switch to UI7 in January 2018, and am pretty happy....)

Offline Vinx

  • Sr. Newbie
  • *
  • Posts: 43
  • Karma: +2/-0
Re: How do I configure Advanced Device Features through PLEG?
« Reply #12 on: January 05, 2019, 03:08:34 am »
I do something similar with my Fibaro switches. I have the LUUP code in a scene and run the scene from PLEG. I find it better to keep all and only the logic in PLEG and see this as a "programmed plugin". Separating like this makes testing a lot easier too. Good luck!

Sent from my SM-G960F using Tapatalk