DoughtCom Posted February 7, 2017 Posted February 7, 2017 Wasn't really sure where to put this (mods can move it wherever), but plex released something called "webhooks" late last week. I decided to spend an hour or so and write a webhook to interface with our ISY944. It's nothing fancy but it allows you to do the following. Capture the 3 main events from Plex: play, pause, stop. Have a set of scenes and devices for each "event group" Each "event group" is assigned to a specific device with a specific plex event, for instance my upstairs Apple TV controls my upstairs lights, my downstairs Apple TV controls the downstairs lights. Since you have an event group assigned to each event, I usually ramp the lights to 60% on pause with a scene and on stop I ramp them to 90% over about 20 seconds. Needed in order to make this function: Understanding of installing node.js A machine to run the node.js code all the time, I use a raspberry pi (1-3 are all fine). Understanding of JSON syntax for the config. I'm usually super busy during the day, but will try to help out however I can. In my testing it works great and it's nice to have these callbacks wired up. Here's the link to my code, there's a video on the top of the github readme page with it in action. https://github.com/DoughtCom/isy944-Plex-Webhook Cheers, Shawn
Michel Kohanim Posted February 8, 2017 Posted February 8, 2017 Hi DoughtCom, This is fantastic! Have you considered using Polyglot (we have Node.JS wrappers for it)? https://github.com/UniversalDevicesInc With kind regards, Michel
nathagt Posted January 9, 2018 Posted January 9, 2018 Hey DoughtCom, I've been trying to get this working on my machine for the last few hours and I'm missing something. I'm running on Windows 7. I've got node.js installed. I wasn't sure if I should put the github code in seperate directory or not??... I've tried putting in the node.js directory as well as in its own. I ran npm install package.json and that seemed to work when it was in a separate directory. I configured my device-config.json but I'm getting an error when I try to run the index.js. I've been using command prompt as an admin. At the end I'm running node.exe c:/dir/index.js I'm getting back this error: Error: Cannot find module 'express' at Function.Module._resolveFilename (module.js:538:15) at Function.Module._load (module.js:468:25) at Module.require (module.js:587:17) at require (internal/module.js:11:18) at Object.<anonymous> (C:\Program Files\nodejs\index.js:1:77) at Module._compile (module.js:643:30) at Object.Module._extensions..js (module.js:654:10) at Module.load (module.js:556:32) at tryModuleLoad (module.js:499:12) at Function.Module._load (module.js:491:3)
beninsteon Posted September 3, 2019 Posted September 3, 2019 @DoughtCom Thanks for writing this. I have enough knowledge to get it running on my pi and working well. I modified the code slightly to change state variables, rather than devices/scenes. This allows triggering of programs and more complex/granular control (i.e. only change lighting if it's dark outside). I'm finding that when the Plex changes to play, pause, or resume there is approximately a 4-5 second delay until the ISY gets the rest command. Interestingly, for stop the change happens immediately. Is this built into your code or an inherent issue with Plex? I reviewed your code in detail and didn't see any reason why the delay should occur on your end. Any suggestions you have would be appreciated. Thanks very much for writing this. With control over state variables I don't see any advantage in converting to a poly. Regards, Ben
beninsteon Posted September 3, 2019 Posted September 3, 2019 On 1/8/2018 at 8:46 PM, nathagt said: I'm getting back this error: Error: Cannot find module 'express' In the folder where this script is, type "npm install" and all the dependencies, including express, will be added. Reply is better a little late than never I hope!
ralbright Posted July 21, 2020 Posted July 21, 2020 I 2nd the polyglot request. This would be awesome as a NodeServer.
Michel Kohanim Posted July 22, 2020 Posted July 22, 2020 Hi everyone, I posted to our slack channel. With kind regards, Michel
ralbright Posted July 22, 2020 Posted July 22, 2020 3 hours ago, Michel Kohanim said: Hi everyone, I posted to our slack channel. With kind regards, Michel What is the link to your slack channel... I cannot seem to find that.
Michel Kohanim Posted July 23, 2020 Posted July 23, 2020 Hi @ralbright, There's no link because it's by invitation only and only for ISY Developers. With kind regards, Michel
ralbright Posted July 24, 2020 Posted July 24, 2020 On 7/23/2020 at 11:37 AM, Michel Kohanim said: Hi @ralbright, There's no link because it's by invitation only and only for ISY Developers. With kind regards, Michel Then why did you link to it here? Curious minds wish to know. Thank you.
Michel Kohanim Posted July 26, 2020 Posted July 26, 2020 @ralbright, Did you actually click on that link and read the contents? Curious minds wish to know With kind regards, Michel
ralbright Posted July 26, 2020 Posted July 26, 2020 12 hours ago, Michel Kohanim said: @ralbright, Did you actually click on that link and read the contents? Curious minds wish to know With kind regards, Michel Ah.... touche' Yes I did read the link. And I do have programming experience, but not a lot. (I manage Linux servers, have programmed in Javascript, HTML, basic, VB and the like before. I can usually read code and figure out what it is trying to do. But the problem is I don't always have a lot of time.) I guess I could apply to be an ISY Developer.
Michel Kohanim Posted July 26, 2020 Posted July 26, 2020 @ralbright, Then you will fit right in ... all you have to do is to learn Python (it's quite easy if you already know other programming languages) and you can start writing your own node servers! With kind regards, Michel
DaveStLou Posted July 26, 2020 Posted July 26, 2020 36 minutes ago, Michel Kohanim said: @ralbright, Then you will fit right in ... all you have to do is to learn Python (it's quite easy if you already know other programming languages) and you can start writing your own node servers! With kind regards, Michel @Michel Kohanim Any suggestions on where to start learning Python? Especially what I need to learn to write node servers?
ralbright Posted July 26, 2020 Posted July 26, 2020 17 minutes ago, DaveStLou said: @Michel Kohanim Any suggestions on where to start learning Python? Especially what I need to learn to write node servers? I would likely say just take another node server and start to break it down. But that is my method... your mileage may vary.
DaveStLou Posted July 26, 2020 Posted July 26, 2020 1 hour ago, ralbright said: I would likely say just take another node server and start to break it down. But that is my method... your mileage may vary. That's the technique I'm using. I'd like to learn best practices too.
Michel Kohanim Posted July 27, 2020 Posted July 27, 2020 @DaveStLou, the best is directly from Python. We also have templates (simple ones) that you can use as baseline. @ralbright, I see that you for joining the Developer program. Good news! Please check your Slack. There's a developer who's interested in helping you with your Plex node server. With kind regards, Michel
bleepblorp Posted August 27, 2020 Posted August 27, 2020 OMG. I just saw the news post about udi-plex-poly. Soooo exciting!! Installed it immediately and of course it just works. Two of my favorite things - ISY994 and my Plex server - connected cleanly and intuitively. I can get rid of my much more kludgy "integrations" for Plex now. Thank you!!!
Recommended Posts
Archived
This topic is now archived and is closed to further replies.