✅Fibaro HC2
✅Fibaro HCL
The Sonos Notification service for Fibaro HC2 & HCL controllers, allows you to broadcast notifications from your Fibaro controller to alert users of events or actions, for example announce that someone has opened a door, or that a door is still open after an amount of time.
This guide assumes that you have already purchased the Sonos Plugin and added your Sonos Speakers as per this setup guide.
The configuration options can be found on the Network Devices / Plugins page, by clicking on the Setting icon under the Sonos logo.
Here you will find the lower section on the page is used to show the available Sonos Speakers.
The options available on this page are ;
- Update/Create Fibaro VD - this will create or re-create the required Fibaro VD (see below)
- Change Language - this will allow you to specify a different language/accent.
- Test - this will broadcast the test announcement to all the speakers you have enabled
You will also find the list of speakers, along with their individual ID number that can be used to direct a notification just to a single speaker.
Using the TTS Feature with Home Center 2 (HC2)
Just click the Create/Update Fibaro TTS Device button, and this will create (and re-create if deleted) the required VD.
Once the VD has been created you will be able to use the created global variable (SOSPEAK) to specify and start an announcement. This can be done either in a block scene, or just by using the LUA code.
fibaro:setGlobal('SOSPEAK','hello');
You can also call this directly from LUA code, using the following examples, just change the IP address to that of your bridge, and the text to what you want announced, this will broadcast to the default enabled devices. Please note that different LUA code is required depending if used in a VD or Scene.
Example #1 - When used in Virtual Devices.
local httpSession = Net.FHttp("192.168.1.128",80);
response, status, errorcode = httpSession:GET("/sonos_speak/?text=hello");
If you need to direct the announcement to a specific speaker, just append the ID of the speaker (from the Sonos Settings page) using the variable &id=# to the URL, for example.
local httpSession = Net.FHttp("192.168.1.128",80);
response, status, errorcode = httpSession:GET("/sonos_speak/?text=hello&id=4");
As of v0.436 of the automationbridge, you can now specify a volume for the announcement, just append to the URL the following &volume=X where X is a value between 1-100, for example;
local httpSession = Net.FHttp("192.168.1.128",80);
response, status, errorcode = httpSession:GET("/sonos_speak/?text=hello&volume=20");
You can also add the Volume parameter below with the HCL version.
Example #2 - When used in Scenes.
local http = net.HTTPClient();
http : request('http://192.168.1.128/sonos_speak/?text=hello&id=56', {
options = {
method = "GET" },
success = function(response) fibaro:debug (response.data) end,
error = function(err) fibaro:debug ("Error:" .. err) end
});
Using the TTS Feature with Home Center Lite (HCL)
As the HCL does not support LUA coding, a VD is required to be created for each voice notification, this allows you to specify call the voice announcement from a scene.
Just click the Create/Update Fibaro TTS Device button, and this will create (and re-create if deleted) the example VD that you can then copy and use as required.
You will now find the example VD in your HCL controller.
Use this as a base for creating your required announcement VD's, the steps are to create a new VD, give it a name and add a single button, making sure to enter the IP address and port number (80) of the automationbridge.
Next add a button to the VD.
Now update the newly added button with the name * id (SPEAK) and code, as per the example VD, replace the {text to speak here} with the actual announcement (don't use the {} characters in the text) making sure that you keep the space between the end of the announcement and the HTTP/1.1 part.
Please also note that you will need to replace any spaces in the announcement string with %20.
For example, to announce 'the garage door is still open';
GET /sonos_speak/?text=the%20garage%20door%20is%20still%20open HTTP/1.1
0x0D0x0A
You can also adjust the announcement to go to a specific speaker, using the ID from the plugins page, just by adding &id=# at the end of the announcement string, For example;
GET /sonos_speak/?text=the%20garage%20door%20is%20still%20open&id=1 HTTP/1.1
0x0D0x0A
As from v0.436 of the automation bridge, you can also add in the volume level by using the parameter &volume=X, for example;
GET /sonos_speak/?text=the%20garage%20door%20is%20still%20open&volume=20 HTTP/1.1
0x0D0x0A
Now that you have created the VD for your required announcement, you can now call this in existing scenes like so;