[Deprecated] Plivo SMS and Voice Notification Driver

Update 11-03-2023: Plivo no longer supports individual developers. Accounts must be created with "work" email domains and they do not support email addresses from personal domains.

HE natively includes a Twilio driver that allows you to send SMS messages. Plivo is a competitor to Twilio and is a little cheaper so this might be a good alternative for the community. Please view the Plivo Pricing page for specific details. For example at the time of this post, the monthly fee for a dedicated phone number is half the cost of Twilio. In a nutshell, Plivo charges you a monthly fee for a dedicated phone number that notifications will come from and then there is a per SMS and call pricing which are very cheap. This shouldn't cost you more than $1 per month, but this will depend on usage.

This driver is a modification to the Community Twilio driver that I created in May 2018 which ultimately became a stock driver. If you are familiar with the native driver, this one has several differences:

  1. Has a parent container driver that creates children notification devices so you only have to enter the Plivo API once in the parent container.
  2. In certain regions of the world (not USA), Plivo supports Alphanumeric Senders which are a little cheaper than purchasing a phone number. Added support for Alpha Sender.
  3. Support voice calls via text to voice. Added SpeechSynthesis capability to the child driver and when you invoke the speak command, the driver will instruct Plivo to call your phone number instead and speak the text.

Hoping @bravenel will consider creating a native Plivo driver. This is a copy of my Twilio driver and only simple REST API endpoint changes were needed to make it work.

To utilize this driver:

  1. Sign up for a Plivo account
  2. Fund the account via credit card
  3. Purchase a phone number (or setup Alphanumeric sender if supported in your region). Plivo is a bit different than Twilio and they don't have as many local USA numbers.
  4. On the Plivo Dashboard, capture your account's Auth ID and Auth Token:
  5. Add the container and device drivers code to your HE hub or use HPM to install the code - search for Plivo SMS and Voice Notifications.
  6. Create a new virtual device and set the type to Plivo Container and Save Device.
  7. Enter the Plivo API Credentials into the Hubitat driver.
  8. Designate whether you are using an Alpha Sender, default no.
  9. Select your Plivo Phone Number or Alpha Sender and Save Preferences.
  10. Enter a child Device Label and phone number and click Create Device. The phone number needs to be entered in E.164 format for example in the US and Canada +18005551212. Multiple child notification devices can be setup and they will all leverage the same Plivo API Credentials.

Once this is setup, you can select this new device in Rule Machine and other apps for notifications. The messages are logged as events too!

Optional Text to Voice Setup

To setup voice calls, additional setup is required within your Plivo Account. The Plivo Voice API has a multi-step API to make a call and then speak text which complicates the setup. Fortunately they have a workflow feature called PHLO that you can setup within your Plivo Account to make this process very simple to setup.

  1. Login to your Plivo Account.

  2. In the left navigation bar, click PHLO - at the time of this post it is the icon below the # sign.

  3. Click Create New PHLO

  4. In the Choose your use-case popup, we will leverage the Voice Notifications template, select it.

  5. Click Create Application

  6. Select the Start step

    • Add message to the API Request section
    • Click Validate
    • Click Save
  7. Select the Play_Notification step

    • Replace the Speak Text with the following: {{Start.http.params.message}}
    • Click Validate
    • Click Save
  8. At the top right side of the screen beside Save you will find the Copy PHLO URL button, click it.

  9. Back in your Hubitat Plivo Container driver, find the Plivo PHLO URL preference and paste the URL into that field and click Save Preferences

  10. To utilize this feature, in Rule Machine or other apps, use the Speak command and the text you wish to speak via phone call. This driver will call the phone number and speak the text entered.

The drivers can be found here or in HPM:

9 Likes

All this is way over my head, but I'm curious...

Could this also be made to work with voip.ms?
https://wiki.voip.ms/article/SMS

I don’t know anything about voip.ms but a quick scan of their website does not mention a Rest API like Plivo or Twilio. Mentions sending SMS through their web interface which wouldn’t work with my drivers.

1 Like

Hello. Just set this up and it was super easy with your App.

Plivo even gave me a $10 credit to get a number and send some messages. SO I spent nothing to just try it. The setup is a little confusing when you first log in but I just pushed forward and figured it out. Tips for other users thinking about this:

  1. You can't use Gmail accounts or other personal emails to sign up. That's okay, I used my work email.
  2. Once you get signed in, it asks you to creat a first app. I used a pre-made app under the 'SMS' tab for SMS notifications. It brought me to some GUI to design the app, I just saved it and then used the menu items on the left to buy a number and the token and items required.
  3. Made the required devices and made a simple test rule. Worked perfect, maybe 10 second delay at most!

Thanks again, This is really cheap and easy notifications.

1 Like

Be advised that Plivo is refusing to allow us to sign up and use their service. I even talked with their support team and no budging. I guess you might as well pull support for it.

Greetings from Plivo Support!

Based on the information you provided regarding your business and use case, we are unable to provide you with service at this time.

We understand this might cause you inconvenience.

Our internal team has made the thorough reassessment , and this decision is final.

Thank you.

Regards,
yukthi
Plivo, Inc.
Web: www.plivo.com | Twitter: @plivo
Send & receive MMS across the US and Canada

1 Like

That is unfortunate but not surprising given all the new telephone carrier requirements.

I know this is an old thread, but voip.ms now does have a REST /JSON API (and SOAP). Not sure if you are looking for alternatives or not? I am looking for the best way to be able to send SMS from Webcore in HE and I may try to figure out if this would make sense for me. Are you still maintaining an SMS driver?

You may need an account to see the link below:
VoIP.ms - Customer Portal: API Documentation

I am not. Based on my little usage it doesn’t make sense for me to go through all the verification process and expense. I am now solely using Pushover.

1 Like

I did a bit more research into the A2P 10DLC Registration rules and cost and came to the same conclusion. It just wouldn't be worth it to me, either.

1 Like