www.homeseer.com    
 

Go Back   HomeSeer Message Board > Telephone,Text and Email Plug-ins > Telephone,Text and Email Integration Discussion > SMS Gateway (3P)

SMS Gateway (3P) Discussions related to the SMS Gateway third party plugin.

Reply
 
Thread Tools Display Modes
  #1  
Old June 28th, 2017, 02:08 AM
ksj ksj is offline
Viewer
 
Join Date: Jun 2017
Location: Michigan
Posts: 3
Lightbulb Send SMS via Twillow.com event script

I didn't want to buy a modem just to send TXT messages from HS3 on linux to my mobile phone so I wrote a C# script to use Twillow.com SMS service and the "curl" program to do it.
To use Twillow you have to setup an account (free trial with web setup) and buy a sending phone number ($1.00/month after trial) and outgoing messages cost $.007/each after trial period.
The script needs to be edited to insert Twillow account info and phone numbers. Instructions are in the script. Then just run the script on an event and provide the message text in the script parameter which can include replacement variables.
I've attached the zip file of the script. Just unzip and put in HomeSeer scripts directory and edit account info.
Cheers-
Attached Files
File Type: zip SendSMS.zip (1.1 KB, 21 views)
Reply With Quote
  #2  
Old September 4th, 2017, 05:51 PM
adamg adamg is offline
Seer
 
Join Date: Aug 2017
Location: AB
Posts: 13
Thanks so much for this. I was looking for some examples how to send an SMS using Twilio's API.

Quick question though, when I try running the script on my machine, I get the following error:

"Running script C:\Program Files (x86)\HomeSeer HS3\scripts\SendSMS.cs :The system cannot find the file specified"

Do I need to add any imports reference or similar for this?

Thanks in advance
Reply With Quote
  #3  
Old September 8th, 2017, 07:59 PM
Rylo Rylo is offline
Seer
 
Join Date: Jan 2015
Location: Wv
Posts: 7
I get the same messae. I am assuming it cannot find the curl program to run. stay tuned.
Reply With Quote
  #4  
Old September 9th, 2017, 12:14 AM
adamg adamg is offline
Seer
 
Join Date: Aug 2017
Location: AB
Posts: 13
I tried it on my linux HS machine and no issues at all, the c# script works flawlessly.
Reply With Quote
  #5  
Old September 9th, 2017, 11:56 PM
ksj ksj is offline
Viewer
 
Join Date: Jun 2017
Location: Michigan
Posts: 3
I only tested on Linux HS3 but Rylo is probably correct for Windows users. You can install "curl" on windows - see: https://help.zendesk.com/hc/en-us/ar...g-cURL#install
Reply With Quote
  #6  
Old September 10th, 2017, 12:24 AM
adamg adamg is offline
Seer
 
Join Date: Aug 2017
Location: AB
Posts: 13
I will try that out. Thanks
Reply With Quote
  #7  
Old September 11th, 2017, 03:33 AM
beerygaz's Avatar
beerygaz beerygaz is offline
Super Seer
 
Join Date: Mar 2006
Location: Johannesburg, South Africa
Posts: 1,565
If there Ian enough demand I'd be happy to add Twillio support to the plugin. Most users use the plugin as a backup notification method when the Internet is down so Twillio becomes inaccessible.

Also outside the USA Twillio becomes quite pricey and often will not offer local numbers so replies / inbound messages become expensive too.
Reply With Quote
  #8  
Old September 11th, 2017, 09:52 PM
adamg adamg is offline
Seer
 
Join Date: Aug 2017
Location: AB
Posts: 13
Thanks for the reply,

That makes sense, I was not aware the Twilio charges are that much higher in other countries. My local is Canada so the fees are very similar to those in the US.

At this point I am happy with the C# script created by @ksg that sends a message.

I am looking into the external modem solution with the SMS plugin, but I require a 3G modem as there is no GSM or 2G coverage in my area.
Reply With Quote
  #9  
Old September 14th, 2017, 02:36 AM
adamg adamg is offline
Seer
 
Join Date: Aug 2017
Location: AB
Posts: 13
@Rylo, were you able to resolve the c# error when the script is ran? I installed curl and updated the system paths. The curl checks out (able to execute a test from the command prompt) so I know that is OK. I just still get the same error log.

Thanks
Reply With Quote
  #10  
Old September 14th, 2017, 03:37 AM
adamg adamg is offline
Seer
 
Join Date: Aug 2017
Location: AB
Posts: 13
OK, fixed the issue.

1) Make sure the curl library is installed correctly. I also had a curl ssl issue with the .crt and .perm files. I had to place a copy of them in my windows folder.

2) The way curl quotations work in windows is different than those in linux. Using single quotations ( ' ) in windows caused a number issues with the curl.exe shell. By replacing the single quotations in the .cs script with double quotations ( " ) I was able to get the script running fine. I have attached a copy of the .cs script that I was able to get working. Thanks again to @ksg for making this script.
Attached Files
File Type: zip SendSMS_windows.zip (1.1 KB, 1 views)

Last edited by adamg; September 14th, 2017 at 05:13 AM. Reason: Resolved issue.
Reply With Quote
  #11  
Old September 20th, 2017, 03:34 PM
efrey efrey is offline
Seer
 
Join Date: Aug 2008
Location: Colorado
Posts: 37
just use email to send text message

If you know what carrier the phone is on, then consider simply sending an email to the phone number 7=digit phone number and my carrier's address.

Here is a list of common wireless carriers in the US:
Alltel: @message.alltel.com (or @mms.alltelwireless.com for picture messages)
AT&T: @text.att.net.
Sprint: @messaging.sprintpcs.com.
T-Mobile: @tmomail.net.
Verizon: @vtext.com (or @vzwpix.com for photos and video)
The email capability provided as part of an HS event will accomplish this.
If you phone number is 123-456-7890, and your carrier is Verizon, then the email address is 1234567890@vtext.com.

You can even embed device values, date and time in the message. For example,
WARNING -- Hot tub temperature is lower than usual
$date $time :: Hot Tub 1-wire Temp = $$DSR:161:
Reply With Quote
Reply

Bookmarks

Tags
sms hs3 twillow, twilio

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Event to send ssh command? jlawson05 HS3-Pi Discussion 18 May 14th, 2017 10:19 PM
Send ir from script in HS3 amplizz HS3 / HS3PRO Discussion 24 September 16th, 2015 07:23 AM
Send Email Event Action variables rmasonjr HS2 / HSPRO 21 November 27th, 2012 01:01 PM
Can I make an event that will send a WoL using Jon00Network? Eddiie Jon00's plugins and scripts 2 September 25th, 2012 01:45 PM
HSTouch send event to change screen aldo Clients - Android 38 August 22nd, 2012 05:07 PM


All times are GMT -4. The time now is 06:11 PM.


Copyright HomeSeer Technologies, LLC