Note sure if this is the problem or not, but you appear to have a space character between the “[tt]?[/tt]” of the URL, and it’s first parameter “[tt]apikey[/tt]”
yours…
…[tt]? apikey=[/tt]…
I suspect it should be…
…[tt]?apikey=[/tt]…
Note sure if this is the problem or not, but you appear to have a space character between the “[tt]?[/tt]” of the URL, and it’s first parameter “[tt]apikey[/tt]”
yours…
…[tt]? apikey=[/tt]…
I suspect it should be…
…[tt]?apikey=[/tt]…
Reduce it just down to this:
luup.inet.wget("http://www.prowlapp.com/publicapi/add?apikey=1234567890123456789012345678901234567890&application=Vera&event=Armed&description=Home+still+set&priority=1")
return true
(space removed, as guessed points out) and see if it reports at all. If yes, then the problem is with your Luup variable_get logic. Otherwise it’s with your talking to Prowl.
I removed the space and it still doesnt work,
If I just use the luup.inet.wget statement and run the scene I get a notification. So prowl is working.
I’ve removed the notifaction line and tried to change the device to an actual binary switch (its an outlet but shows as a binary switch) and I came up with:
if(luup.variable_get(“urn:schemas-upnp-org:device:BinaryLight:1”,“Status”,5)==“0” ) then
return true
end
That doesn’t work to activate a scene. Ill continue to search, I know I’ve read several posts on similar scripts.
Thanks for you help,
at least I know where the problem is now.
Now I’m confused,
After some reading I’ve changed the script to:
local home_away = luup.variable_get(“urn:schemas-upnp-org:device:BinaryLight:1”, “Status”, 5)
if (home_away == ‘1’) then
return false
else
luup.inet.wget(“http://www.prowlapp.com/publicapi/add?apikey=123456789012345678901234567890&application=Vera&event=Scene&description=Home+still+set&priority=1”)
end
Now I get a notification no matter what state the switch is in. Any ideas?
[quote=“fire708, post:44, topic:166686”]local home_away = luup.variable_get(“urn:schemas-upnp-org:device:BinaryLight:1”, “Status”, 5)
if (home_away == ‘1’) then
return false
…
Now I get a notification no matter what state the switch is in. Any ideas?[/quote]
That suggests that your variable home_away never contains the string “1”.
This is almost certainly wrong:
luup.variable_get("urn:schemas-upnp-org:device:BinaryLight:1", "Status", 5)
That first string you have provided is a Device Type, and you need to give it a Service ID.
The service ID that you want is whatever you see when you are on the Advanced tab of the device’s dialog, and hover the mouse pointer over the variable you are interested in (see the screenshot).
Try this:
luup.variable_get("urn:upnp-org:serviceId:SwitchPower1", "Status", 5)
Note the capitalization.
[quote=“fire708, post:44, topic:166686”]Now I’m confused,
After some reading I’ve changed the script to:
local home_away = luup.variable_get(“urn:schemas-upnp-org:device:BinaryLight:1”, “Status”, 5)
if (home_away == ‘1’) then
return false
else
luup.inet.wget(“http://www.prowlapp.com/publicapi/add?apikey=123456789012345678901234567890&application=Vera&event=Scene&description=Home+still+set&priority=1”)
end
Now I get a notification no matter what state the switch is in. Any ideas?[/quote]
In my push notification plugin I convert the state variable value to a number for comparisons:
local keepLast = luup.variable_get("urn:automatorapp-com:serviceId:Push1", "KeepLastMessage", lul_device) or "0"
luup.log("keeplast" .. keepLast)
if ( tonumber(keepLast) > 0) then
luup.variable_set("urn:automatorapp-com:serviceId:Push1", "LastMessage", message, lul_device)
end
Just a thought for handling when the variable isn’t defined, which may give you an error.
Well, that didnt work. Im gonna start a new thread to try to get more ideas. Thank you all for your help, even though its not working I learned quite a bit about writing a script.
So in the cases where I am driving stuff off a virtual switch, the Status variable I am retrieving is an attribute of the underlying SwitchPower1, not the binary light:
skip = luup.variable_get(“urn:upnp-org:serviceId:SwitchPower1”,“Status”,40)
if(skip==“1”)then
return false
end
Where “40” is the id of my StateDevice virtual switch. This works like a champ. I think you may be querying the wrong thing.
–Richard
THANK YOU futzle! And everybody.
Its working ;D
BTW,
Sooo much more help here than the forum for the software i was using. Im really glad I switched.
I’ve just purchased Prowl, and I’m setting up my push notifications… is the standard approach within Vera to set up a single scene called “Prowl Notifications” or some such thing & just add all the events of which you want to be notified? For example:
Event: Front Door PIN Code #1 entered (appropriate code in Luup Event)
Event: Front Door PIN Code #2 entered (appropriate code in Luup Event)
Event: Ambient Temperature out of range (appropriate code in Luup Event)
Event: Motion Detected at Front Door (appropriate code in Luup Event)
Event: Away Mode Set (appropriate code in Luup Event)
Event: Garage Door Opened (appropriate code in Luup Event)
…etc…? Or is there another approach?
I’m asking because I know that not all of the events I want to be notified of are set up as scene triggers.
I do each notification separately in its own scene. It’s code repetition but it seldom changes, and that way I can build up the notification string dynamically for each event.
Oh, I see… well, as I don’t intend to have dynamic notifications (for the moment), I’ll stick to a single scene.
EDIT: first couple of tests failed, but it was because of a cut & paste error in my URL…
This is great! I don’t particularly like the format of the text, however…
THIS: luup.inet.wget("http://www.prowlapp.com/publicapi/add?apikey=xxxxxx&application=Vera&event=Alert&description=Entry+table+lamp+on&priority=-1")
return true
…appears on the iPhone as:
[hr]
Vera-Alert
Entry table lamp on
[hr]
I guess I could do without the line between Vera & Alert. …but this is still the best $2.99 toy I’ve ever purchased.
Do you that is possible to assign a particular sound or voice (mp3) for a different prowl message? On that case we can have also voice announce with prowl!!
Any idea?
Thanks
Matteo
I am here: http://tapatalk.com/map.php?2rswmo
Doesn’t look like it. There are only eight built-in sounds and you have to pick from among them for the five priority levels -2 to 2.
I just bought Prowl, but am having trouble getting it to work for a Kwikset unlock notification. Can you paste in your LUA code here?
[tt]luup.inet.wget(“http://www.prowlapp.com/publicapi/add?apikey=XXXXXXXXXXXXXXX&application=Vera&event=Alert&description=Girlfriend’s+PIN+Code+Entered&priority=-1”)
return true[/tt]
Hi
Has anyone looked at the app ‘Boxcar’ on the App Store , is that suitable for use with Vera for notifications ?
Hi,
I have Prowl set up to alert me when energy usage hits 5kwh of house hold electricity being used, it works a treat, but once usage reaches that peak, it keeps alerting all the time i assume while it is still reporting its over 5kwh.
Is there a way to only send the alert once and then maybe reset/check again 10 mins later?
I tried adding luup.sleep (10000) to the very end, but it gave me an error that looked like it effected other scenes.
There is probably a few ways you can do this. But a few ideas are:
One set up a vertical switch (say send notification) that is now part of the conditional tests. after you send the first message it is set to off (do not send notification) and then it would be reset to on (send) when you reading falls below threshold (this maybe diffent to the send value e.g. Send at 5000 reset at 4900) or manually acknowledge.
Otherwise use variable container to do the same with old and new readings and only send when the Old reading < 5000 and >=5000.
Best Home Automation shopping experience. Shop at Ezlo!
© 2024 Ezlo Innovation, All Rights Reserved. Terms of Use | Privacy Policy | Forum Rules