Telstra Notification add-on

Followed the instruction on the add-on for the telstra notification platform. I setup the key and the secret after creating a dev account with Telstra.

I’m getting the following error in the home assistant log file.

2017-09-26 20:53:57 ERROR (SyncWorker_11) [homeassistant.components.notify.telstra] Error obtaining authorization from Telstra API
NoneType: None
2017-09-26 20:53:57 ERROR (MainThread) [homeassistant.components.notify] Failed to initialize notification service telstra

It works for me. Maybe post your config, the error sounds like theres an error with your api key

I too am having the same issue. I originally had the notification working, then the Telstra Dev site upgraded and I had to reapply for access and get a new consumer secret/key. Since then I have not been able to get it working with the exact same error message being displayed.

Here’s the document for the Telstra Messaging API V2.
https://github.com/telstra/MessagingAPI-v2/blob/master/Getting%20Started.md

Can see that they are expecting “NSMS” for the scope when doing Authentication. The current HA script sends “SMS”. Not sure if this is the problem. Also the version in the URL for the messaging API is V2 in the doco, but V1 in HA. Maybe the new keys are for V2 only.

Getting the following when run the sample auth curl post from the page above.

{“fault”:{“faultstring”:“Unable to identify proxy for host: tapi_secure and url: /v1/oauth/token”,“detail”:{“errorcode”:“messaging.adaptors.http.flow.ApplicationNotFound”}}}

did you ever find a solution for this? I’m having the same problem

Not yet. I did contact Telstra, I need to supply them withl some more info.

I’m having the same issue.

I think the telstra notify component needs to be changed to use the URL https://sapi.telstra.com/v1/oauth/token for Auth instead of https://api.telstra.com/v1/oauth/token.

Check out forum post https://dev.telstra.com/content/authentication-error

I dont get auth errors anymore when I update the URL. But am getting

[31m2017-11-02 14:16:32 ERROR (SyncWorker_14) [homeassistant.components.notify.telstra] Failed to send SMS. Status code: 401e[0m

Possibly somethign else wrong with my config though.

@psy How did you update the URL? Is a simple code change that can be done locally? If so, which file?

Cheers!

Edit: Sorry Just answered my own question following the advice here and here:

https://home-assistant.io/developers/component_loading/

Edit 2:
I am also still getting the 401 error though. I tried changing the URL on line 74 to sapi.telstra.com but then i got a 404 error. I have also tried changing SMS to NSMS on line 94. So anyone got a working example?

Hi Gav,

I updated the two URL’s as per the link to the telstra dev forum that Dinoaus posted. I also changed the scope from SMS to NSMS

I now appear to auth successfully, and get a token however I get an error 500 when attempting to send an SMS.

I updated the Telstra.py file (but take it that you’ve already found this).
I haven’t had a chance to get a better look at the file. May do so over the w/end.

Thanks. Let us know if you have any success

@psy What are you using as the message_resource? When I change it to https://sapi.telstra.com/v1/sms/messages I get a 404 error?

message_resource is set to https://tapi.telstra.com/v2/messages/sms

as documented here
https://github.com/telstra/MessagingAPI-v2/blob/master/Getting%20Started.md

note my programming skills aren’t brilliant, so I’m fumbling my way through this.

I am trying to find some time to work out what is going wrong. All I have done so far is retrieved the full error message. Might help someone:

“status”:“500”,
“code”:“TECH-ERR”,
“message”:“Technical error : Execution of JS.ModifyMessageIdURLResponse failed with error: Javascript runtime error: "TypeError: Cannot call method "map" of undefined. (modifyMessageIdURLResponse.js:57)" : An error has occurred while processing your request, please refer to API Docs for summary on the issue”

Edit: Someone has posted this exact query to the Telstra Dev forum so I have also followed that up there as well.

Just spotted this thread and thought this might help, Ive just pushed the Node SDK https://github.com/telstra/MessagingAPI-SDK-node

Also before you send an SMS/MMS you need to hit the provisioning API against your app to get issued a mobile number first.

Thanks Steve.

I found a python example linked from the dev Telstra page and have modified this.
I can send sms’ messages in python now.

Will modify the Telstra.py file for Homeassistant now that I know it works.

Evening all.

Got it working!

Thanks Steve, Gav and all others. Not sure how I publish this?

My python skills are rubbish, so it probably needs a bit of cleanup.

@psy Did you want to just paste your telstra.py code in here for now and we can take a look at it?

Ill post it tonight. Im not sure it’s accurate, as I registered a phone number using the python sample code, so not sure what impact that will have.

Essentially I just added a provision section and called that as part of the send sms component.