Hi everyone, i am struggling to configure a new Twilio Super sim which i would like to use in a gps tracker.
Twilio Super sims do not have a publicly addressable phone number. The only way to reach it via SMS is by using the SMS Commands API
curl -X POST https://supersim.twilio.com/v1/SmsCommands \
--data-urlencode 'Sim=<YOUR_SIM_NAME_OR_SID>' \
--data-urlencode 'Payload={"command":"wake","time":"2021-04-19-15-03-49"}' \
-u <YOUR_ACCOUNT_SID>:<YOUR_AUTH_TOKEN>
Since i do not have a static IP i need to be able to pass a dynamic value to the payload… To configure the gps tracker with my new IP i need to send the following: G123456 IP PORT → G123456 xxx.xxx.xxx.xxx 5093
.
I also need to use this in an automation to automatically update my tracker when my public ip changes.
Using the following generates a [sim] is an invalid option for [rest_command]
error message, which is normal.
Adding the sim parameter in the Headers generates an authorization error (401)
twilio_send_sms:
url: "https://supersim.twilio.com/v1/SmsCommands"
method: POST
sim: !secret twilio_sim_sid
headers:
authorization: !secret twilio_auth
accept: 'data-urlencode'
payload: 'adminip123456 {{ states("sensor.myip") }} 5093'
content_type: 'data-urlencode'
I have considered using shell commands but I lack the skills to make this work.
Any ideas will be welcome.
Thanks!