Plex Webhooks and Webcore


#5

Try logging the contents of $args.Player.local


#6

only started playing with this today. How do you log something?


#7

Put {$args.Player.local} in the Message field.


#8

do you need to “store it in messages”?


#9

Not necessary for debugging.


#10

ok…now what? It still doesn’t work with my if statement.


#11

What was the output of the log command?


#12

+251ms ║║Executed virtual command log (1ms)

Nothing else new showed up.


#13

This guy was working on a plex one, though its a bit more complicated than what I want to do.


#14

How are you triggering the piston?


#15

A link that plex uses everytime some event happens.


#16

Let’s see the link, remove any private keys/tokens…


#17

https://graph-na02-useast1.api.smartthings.com/api/token****/smartapps/installations//execute/:


#18

What’s output of logging {$args.payload.Player.local}


#19

Can you share the piston thats being triggered?


#20
+1ms ╔Received event [Home].execute = with a delay of 1225ms
+1125ms ║RunTime Analysis CS > 1020ms > PS > 57ms > PE > 48ms > CE
+1128ms ║Runtime (37037 bytes) successfully initialized in 57ms (v0.3.10b.20190514) (1124ms)
+1129ms ║╔Execution stage started
+1137ms ║║Condition group #1 evaluated true (state did not change) (1ms)
+1140ms ║║Condition group #7 evaluated true (state did not change) (1ms)
+1143ms ║║Cancelling statement #8’s schedules…
+1161ms ║║Executed virtual command log (2ms)
+1165ms ║║Condition group #10 evaluated true (state did not change) (1ms)
+1176ms ║╚Execution stage complete. (47ms)
+1177ms ╚Event processed successfully (1177ms)

#21

And what about $args by itself?


#22

the most promising yet [:]


#23

So you’re really not getting anything from plex it looks like. You should have gotten the whole thing you pasted up top. I have Plex but I don’t sub to the premium so I can’t play :confused:


#24

I’ve been looking into this, and managed to get it working for some requests. The attached piston correctly displays info received from Plex, I’ve not done anything with it yet. I’ve attached the ‘red’ version so you can see the values correctly set from a media.stop event.

As mentioned in the referenced post, there is an issue when plex includes the jpeg image, this is added when a media add, or play event is sent. I’ve raised an enhancement request with Plex, to optionally not send the jpeg when the webhook is called. If you can vote for it, it may get implmented.