Twilio.com API Interface Plugin

Could you my post something? I have 2 scenes for each trigger → either SMS or Prowl based on a Virtual Switch

Yes, I saw this too. It still means though to put code into scenes and triggers (other than the call to Twilio) that can be avoided.
I’ll give it a try. Gotta get my feet wet with Lua sooner or later ;).

Thanks for the feedbacks.

MJ

You can always use a virtual switch and some code to check if the switch is on or off before sending the message.

Thank you, SOliva. Yes I could … and I could script my whole automation requirements with Lua code too … But this somehow defeats the purpose of the UI and plugins, doesn’t it. An additional, IMO unnecessary, VirtualSwitch justs add to the clutter of the UI whereas a simple ‘unmute/mute’ solution within the Twilio plugin would be so much … ehm, simpler, not say easier to handle for non-programmers.
Maybe I’m the only one that seas a value in my suggestion. Well then …
I’ll give it a try with the VirtualSwitch if you kindly could provide the if-then-else code to your Lua script.

Thank you
MJ

I do see MJ’s point, it would save me indeed an additional device as well, but it is a nice to have for me

You can use the Vera Alerts Plugin as that Front End for the notifications. Have all of the Notifications forwarded to the Twillo plugin.

The Vera Alerts Plugin already has a global on/off flag in the settings.
Plus you can use the standard MCV Notification tab on devices for Notifications. For Scenes … use the Advanced Tab, Vera Alerts Device, SentAlert action.

Many HomeWave/Push Notification users forward through Vera Alerts.

I have some new features for those that use Forward in the next release.

So vera can talk to twilio… can twilio talk back?

The website lists phone surveys as a feature… would it be possible to have twilio make a call and use the keypad inputs to trigger events or scenes?

[quote=“new2me07, post:47, topic:175988”]So vera can talk to twilio… can twilio talk back?

The website lists phone surveys as a feature… would it be possible to have twilio make a call and use the keypad inputs to trigger events or scenes?[/quote]
yes thats possible, but not via the plugin. twilio can execute URLS based on events.
i use the same way to have my local PBX with a voice menu control the vera.

Sounds interesting…

Can you give a description of your setup and what and how you use it… doesn’t xbmc have a pbx plugin??.. sounds like you got something awesome going on

On the Twilio.com website, there are examples of how to do this. You have to setup a server to do it though. The API will pull the XML from the URL that defines what the system will do, to include presenting a menu of options, etc.

You can also have it setup conference calls, etc.

I’ve never tried it, but using the custom URL feature, you probably could make Twilio do more than just call you or send you a text message.

absolutly… you can have real IVR Menu’s …
with “press that for this and this for there” and so on

to call the action just have the returning call (can be defined in your account as well) to then make a https call to your vera or to cp.mios.com and all is good.

i do pretty much the same but on my local asterisk system.

So how exactly can I set up the following ?

(Working) Alarm is tripped
(twilio Working) Calls Me, mum, brother,dad
(twilio Working) Sends a txt to Me, mum, brother,dad

How can I have it say press 1 to confirm this call and deactivate alarm. Send command to vera and activates the disarm scene.

I have a webserver so can host whatever is needed. I just need pointing in the right direction.

I have found how to disarm and arm the alarm via my local network

Disarm - http://veraip:3480/data_request?id=lu_action&serviceId=urn:micasaverde-com:serviceId:HomeAutomationGateway1&action=RunScene&SceneNum=11

Arm - http://veraip:3480/data_request?id=lu_action&serviceId=urn:micasaverde-com:serviceId:HomeAutomationGateway1&action=RunScene&SceneNum=18

Just need to know how to get twilio to run these url’s from the outside of my network

[quote=“dabbsy, post:52, topic:175988”]Disarm - http://veraip:3480/data_request?id=lu_action&serviceId=urn:micasaverde-com:serviceId:HomeAutomationGateway1&action=RunScene&SceneNum=11
Just need to know how to get twilio to run these url’s from the outside of my network[/quote]

you need to set on your router to forward the port 3480 to your vera … (or any other port forwarded to your vera ip on port 3480)
but for the sake of security you should only allow connections to this port then from your webserver IP …

You should NEVER tell anyone to port forward …

That is technical malpractice.

you should NEVER tell anyone about malpractice without presenting a better solution :wink:

sure IP’s can be spoofed, but that would only have a positive effect if the hacker does know there is a vera.
and (of course) know the port you using AND the ip the webserver of his choice use to push the requests …

thats kind of a mission for a virtual intruder.

well a “solution” (not really) would be to use mios.com forwarding servers … with the same command url

example:

$ih = file_get_contents("https://fwd1.mios.com/-user-/-password-/-veraid-/data_request?id=lu_action&serviceId=urn:micasaverde-com:serviceId:HomeAutomationGateway1&action=RunScene&SceneNum=11");

but that would expose your mios/vera remote login on the webspace … which i would only do if i own/lease the server and share with no-one

a port forward combined with iptables/ipchain to restrict access to the webserver only is in my eyes alot more secure.

Search the forum … or the wiki … there are documented solutions for securely accessing VERA remotely. And you should have researched before posting.

I have logging on my router … port scanning and probing for access has been a constant activity for YEARS. You should not be encouraging people, that may have limited security knowledge, to lower their security defense.

And your solution of using the MIOS forwarding services is almost right … but once again using http as opposed to https exposes your password to the internet.
STOP while you are behind.

that does not sound like limited security knowledge to me …
and i already pointed out some up’s and down’s in my post.
thats at least more as “Search the forum … or the wiki” … where i have not yet found a better way :wink:

but maybe iam just blind.

iptables -P INPUT DROP (works since 1998 and not bypassed since 2001 (assuming you on a supporting kernel))

yes “almost” that nails it !
if:

  • the machine is locally secured
  • is NOT shared webspace
  • no offsite backups on shared discs are made
  • the webservice is proper configured …
  • the admin is a machine
  • logs are beeing trashed (or at least archived)
    then of course this is “better” but i have pointed that out as well in my post.

just to give you a tiny php example,
guess what happen if the webserver can not connect to mios forwarders (with whatever reason) ?
worst case: the URL shows on the output buffer along with the error (presenting a global usable url, username and password with no security whatsoever to use by anyone from anywhere) (including search engines)
not so worse: the url shows in error logs (but there is a big chance nobody reads them)

with that in mind … i rater wait someone hacks iptables
(trust me ALOT of peoples have tried, on much more lucrative endpoints than a Vera opening a garage door)

oh yes thats right … sorry about that … i just typed that manually quickly while revising my post … (i simply forgot the “s”)
i’ll fix it.

getting back on be professional:
the best way to do this is not port forwards (as pointed out already) and not mios calls on obios reasons.

i do it via a VPN Tunnel anyway established between my home network and the Webserver-network for other purposes
so the webserver can call my internal ip in the old fashion way without using username and password.

but just for the vera setting this up is abit “large”

the most secure way of doing this would be a ssh call, assuming the default settings are altered to allow only key-pair authentications.
then you can just call the url locally on the vera (or even better another machine with a proper Operating system, or the router itself (if possible)) via the ssh command.

protected by connection encryption and security of access by removing the password option.
but that (again may) requires the ssh port to be available via the outside network.

but delivers maximum security since no login information will be exchanged … ever

Hello,

I would like to know what is the URL and Variables to send a SMS message using my Twilio account, something similar to the below:

http://myserver/callhandler.php?Body=How+are+you+doing&From=4158675309&To=4155551212&AccountSid=AC3sdfsf94848B8393DF323

What I want is to post this URL in the browser and the SMS should send.