[RELEASE] Using Twilio to Send SMS

twilio
sms

#21

sorry… yes i followed b7 and c4
also i did insert the variable Google APIURL and SMS code and used the Twilio number in the from variable. i will send you a copy of the actual piston…with private info xxxd out…give me a sec


#22


#25

In your GET request you gave $args.ToNumber instead of $args.smsToNumber


#26

ok… i’ll try that thanks


#27

changed and ran test piston…no text came through


#28

Your test piston is calling "Home \ webCoRE1 \ new master" but your master piston is called "webCoRE Piston #2"

Try changing ‘smsFrom’ to ‘webCoRE’… some regions have restrictions on spoofing phone numbers, Twillio has to comply with local laws.


#29

Also, double check that you have published the script in the Google API, as Google wont get the command otherwise.


#30

could not change to webCoRE when i try to publish google page… i get error


#31

i hit publish then test…i get this error The script completed but did not return anything


#32

Walk me through publish > test

That is an incomplete process and I’m not even sure what you are clicking to test.

In the Google Sheet, you go to tools > script editor
In the script editor go to publish > deploy as web app, the follow the options through.

Make sure the ‘Current web app URL’ provided by the Google publish page matches what you placed into the webcore Piston.


#33

That is fine, the Google script does not return a response, it just runs, send the command to twillio and ends.


#34

I cant imagine why you couldn’t change a piston variable???

I see what you are clicking in Google API to test now, that wont work as the test link is missing the custom arguments sent by webCoRE.


#35

google%20web%20page
under the web url there is a test in blue…that is what i used to test
i copy the URL directly to webcore google url
i’m glad you are patient …very new to this


#36

ok… lets see where the break is.

First we will test the link between the test piston and and master piston.

Turn on full logging on both pistons.

Click test in the test piton, then go to the master piston and see if it was executed at the same time as you clicked test (use the quick facts box at the top of the master piston for that).


#37

as for changing the variable…i may doing it wrong?


the option to select weCoRE is not available…


#39

Change in the master piston, not the test piston:

You currently have a phone number there.


#40

is there a way to get the master to pass messages from a list of eg…1smsBody, 2smsBody, 3smsBody… i set up the “test twilio” piston with 13 seperate alarms, and set up master with 2 seperate “get” but when the test piston activates…i get the alarm that is active but i also get the other as “null”! i uploaded my failed master and what i am trying to accomplish.failed%20multiple%20master%20for%20alarming|690x313


#41

this master fails…send triggered alarm and null alarm


#42

You only need 1 ‘master’ piston. In regards to sending to two different Goolge API’s, why exactly would you want to do that?

You are getting null on one message each time because the trigger piston is only sending one smsBody variable in $args, be it 5smsBody or whatever else you have renamed the variable to.

In your example above, your piston is looking for two different $arg.variables, 5smsBody & 2smsBody, but only one will ever exist, if any (you might be sending 22smsBody which would result in two nulls).

The ‘master’ piston is only a middleman, if you want to send two messages than have the ‘trigger’ piston(s) send two calls to the master. Leave the master as per the original I provided.

Your ‘trigger’ piston should only ever send an smsBody variable, not some numbered variant or rename, as the ‘Master’ piston will not recognise anything but $args.smsBody.

In regards to your long ‘trigger’ piston, with a block for each sensor, you could streamline this using $currentEventDevice… something like the following:


#43

ok thanks… i will try to work with that… i think i got it