I receive events like: PioneerEthernet.Received.Power.State '0'
How can I use this as an event to trigger an action? Dragging and dropping only drops "PioneerEthernet.Received.Power.State" without the '0' How should I use the full event with the '0' ?
Ok read that this has to do with the payload.
What would bet the syntax for this : eg.TriggerEvent(eg.event.payload ??, prefix = eg.event.suffix)
Notice: This forum has been recovered from an old backup, so some content, links, and dates may be outdated. The forum is currently read-only while we restore sign-in and registration functionality. Details
If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.
If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.
How to use events that contain spaces.
-
krambriw
- Plugin Developer
- Posts: 2570
- Joined: Sat Jun 30, 2007 2:51 pm
- Location: Stockholm, Sweden
- Contact:
Re: How to use events that contain spaces.
You have to create a macro where you typically would place also a python script. A very simple one is this:
This script, when triggered, will capture the payload in the variable pl and then simply print it. Obviously you would do some more with the captured data but it gives you an idea.
To trigger the macro and the script, you can just drag & drop your event "PioneerEthernet.Received.Power.State" to the same macro. Next time the event happens, the macro will be triggered, the script executed and the value of the variable printed in the log.
BestR
Walter
Code: Select all
pl = eg.event.payload
print pl
To trigger the macro and the script, you can just drag & drop your event "PioneerEthernet.Received.Power.State" to the same macro. Next time the event happens, the macro will be triggered, the script executed and the value of the variable printed in the log.
BestR
Walter
My released plugins
https://drive.google.com/drive/folders/ ... y01eVBKeHM
https://drive.google.com/drive/folders/ ... y01eVBKeHM
-
DarkCinema
- Posts: 25
- Joined: Wed Sep 26, 2012 10:46 pm
Re: How to use events that contain spaces.
Thanks Walter,
I found out that whan using the following script, it will create an event with the first 10 characters:
"eg.TriggerEvent(eg.event.payload[0:10], prefix = eg.event.suffix)"
So I am using this to detect the current AUDIO type on my receiver:
With the above script his event: "PioneerEthernet.Received.AST.Signal 'PCM'"will crate a new event: "Received.AST.Signal.PCM" that I can use to trigger my lights.
Do you know how to program a new event when the outcome of "PioneerEthernet.Received.AST.Signal 'PCM'" is anythinbg else than PCM ?
I found out that whan using the following script, it will create an event with the first 10 characters:
"eg.TriggerEvent(eg.event.payload[0:10], prefix = eg.event.suffix)"
So I am using this to detect the current AUDIO type on my receiver:
With the above script his event: "PioneerEthernet.Received.AST.Signal 'PCM'"will crate a new event: "Received.AST.Signal.PCM" that I can use to trigger my lights.
Do you know how to program a new event when the outcome of "PioneerEthernet.Received.AST.Signal 'PCM'" is anythinbg else than PCM ?
Re: How to use events that contain spaces.
Use the other Pioneer plug-in that sem;colon already pointed you to in another thread and see the end of the thread for info on the payload.
-
DarkCinema
- Posts: 25
- Joined: Wed Sep 26, 2012 10:46 pm
Re: How to use events that contain spaces.
Thx.kkl wrote:Use the other Pioneer plug-in that sem;colon already pointed you to in another thread and see the end of the thread for info on the payload.