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:
- Has a parent container driver that creates children notification devices so you only have to enter the Plivo API once in the parent container.
- 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.
- 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:
- Sign up for a Plivo account
- Fund the account via credit card
- 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.
- On the Plivo Dashboard, capture your account's Auth ID and Auth Token:
- 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.
- Create a new virtual device and set the type to Plivo Container and Save Device.
- Enter the Plivo API Credentials into the Hubitat driver.
- Designate whether you are using an Alpha Sender, default no.
- Select your Plivo Phone Number or Alpha Sender and Save Preferences.
- 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.
-
Login to your Plivo Account.
-
In the left navigation bar, click PHLO - at the time of this post it is the icon below the # sign.
-
Click Create New PHLO
-
In the Choose your use-case popup, we will leverage the Voice Notifications template, select it.
-
Click Create Application
-
Select the Start step
- Add message to the API Request section
- Click Validate
- Click Save
-
Select the Play_Notification step
- Replace the Speak Text with the following: {{Start.http.params.message}}
- Click Validate
- Click Save
-
At the top right side of the screen beside Save you will find the Copy PHLO URL button, click it.
-
Back in your Hubitat Plivo Container driver, find the Plivo PHLO URL preference and paste the URL into that field and click Save Preferences
-
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: