News:

Would you like to say "Thanks!" for extra support or new features that we provided? Donations are gratefully accepted.

Main Menu

Passing parameters to events

Started by shanekuz, September 21, 2015, 12:59:48 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

shanekuz

Can anyone help me with this please?  I am calling a URL on to Voxcommander like this :

http://192.168.31.180:80/api/VC.TriggerEvent&&FAMILYLIGHTSON&&${intensity.percent}

to turn on my lights.

I can see in the logs that the percent is being passed into the Voxcommado web service but im not sure how to grab the 50 thats being passed in the ${intensity.percent} and use that as a variable in my commands that voxcommando is going to run.

Any tips would be great.

PegLegTV

with what you shared we cant tell what that variables output looks like (${intensity.percent})
if you can post the exact text that is passed in payload 1 then we could help find the right solution or the right regex pattern to get just the percent number.

or if payload 1 is already just a number and your are trying to use payload 1 in some way then we will need more details on what your goal is, you can use payloads by using {1} = Payload 1, {2} = Payload 2, {3} = Payload 3....

nime5ter

As PegLegTv notes, the VC.TriggerEvent action accepts payload values as optional parameters.

i.e., if you look up the action description for VC.TriggerEvent--either directly in VC or on the wiki--it provides information on what values are expected for the parameters:

http://voxcommando.com/mediawiki/index.php?title=Actions#TriggerEvent

QuoteVC.TriggerEvent
Triggers any commands that contain "Event"

Add as many extra parameters as you like, they will be treated as payloads.

Parameters: 1+
Event : Name of event to trigger [string]
Payload1 : optional payload [string]
Payload2 : optional payload [string]
Payload3 : optional payload [string]

http://voxcommando.com/mediawiki/index.php?title=Payloads
TIPS: POST VC VERSION #. Explain what you want VC to do. Say what you've tried & what happened, or post a video demo. Attach VC log. Link to instructions followed.  Post your command (xml)

shanekuz

Thank you for your help, the request comes though looking like
http://192.168.31.180:80/api/VC.TriggerEvent&&FAMILYLIGHTSON&&50  and I have tried using the {1} but this comes though empty which was why I asked the question as I'm clearly doing it wrong.

Shane

PegLegTV

if payload 1 is showing as just digits then there is no need for regex,  :)

when you hover over the event in the history window what shows up in the little popup window?

QuoteI have tried using the {1} but this comes though empty

what have you tried, that lets you see that {1} is empty?

shanekuz

Thanks so much for your help i have realized i was using {P1} not {1} and now its working fine.