pastro50 Posted January 28, 2018 Posted January 28, 2018 I'd like to be able to setup a network resource that I can control with Alexa that allows a programmable value to be sent out to an IP address which I have a raspberry pi connected to. For example I 'd like to be able to set the channel to a value and then send out a network post that would include the channel number fo the raspberry PI to interpret and change the channel (I have an IR tx on the PI) ideally something like alexa set channel to 175 and have the 175 go along with a network resource that communicates with the PI. So what I'm hoping so one can say is how to set up a network resource to do this and how it would be called from the A/V section of the portal. I thought I might have to set a variable and then use that to send out to a network resource but I don't see how that can be done from the ISY. I am on v 4.5.4 if that matters. Quote
larryllix Posted January 28, 2018 Posted January 28, 2018 Why do you want to talk too a RPi for this? You can control most A/V receivers directly from NRs. I wrote python3 code to receive GET requests on my RPi from NRs that I have posted in another thread somewhere. Quote
pastro50 Posted January 28, 2018 Author Posted January 28, 2018 The devices I have don't have network connectivity. The Pi bridges the gap. The AV device on the portal would seem to do what I want but I don't see how you can include a value in the payload. Quote
bmercier Posted January 28, 2018 Posted January 28, 2018 The devices I have don't have network connectivity. The Pi bridges the gap. The AV device on the portal would seem to do what I want but I don't see how you can include a value in the payload. You can't include a value in the payload. BUT, for things like volume or channel, you can set a state variable to the spoken value. Then, it's a matter of having a program react to that state var and trigger a network resources. You can embed a state variable in the network resource payload. This post could help you get started with variable substitution in network resources: https://forum.universal-devices.com/topic/23212-setting-up-directtv-control-with-alexa-using-network-resources/?hl=%2Bvariable+%2Bsubstitution+%2Bnetwork+%2Bresources Benoit Quote
larryllix Posted January 29, 2018 Posted January 29, 2018 The devices I have don't have network connectivity. The Pi bridges the gap. The AV device on the portal would seem to do what I want but I don't see how you can include a value in the payload. No network connectivity? Will you use iR to control them? Sent from my SGH-I257M using Tapatalk Quote
giesen Posted January 29, 2018 Posted January 29, 2018 Would not a harmony hub and associated node server be better (and more reliable) than this Rube Goldberg contraption... Sent from my SM-N9500 using Tapatalk 1 Quote
pastro50 Posted January 29, 2018 Author Posted January 29, 2018 No network connectivity? Will you use iR to control them? Yes- no network connectivity. My first cut at this was to use a raspberry PI running lirc to send out the IR commands. I use habridge (Hue emulator) with Amazon Alexa to trigger local scripts on the PI to run the correct TX command. Works very reliably. Have my cable box (no ethernet), TV and stereo controlled this way. #1 There are two cons that I think could be fixed using the networking method. Alexa doesn't allow numbers over 100 for my channel selection - I have to break this up into channel groups and then the % is a delta from the base. Using variables I should be able to use a number directly. #2 To do a volume say +5 or -3 or whatever I had to use a base value of 10 and then the volume is the offset. For example 15% goes up 5, 7% goes down 3. (I capped it at 20 % in case it misunderstood - it happened it was loud- forty and four aren't that different..) I think I read there is a delta volume hopefully I'll be able to use that. Quote
pastro50 Posted January 29, 2018 Author Posted January 29, 2018 Would not a harmony hub and associated node server be better (and more reliable) than this Rube Goldberg contraption... Sent from my SM-N9500 using Tapatalk Easier to setup for sure - Reliability wise, I'm quite happy - I had to build an IR receiver to get the correct codes for my remote, but that was easy and Lirc on the PI works fine. Quote
larryllix Posted January 29, 2018 Posted January 29, 2018 Easier to setup for sure - Reliability wise, I'm quite happy - I had to build an IR receiver to get the correct codes for my remote, but that was easy and Lirc on the PI works fine. iR control? My grandfather used to talk about that technology. Just kidding. I was going to go that route with the iR Insteon plug-in, but I could never get it to work with ISY. After finding the two LED transmitters wired into opposite polarity and fixing that, I gave up a few ISY versions ago.Of course, when you buy things from SH into Canada, you are at your own risk and defects just become garbage. Spent some bigger bucks and bought a Network capable A/V receiver. That was fairly easy except for telling Google Home it was in the Gathering Room. Never tell google anything. It loves to turn off my receiver with the lights now. Soon to be booted to the curb as SkyNet continues to grow constantly Now I have to figure out the encrypted jargon for a Samsung TV Quote
pastro50 Posted January 29, 2018 Author Posted January 29, 2018 The cable box that I use is a Cisco 8742hd. Afaik, there is no way to talk to it except with their web site or and IR remote. No idea what commands would be required to get it to emulate connecting to their website. - Seems too daunting to tackle for me. Really, about all I do is turn on the TV and pause/play the DVR. Lots of other things are programmed but it's pretty easy to pick up a remote for most. I did set a FF switch to go for about 3 minutes of program time which is convenient, at least for a lot of the shows I watch. Using the Harmony hub would offer me very little benefit since it would all be IR at the end of the day and I think my PI application kinda emulates that. Quote
barrygordon Posted January 30, 2018 Posted January 30, 2018 (edited) I do exactly what it is you want to do and it works fine; I use the RPi as the central Home Automation system running NodeJS and doing all development and testing using a Windows 10 system running Visual Studio 2015. For IR the RPi talks to a Global Cache unit over TCP with 6 IR ports and handles all IR except for those devices in the Home Theater. Some of the IR devices are an Electric faux fireplace, and all the TV's in the house. I have several Pronto PRO 9600's which also talk to The RPi to control local TV's over IR. I use Network resources with Alexa to control things like the fireplace, my pool system (through an Autelis Jandy control). A command to the RPi to control a device over IR is high level stating the device name and the command. The RPi's program then computes exactly which IR stream from its IR Library to send over which IR port. I do not control the TV's using Alexa as I am more comfortable using the Pronto 9600's. The RPi also handles all sorts of announcements through speakers in every room. All communications to the RPI is through either TCP/IP ur UDP/IP. The RPi also subscribes to the ISY 994 so it knows everything that is going on and can issue commands to and device the ISY controls using the ISY REST interface. The RPi implements full text to speech (TTS) using Amazons TTS service. The RPI controls speakers i(one in each room of the house) through individual relays. To send an audio announcement involves sending a TCP stream with a JSON payload providing the room names, volume setting and the text to be spoken. CallerID works via this paradigm starting with a "Way2Call" CallerId unit. I went the RPi route because I wanted the flexibility that it provides (assuming you are a competent Javascript or Python programmer), and its reliability. My RPi does not go down and the only time it has been unavailable is for the few seconds it takes to restart the application when I change something. It does this automatically. Anytime I want to do something new and different I just add the code to do it in the RPI. the RPi can be reached by the ISY, the house iPads, and the Pronto remotes. It was well worth the time to develop the code for the RPi. If any one is interested drop me a PM. I will answer all questions, butI will provide the code only to experienced Javsacript programmers otherwise the load on my time (of which I do not have that much left) gets to high. Edited January 30, 2018 by barrygordon Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.