I get an error when I tried my first luup. Can anyone assist? I don’t really get any error info, just a red blob that says luup code error when I try to save…
-- Inform me if I forgot to lock the door.
local lul_lock = luup.variable_get("urn:micasaverde-com:serviceId:DoorLock1", "Status", 3)
if (lul_lock == '0') then
luup.inet.wget("http://www.prowlapp.com/publicapi/add?apikey=999..................9999&application=Vera&event=Armed&description=Lock+the+door&priority=1")
end
return true
Material Changes:
urn:micasaverde-com vice urn:upnp-org (This appears to be the device_type in the Doorlock device that I have…urn:schemas-micasaverde-com:device:DoorLock:1)
Add a 1 to the name because of the above
I’m confused because of havitall’s “teach a man to fish” post, which shows a difference in one line, so I thought he ended up using this:
local lul_lock = luup.variable_get(“urn:schemas-micasaverde-com:device:DoorLock:1”, “Status”, 3)
instead of this:
local lul_lock = luup.variable_get(“urn:micasaverde-com:serviceId:DoorLock1”, “Status”, 3)
…note the two differences I’m trying to clarify. I believe the RED should be the FIRST version… unsure about the green. Thanks…
I’m confused because of havitall’s “teach a man to fish” post, which shows a difference in one line, so I thought he ended up using this:
local lul_lock = luup.variable_get(“urn:schemas-micasaverde-com:device:DoorLock:1”, “Status”, 3)
instead of this:
local lul_lock = luup.variable_get(“urn:micasaverde-com:serviceId:DoorLock1”, “Status”, 3)
…note the two differences I’m trying to clarify. I believe the RED should be the FIRST version… unsure about the green. Thanks…[/quote]
This is the correct syntax to get the variable:
local xxxxxx = luup.variable_get(“urn:micasaverde-com:serviceId:DoorLock1”, “Status”, 3)
[quote=“CMRancho, post:10, topic:169511”]This is the correct syntax to get the variable:
local xxxxxx = luup.variable_get(“urn:micasaverde-com:serviceId:DoorLock1”, “Status”, 3)[/quote]
Great–thanks!
That post is not a correction to @mcvflorin’s code, but only lists the deltas and asks @mcvflorin (the teacher) why those changes had to be made. Which @mcvflorin explains in the next post.
Best Home Automation shopping experience. Shop at Ezlo!