Property variable needed in LUA action code

Property variable needed in LUA action code
I need to access plg properties in Action LUA code - what is the syntax?
Other PLG variables available to action LUA code?
Does anyone have a specific example of the following?
For each input Variable name or Condition name xxx you have access to it from LUA as


Where XXX is the uppercase of the input or condion name. And XXX.state is the value, XXX.seq is the On timestamp and XXX.oseq is the Off timestamp, and XXX.seqh is a history of the last N on timestamps (max of 10, not saved across restarts, only the most recent one is) XXX.seq should always equal XXX.seqh[1]. The seqh is currently only used internally for the Multi-Trigger checks.
The LUA context is unique for each Plugin. You can share global variables between Actions, but not between PLEG/PLTS devices or Vera Scenes.

So you can use the “Exports” options on Conditions to make the value of those conditions available outside of that PLEG. I use this in a few places to send values between PLEGs. Once it is set as an export, you can pull the value into another PLEG via an input property. I have not referenced via LUA, but it would be the service ID urn:rts-services-com:serviceId:User plus the name you gave the exported condition.

I don’t think you can reference the timestamps, but the value of the condition is doable. Sorry I don’t have a LUA example…

Best Home Automation shopping experience. Shop at getvera!

© 2021 Ezlo Innovation, All Rights Reserved. Terms of Use | Privacy Policy | Forum Rules