I’m trying to add basic commands for my directv DVR to a scene. I know what the exact commands should be and I’ve tested them from a basic web browser and they work fine. I’ve tried the examples from the wiki and there must be a syntax error somewhere as I can’t even get the scene to save with these code examples. I’ve tried many many variations on the 2 examples below, but I’ve yet to succeed. Any ideas?
Your second one is a complete mish-mash with unnecessary bits of code and undefined variables. If you want to try the http module then this should suffice.
local http = require "socket.http"
local result, status = http.request "whatever_url_you_want"
Thank you. I agree with your assessment of the code. I reverted to those two code examples from here: [url=https://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=2&cad=rja&uact=8&ved=0ahUKEwiLk4SKpNrPAhXFSSYKHVmmBScQygQILzAB&url=http%3A%2F%2Fwiki.micasaverde.com%2Findex.php%2FLuup_Scenes_Events%23Invoke_HTTP_URL_with_GET_request_.28Method_1.29&usg=AFQjCNFR25gsREzmB2n6T7DbugnYIJJd0A&sig2=r7BwqYiktmEDx1K9Lk4RBA]Redirect Notice
after I couldn’t make anything else work. Your suggestion was actually the very first thing I tried. I can power cycle my vera lite (UI7), create a new scene, select no devices, and tell it to run this luup code:
When I hit finish, vera spins around, the scene never shows up in the list, Luup eventually restarts, and I get an error message that says “Failed to save system configuration”. I can create other basic scenes without issue and all my existing scenes run just fine. The luup code tester runs the code snippet above without issue, but the command produces no results. I can create scenes with other luup code without issue and they work properly, but I have not been successful at all in getting a scene to even save properly with any sort of http get command via luup, so I’ve been assuming there’s been a syntax error the whole time creating a compile issue. There’s something I’m missing.
Try those examples from the Lua Test page and see if they work interactively.
If you’re having problems with scene code, this sounds like a known Vera bug in Lua code handling for some firmware versions. I’m not up to date on the details of this, because I never update my firmware, having got it to a stable state, but looking around on the forum should tell you more.
I upgraded to the latest firmware (1.7.855) and immediately resolved the issue. A couple of others are now present unfortunately, but there was definitely a luup code problem with my previous firmware.
Ive searched ALL over, and i cannot find a stickied FAQ, or any FAQ for that matter on how to get this to work. Can someone make a FAQ and sticky it up please?
I used these two lines in my scene and it works fine: (as noted previously by akbooer)
local http = require “socket.http”
local result, status = http.request “http://<change_ip_address>:8080/remote/processKey?key=poweron”
Now if I can just control my Sony STR-DN1080 AV receiver and my LG TV I can return the harmony hub that I just got. The harmony hub is not working so well for me, first and foremost, because it will not control the DirecTv with HTTP, it requires IR and that requires disabling the RF remote capability.
Best Home Automation shopping experience. Shop at Ezlo!