JGWNet 1 Posted January 27, 2022 Share Posted January 27, 2022 Webhooks works great using Sequematic and IFTTT together with Alexa triggers, but it needs to be able to work with Cinema Intros as well. Currently the lights go off and back on after every trailer and bumper that plays. If the variable "RunTimeTicks" is added to the JSON POST request, then in Sequematic I can add a "check variable value" to identify if the movie is less than 5 mins. Less than 5 mins would help indicate that this movie is a trailer or bumper video. With that I can tell Sequematic to stop the sequence if the movie is less than 5 mins. I think this would be a solve all for anyone struggling with getting the perfect cinema experience. Link to comment Share on other sites More sharing options...
BillOatman 502 Posted January 27, 2022 Share Posted January 27, 2022 (edited) 47 minutes ago, JGWNet said: Webhooks works great using Sequematic and IFTTT together with Alexa triggers, but it needs to be able to work with Cinema Intros as well. Currently the lights go off and back on after every trailer and bumper that plays. If the variable "RunTimeTicks" is added to the JSON POST request, then in Sequematic I can add a "check variable value" to identify if the movie is less than 5 mins. Less than 5 mins would help indicate that this movie is a trailer or bumper video. With that I can tell Sequematic to stop the sequence if the movie is less than 5 mins. I think this would be a solve all for anyone struggling with getting the perfect cinema experience. Or better still, a indication of if whats being played is a bumper or a feature. That way you wouldn't need to rely on time. Edited January 27, 2022 by BillOatman Link to comment Share on other sites More sharing options...
Luke 37191 Posted January 28, 2022 Share Posted January 28, 2022 You do get the RunTimeTicks of the movie that follows, right? Link to comment Share on other sites More sharing options...
JGWNet 1 Posted January 28, 2022 Author Share Posted January 28, 2022 In the Sequematic service, I see all the data in the logs, which includes "RunTimeTicks". When I try to set a check variable for that value, It does not seem to read it. Link to comment Share on other sites More sharing options...
Luke 37191 Posted January 28, 2022 Share Posted January 28, 2022 What do you mean by set a check variable? Link to comment Share on other sites More sharing options...
JGWNet 1 Posted January 28, 2022 Author Share Posted January 28, 2022 If you are familiar with Sequematic, you can set a query based on a variable value "If, Then, Else". I attached a snip as an example. The variable {RunTimeTicks} does not capture like {Events}. The value in {Events} triggers an IFTTT response based on playback.stop or playback.start, which works great. I want to be able to abort the sequence if the value of {RunTimeTicks} is less than 10min or 6000000000milliseconds. Unfortunately this does not work. Here is the sequence log which shows that the check against {RunTimeTicks} passed, but it is not under the values displayed in the actual data payload. Here is the payload file.... Link to comment Share on other sites More sharing options...
ebr 14949 Posted January 29, 2022 Share Posted January 29, 2022 Hi. It looks like it did work but maybe the precision is off by one factor...? Link to comment Share on other sites More sharing options...
BillOatman 502 Posted January 29, 2022 Share Posted January 29, 2022 (edited) 23 minutes ago, ebr said: Hi. It looks like it did work but maybe the precision is off by one factor...? Agreed . The unit of measure is ticks, not milliseconds. public const long TicksPerSecond = 10000000; ticks = seconds * TicksPerSecond Ticks per minute 600,000,000 Edited January 29, 2022 by BillOatman Link to comment Share on other sites More sharing options...
JGWNet 1 Posted January 29, 2022 Author Share Posted January 29, 2022 The funny part is that I can put anything into that variable, for example; {ThisVariableDoesNotWork} below '6000000000' and it gives me the same result. I looked at the coding in "Emby.Webhooks.dll" and it appears that only (playback.stop, playback.start, playback.pause, playback.unpause, and playback.scrobble) are the only variables that are past through to Sequematic. Maybe it has something to do with what Sequematic listens for? Link to comment Share on other sites More sharing options...
BillOatman 502 Posted January 29, 2022 Share Posted January 29, 2022 (edited) Based on the json payload you pasted above it sure looks to me like the Emby webhook is behaving properly. I assume you looked here. Particularly : Quote When processing, the JSON is flattened and the parent keys are joined together using a hyphen. Considering the example JSON below: { "Student": { "FirstName":"Harry", "Surname":"Potter" }, "School":"Hogwarts", "House":"Gryffindor" } You can access the student's last name in your sequence using {Student-Surname}. Looks like a pretty cool way to easily use the Emby webhooks. Particularly since it will hook right into IFTTT. So your flow is: Emby Server => Sequematic => IFTTT => light bulb in your house Edited January 29, 2022 by BillOatman 1 Link to comment Share on other sites More sharing options...
JGWNet 1 Posted January 29, 2022 Author Share Posted January 29, 2022 Sometimes I just need a little nudge to go down the right path. This looks promising for sure. I will test it and let you all know what the end result is. Thanks! Link to comment Share on other sites More sharing options...
JGWNet 1 Posted January 29, 2022 Author Share Posted January 29, 2022 Folks, we have a WINNER!!! Turns out that I just needed to format the variable name correctly. The correct format is {Item-RunTimeTicks}. I was able to identify this with reading the link BillOatman sent me. Thank you so much!!! So I kept the Sequematic settings on Schema 3 and just altered the variable to the correct setting, and voila, the lights stay off during the trailers and bumpers! They come back on when stopping or pausing the main movie only! Attached is the sucessful log.... This was when I stopped the main movie. Link to comment Share on other sites More sharing options...
Luke 37191 Posted January 29, 2022 Share Posted January 29, 2022 Thanks for the feedback ! Link to comment Share on other sites More sharing options...
BillOatman 502 Posted January 29, 2022 Share Posted January 29, 2022 4 hours ago, JGWNet said: Folks, we have a WINNER!!! Turns out that I just needed to format the variable name correctly. The correct format is {Item-RunTimeTicks}. I was able to identify this with reading the link BillOatman sent me. Thank you so much!!! So I kept the Sequematic settings on Schema 3 and just altered the variable to the correct setting, and voila, the lights stay off during the trailers and bumpers! They come back on when stopping or pausing the main movie only! Attached is the sucessful log.... This was when I stopped the main movie. Can you post your custom Sequematic webhook minus your IFTTT link It might help others Link to comment Share on other sites More sharing options...
JGWNet 1 Posted January 31, 2022 Author Share Posted January 31, 2022 This tutorial is for Home automation with the Emby Webhooks plugin using Sequematic.com custom sequence and IFTTT.com applets communicating directly to Amazon Alexa app. This works with Cinema Intros and Vantage Point plugins to prevent your lights from turning on after trailers or bumpers. 1. Register for a free account with Sequematic.com and IFTTT.com. (If you do not have an Alexa account setup yet, you will need to do that as well) 2. Sign into your Alexa app and go to (More>Skills & Games). Select the search spyglass and type IFTTT. (enable this skill with IFTTT credentials) 3. After the skill is enabled, you will be asked to search for new devises from that skill. (Make sure you select this) It will find devises IFTTTrigger-1 through 3 and add them to your devise list. 4. Log into your new IFTTT.com account and select "Create". 5. Select "If This" and add your criteria. Do a search for "Webhooks" and add it. 6. Select "Receive a web request". 7. Enter a name for your event. (Remember that this will be the same name use to call the event from Sequematic.com later) 8. After you complete this step, now select "Then That" and enter your criteria. (You will be selecting "Alexa Action by mkZense") Here you will able to link it to your Amazon account. 9. Select "sendAlexaActionbyMKzense" 10. Select the trigger you want to assign it to. 11. When finished select "Continue" and then "Finish". You have successfully setup your first trigger. These triggers can be used in your Alexa app you create "Routines". Please refer to the Alexa app help to receive information on how to create routines, for I will not cover this in the tutorial. 12. In IFTTT.com, Select you account icon>My Services>Webhooks>Documentation. There you will find your confidential key. Copy and save this. You will need it for later when you set up your Sequematic.com account. 13. Log into Sequematic.com, select "Setting" and paste your IFTTT confidential key into the IFTTT key box, select your time zone and select save. 14. Now it is time to create your sequence. Go back to the dashboard and select, new sequence and give it a name. 15. Select "add step" and "Custom webhook" 16. Be sure to select "Schema 3", or none of this will work. 17. Select "Save". After you hit save, Sequematic will generate an https link that you will cut and past into your Webhooks plugin in Emby. 18. Continue to create your sequence by now selecting "Add step", now you will choose "Variables" > "Check variable values". 19. This first variable you want to check is "playback.start". You will use one of your ITFFF triggers for this process. The finished product should look like this... 20. Now select "Add step" under the previous and choose Webhook>"Call IFTTT". If you save your IFTTT key it should automatically populate. 21. The IFTTT Event name will be the name of the event you saved within IFTTT.com service. "Save and continue to the next step". 22. From here you will continue to create additional steps to complete the sequence by imputing the data into the "Else" fields. 23. It is important to have the {Item-RunTimeTicks} variable checked after the {Event} playback.start variable, or this will not work correctly. After that you can create a variable check for playback.stop, playback.pause, playback.unpause, and playback.scrobble. Below is the entire sequence for my setup. This configuration works with "Cinema Intros" as well as "Vantage Point" plugins for a real cinematic experience. Finally - It is important to make sure that your variable name is imputed in the following fashion.... {Event} - This is for checking the playback status {Item-RunTimeTicks} - If set to "below 6000000000" it will check to see if the video is less than 10 minutes. Enjoy!!! 1 Link to comment Share on other sites More sharing options...
BillOatman 502 Posted January 31, 2022 Share Posted January 31, 2022 @JGWNetWow, very detailed, thank you!. So Alexa is in the mix too. Previously I had this as the flow Quote Emby Server => Sequematic => IFTTT => light bulb in your house When in reality it's Quote Emby Server => Sequematic => IFTTT => Alexa => light bulb in your house Do you need the Alexa and IFTTT pieces? Sequematic claims to support Philips Hue directly. Unless you are using something other than Hue? Though getting Alexa to announce "The feature film is about to begin, please silence all electronic devices" on the playback start event would be fun. That would really irritate my wife and kids Link to comment Share on other sites More sharing options...
JGWNet 1 Posted January 31, 2022 Author Share Posted January 31, 2022 1 hour ago, BillOatman said: @JGWNetWow, very detailed, thank you!. So Alexa is in the mix too. Previously I had this as the flow When in reality it's Do you need the Alexa and IFTTT pieces? Sequematic claims to support Philips Hue directly. Unless you are using something other than Hue? Though getting Alexa to announce "The feature film is about to begin, please silence all electronic devices" on the playback start event would be fun. That would really irritate my wife and kids This can be setup on almost anything that will take a IFTTT trigger, but under your situation you can bypass and go direct to Phillips Hue. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now