i try to modify the automation program "Alcatel One Touch Y800Z SMS Notify" of HG to work with the Android App "SMS Gateway Ultimate" (
https://play.google.com/store/apps/details?id=com.icecoldapps.smsgatewayultimate&hl=it) installed in a Andorid phone.
I will use it to send my SMS from HG.
I have done the setup of this Andorid app and i have the server running at port 8080 of the phone wifi connection, to send sms from homegenie i use the command (i have removed the previous login web call):
var request = "smsto=" + smsRecipient + "&smsbody=" + message + "&smstype=sms";
Net.WebService("http://" + modemAddress + "/send.html?"+request).GetData();
this command is not working, i see that the connection from HG is actived but the app "SMS Gateway Ultimate" say that i have sent wrong parameters, i verify that the parameters are "smsto","smsbody" and "smstype" that is the same inforrmation that i need to enter manually on the SMS page of that app.
I think i have a wrong format or call, i don't know if the call from HG is ok.. i try Post call but i don't works..
any advice ?
this is the source web-page of the service app SMS gateway Ultimate:
---------------------------------------------------------------------------
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="
http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Buy SMS Gateway Ultimate Pro</title>
<style type="text/css">
body{
font-family: "Lucida Grande",Calibri,Arial;
font-size: 9pt;
color: #333;
background: #f8f8f8;
}
a{
color: #666666;
font-size: 11pt;
font-weight: bold;
text-decoration: none;
}
a:hover{
color: #000;
}
table{
margin: 0 auto;
padding: 0;
width: 600px;
}
table td{
padding: 5px;
}
thead td{
padding-left: 0;
font-family: "Trebuchet MS";
font-size: 14pt;
font-weight: bold;
}
tbody td.name{
width: 99%;
}
tbody .file td{
background: #fff;
border: solid 1px #ddd;
}
tbody tr.file:hover td{
background: #C4C4C4;
}
tbody .file td.size,tbody .file td.time{
white-space: nowrap;
padding: 5px 10px;
}
tbody .file td.size span{
color: #999;
font-size: 8pt;
}
tbody .file td.time{
color: #555;
}
tfoot td{
padding: 5px 0;
color: #777;
font-size: 14pt;
background: #f8f8f8;
border-color: #f8f8f8;
}
tfoot td.ccc{
text-align: right;white-space: nowrap;
}
</style>
</head>
<body>
<table cellpadding="0" cellspacing="1">
<thead>
<tr>
<td colspan="3">
<form method="GET" action="/send.html">
<b>To:</b><br />
<input type="text" name="smsto" id="smsto" style="width:100%"/><br />
<b>Text:</b><br />
<textarea name="smsbody" id="smsbody" style="width:100%;height:200px;"></textarea><br />
<b>Type:</b><br />
<select name="smstype" id="smstype" style="width:100%">
<option value="sms">SMS</option>
<option value="email">Email</option>
</select><br /><br />
<input type="submit" value="Send"/>
</form>
</td>
</tr>
</thead>
<tfoot>
<tr>
<td class="total">
</td>
<td colspan="3" class="ccc">
<a target="_blank" href="
https://play.google.com/store/apps/details?id=com.icecoldapps.smsgatewayultimatepro" style="font-size: 25pt;">Buy SMS Gateway Ultimate Pro</a>
</td>
</tr>
</tfoot>
<tbody>
</tbody>
</table>
</body>
---------------------------------------------------------------------------
if i run manually i a browser that url:
http://192.168.0.140:8080/send.html?smsto=0001234567&smsbody=testtttt&smstype=smsit send me a sms correctly (phone number is changed is this example), so i need to reproduce exactly the same from HG.
i found that if i change the last code as:
else if (module.HasFeature("SMSGateway.NotifyEvents") && (property.Name.StartsWith("Sensor.") || property.Name.StartsWith("Status.")))
{
//var message = module.Instance.Name + " " + property.Name + "=" + property.Value + " (" + module.Instance.Domain + "." + module.Instance.Address + ")";
var message = "testttttttttttttt";
SmsSend(message);
}
so, i overwrite the message with "testttttt" string it send the message correctly, so my problem could be related to how the message is build from the command:
var message = module.Instance.Name + " " + property.Name + "=" + property.Value + " (" + module.Instance.Domain + "." + module.Instance.Address + ")";
this could be a good method to send sms from HG.
thanks for any help/advice