Author Topic: Is it possible to call a PLEG action from luup code?  (Read 580 times)

Offline johnes

  • Hero Member
  • *****
  • Posts: 592
  • Karma: +6/-7
Is it possible to call a PLEG action from luup code?
« on: January 22, 2016, 11:46:13 am »
Is it possible to call a PLEG action from luup code?

Offline RichardTSchaefer

  • Master Member
  • *******
  • Posts: 9368
  • Karma: +704/-129
    • RTS Services Plugins
Re: Is it possible to call a PLEG action from luup code?
« Reply #1 on: January 22, 2016, 01:08:09 pm »
Yep ... you can use luup.call_action

DeviceID:  Device ID of the PLEG device that has the action you want to run.
ServiceID: urn:rts-services-com:serviceId:ProgramLogicC
Action:    RunAction
Argument:   conditionName

 

Offline johnes

  • Hero Member
  • *****
  • Posts: 592
  • Karma: +6/-7
Re: Is it possible to call a PLEG action from luup code?
« Reply #2 on: January 22, 2016, 03:37:45 pm »
Awesome...  thanks! 

Searched for a bit today and couldn't find this...

Offline RichardTSchaefer

  • Master Member
  • *******
  • Posts: 9368
  • Karma: +704/-129
    • RTS Services Plugins
Re: Is it possible to call a PLEG action from luup code?
« Reply #3 on: January 23, 2016, 10:05:29 am »
There are ALL kinds of "Features"  that devices on you Vera support that are not advertised as "Features" on a UI.

You find these by looking the at the "ACTIONS" a device supports. You find these from:
1) The Vera Scene Editor "Advanced Editor"
     Select a device ... and inspect the Actions it supports.
2)  Go to the PLEG/PLTS   Actions Editor, Also in Advanced mode.
     Select a device ... and inspect the Actions it supports.
 
All of these actions can be call from LUA code.

Offline Tlex

  • Sr. Newbie
  • *
  • Posts: 34
  • Karma: +0/-0
Re: Is it possible to call a PLEG action from luup code?
« Reply #4 on: March 17, 2017, 07:51:15 am »
Hi Richard,

Trying to make it work but I think I have issues with the syntax.... Can you tell me what is wrong with it ?

luup.call_action('urn:rts-services-com:serviceId:ProgramLogicC','LogicAction Name?', '??' ,'DeviceID')

Does RunAction is the actual "Logic Action name" from the pleg editor ?

I know this sounds really  a basic question... thats were am I :)

Thanks !

Offline RichardTSchaefer

  • Master Member
  • *******
  • Posts: 9368
  • Karma: +704/-129
    • RTS Services Plugins

Offline Tlex

  • Sr. Newbie
  • *
  • Posts: 34
  • Karma: +0/-0
Re: Is it possible to call a PLEG action from luup code?
« Reply #6 on: March 19, 2017, 06:40:17 pm »
:) looping :) wrong link ?