Эта страница является
переводом страницы
Amazon Alexa (v3). Перевод выполнен на 100%.
Amazon Alexa (v3)
voice control of equipment via iRidium and Amazon Alexa (3rd version of API).
documentation was last updated on 28.7.2021
Alexa is a voice assistant from Amazon, built in the Amazon Echo smart speaker and other devices, for example,
- Echo Plus,
- Echo Dot,
- Amazon Tap,
- Echo Sub,
- Echo Show,
- Fabriq Chorus and other Alexa-enabled devices by third-party manufacturers.
iRidium Assistant skill understands several languages:
- English (Australia),
- English (USA),
- English (UK),
- English (India),
- Spanish (Spain),
- Spanish (Mexico),
- Spanish (USA),
- Italian,
- German,
- Portuguese (Brazil),
- Hindi,
- French,
- Japanese.
You can see the uptodate list of supported languages at Amazon website or in the Alexa App.
Alexa can control smart home with the help of "iRidium Assistant" skill via iRidium cloud and iRidium server. You can say "Turn on light" and the lamp is turned on. You can say "Turn off light" and the lamp is turned off. It's easy!
Working in iRidium studio
Adding a Driver and Devices
1 Create a server project.
2 Add Amazon Alexa (v3) Network driver to a project.
3 Add smart devices to the project.
4 Change the device names the way you would like to pronounce them when talking to Alexa.
Feedback channels of devices can't be changed as they have a meaning.
Description of Devices and Feedback Channels
Amazon Alexa devices are not real devices they are just interfaces between real devices and Alexa. You are to realize functions of these devices in iRidium server or provide connection with physical devices via a protocol. iRidium provides interfaces with different types of devices:
- Contact sensor,
- Montion sensor,
- Door,
- Curtains,
- Switch,
- Thermostat (Heat - Cool),
- Thermostat,
- Light Color Temperature,
- Light Color,
- Light,
- Dimmer.
But it does not limit your capabilities to work with other devices. For example, you can realize control of a relay using a binary device of the Switch type.
You do not have to use all feedback channels of a device. Use only the ones you require.
Contact sensor
Limit switches, contact thermometer, sensors.
| Feedback |
Description |
Action |
Examples of voice commands
|
| State |
State: found / not found |
Detected, NotDetected |
"Alexa, is Contact sensor open?"
|
Montion sensor
Automatic control of lighting.
| Feedback |
Description |
Action |
Examples of voice commands
|
| State |
State: found / not found |
Detected, NotDetected |
-
|
Door
Control of a door lock.
| Feedback |
Description |
Action |
Examples of voice commands
|
| State |
Opening / closing |
Lock, Unlock |
"Alexa, lock the door " "Alexa, unlock the door "
|
Curtains
Control of blinds
| Feedback |
Description |
Action |
Examples of voice commands
|
| Range |
Per cent |
setPercentage incrementPercentage decrementPercentage |
"Alexa, set curtains to hundred percents" "Alexa, raise curtains by five percents" "Alexa, lower curtains by two percents"
|
Switch
Switch, light, relay.
| Feedback |
Description |
Action |
Examples of voice commands
|
| Power |
On/Off state |
turnOn turnOff |
"Alexa, turn on switch" "Alexa, turn off switch"
|
Thermostat (Heat - Cool)
Control of a thermostat with a limit of max and min temperature.
| Feedback |
Description |
Action |
Examples of voice commands
|
| Cool Target Temperature |
The upper limit of temperature |
getTemperatureReading getTargetTemperature |
"Alexa, what temperature is my thermostat set to?"
|
| Heat Target Temperature |
The lower limit of temperature
|
| Power |
On/Off state |
turnOn turnOff |
"Alexa, turn on thermostat " "Alexa, turn off thermostat"
|
| Sensor Temperature |
Temperature from a sensor |
getTemperatureReading getTargetTemperature |
"Alexa, what thermostat temperature?"
|
| Target Temperature |
Set temperature in degrees |
setTargetTemperature incrementTargetTemperature decrementTargetTemperature getTargetTemperature |
"Alexa, set thermostat to thirty degrees" "Alexa, increase thermostat by five degrees" "Alexa, reduce thermostat by two degrees" "Alexa, make it warmer in here" "Alexa, make it cooler in here" "Alexa, what is thermostat target temperature?"
|
| Temperature Mode |
Mode of work |
setAuto, setECO, setHeat, setCool, setOff. |
"Alexa, set thermostat to cool mode" "Alexa, set thermostat to heat mode" "Alexa, off thermostat "
|
Thermostat
Control of a thermostat
| Feedback |
Description |
Action |
Examples of voice commands
|
| Power |
On/Off state |
turnOn turnOff |
"Alexa, turn on thermostat " "Alexa, turn off thermostat"
|
| Sensor Temperature |
Temperature from a sensor |
getTemperatureReading getTargetTemperature |
"Alexa, what thermostat temperature?"
|
| Target Temperature |
Set temperature in degrees |
setTargetTemperature incrementTargetTemperature decrementTargetTemperature getTargetTemperature |
"Alexa, set thermostat to thirty degrees" "Alexa, increase thermostat by five degrees" "Alexa, reduce thermostat by two degrees" "Alexa, make it warmer in here" "Alexa, make it cooler in here" "Alexa, what is thermostat target temperature?"
|
| Temperature Mode |
Mode of work |
setAuto, setECO, setHeat, setCool, setOff. |
"Alexa, set thermostat to cool mode" "Alexa, set thermostat to heat mode" "Alexa, off thermostat "
|
Light Color Temperature
A lamp, a ceiling lamp, a night lamp, a wall lamp with a changable light temperature.
| Feedback |
Description |
Action |
Examples of voice commands
|
| Brightness |
Per cent |
setPercentage incrementPercentage decrementPercentage |
"Alexa, set light to hundred percents" "Alexa, raise light by five percents" "Alexa, lower light by two percents"
|
| Power |
On/Off state |
turnOn turnOff |
"Alexa, turn on light" "Alexa, turn off light"
|
| Color Temperature |
Light temperature |
setColorTemperature |
"Alexa, set the light softer" "Alexa, make the light warmer" "Alexa, set the light cooler" "Alexa, make the light white"
|
Light Color
A lamp, a ceiling lamp, a night lamp, a wall lamp with RGB control.
| Feedback |
Description |
Action |
Examples of voice commands
|
| Brightness |
Per cent |
setPercentage incrementPercentage decrementPercentage |
"Alexa, set light to hundred percents" "Alexa, raise light by five percents" "Alexa, lower light by two percents"
|
| Power |
On/Off state |
turnOn turnOff |
"Alexa, turn on light" "Alexa, turn off light"
|
| Color |
RGB |
setColor |
"Alexa, set the light to red" "Alexa, set the front porch light to blue" "Alexa, set the bedroom light to red" "Alexa, set the kitchen light to blue"
|
Light
Control of dimmable lamps.
| Feedback |
Description |
Action |
Examples of voice commands
|
| Brightness |
Per cent |
setPercentage incrementPercentage decrementPercentage |
"Alexa, set light to hundred percents" "Alexa, raise light by five percents" "Alexa, lower light by two percents"
|
| Power |
On/Off state |
turnOn turnOff |
"Alexa, turn on light" "Alexa, turn off light"
|
Dimmer
A one-channel dimmer, an electrical warm floor.
| Feedback |
Description |
Action |
Examples of voice commands
|
| Power |
On/Off state |
turnOn turnOff |
"Alexa, turn on dimmer" "Alexa, turn off dimmer"
|
| Level |
Per cent |
setPercentage incrementPercentage decrementPercentage |
"Alexa, set dimmer to hundred percents" "Alexa, raise dimmer by five percents" "Alexa, lower dimmer by two percents"
|
Creating Script
The script provides acceptance of voice commands from Alexa and redirects them to real devices. In this example they are devices in the Modbus TCP network.
To create a driver, do the following:
1 Create a server project *.sirpz;
2 Add a script, by pressing JS > + > New script.
3 Add a template to the script and set connection between Alexa subdevices and equipment:
//Let's get a link to the "Amazon Alex (v3) Network" driver.
var l_pDevice = IR.GetDevice("Amazon Alexa (v3) Network");
if(l_pDevice)
{
//Log the name of the device from which the feedback came and its value
IR.AddListener(IR.EVENT_TAG_CHANGE, l_pDevice, function(name, value){
IR.Log("Name: " + name + " Value: " + value);
switch(name)
{
case "Dimmer:Level":
IR.GetDevice("Modbus TCP").Set("Dimmer:Level", value);
break;
case "Switch:Power":
IR.GetDevice("Modbus TCP").Set("Switch:Power", value);
break;
case "Contact sensor:State":
IR.GetDevice("Modbus TCP").Set("Contact sensor:State", value);
break;
case "Light Color:Color":
IR.GetDevice("Modbus TCP").Set("Light Color:Color", value);
break;
case "Thermostat (Heat-Cool):Power":
IR.GetDevice("Modbus TCP").Set("Thermostat (Heat-Cool):Power", value);
break;
}
})
}
When you use feedback channels in Amazon Alexa Network driver, specify the subdevice name, a colon and the name of a feedback channel . A complete list of subdevices and feedback channels can be found in the "Describing Devices and Feedback Channels" section.
6 Upload a project on the server via iRidium cloud;
7 Synchronize a project with Alexa.
Important:
- Device names in the driver must be unique;
- Use English in subdevice names;
- You can't create and (or) edit feedback channels, each Alexa device has a standard set of feedbacks, which Alexa uses;
- A project must be launched on the server for searching devices in the Alexa App.
Uploading a Project to iRidium cloud and Server
1 Sign in at iRidium mobile web-site.
2 Upload a server and a panel project to iRidium cloud.
3 In Users and Panels tab add an end-user to the project.
4 Start iRidium server.
5 Enter the server web-interface by entering the following in the browser address line:
<IP-адрес сервера>:8888
If iRidium server is launched on the same PC where it is set, enter the following:
127.0.0.1:8888)
6 Enter the password by default - 2007. Click "LOGIN".
7 Find the Cloud / Projects tab.
7 Download the project from the cloud by clicking the "CLOUD SYNC" button and then click the "Download" button next to the name of a required project.
Alexa works only via iRidium cloud, that's why it can't work if a project is uploaded on the server via iRidium transfer.
Setting Alexa
Registration of Smart Speaker
Alexa is set with the help of Alexa App on mobile devices or in the Amazon web-service on a laptop or a PC.
Wi-Fi is required for direct connection to the smart speaker.
1 Register at Amazon web-site, if you do not have an account there.
2 If you work on a mobile device Alexa App is offered for download. If you work on a laptop or a PC you can go on setting on Amazon web-site.
Operation systems where Alexa App can work:
- Fire OS 3.0 or later,
- iOS 9.0 or later,
- Android 5.0 or later,
- Windows 10 of 17134.0 version or later.
Make sure that Alexa App is availble for download from Google Play or App Store in your region.
3 Register the smart speaker step by step following the instructions on the screen.
Installing Skill
The skill is installed only in Alexa App.
1 Start the app. Go to the Devices tab and click YOUR SMART HOME SKILLS, to see all set skills of a smart home.
2 Click ENABLE SMART HOME SKILLS button to add a new skill.
3 Enter iridium assistant in the search line to finf the skill and click on it.
Amazon Alexa (v3) works only wiyj iRidium assistant skill and does not connect to the old iRidium skill. The iRidium assistant skill supports single cloud connection for all voice assistants.
4 Read about the skill and then press the ENABLE TO USE button.
5 You will get to a registration form on iRidium mobile website. Enter login data of a definite end-user, who a panel project is shared with, and click Login.
8 Select the object which Alexa will work with in the drop down menu. Press Grant Access.
7 Alexa is successfully connected to iRidium object.
Downloading devices from iRidium cloud
1 Press DISCOVER DEVICES.
2 The process takes about 20 seconds.
3 Devices from iRidium server project are automatically uploaded to Alexa App.
Devices are uploaded only if iRidium server is launched and a project with Alexa is uploaded to it.
4 If you make changes in a project, remember to upload it in iRidium cloud and then update in on iRidium server. After it press Add Device button in the Smart Home tab in Alexa App.
Testing a project
A server project can be started in the same PC where you work in iRidium studio. But the project must be uploaded only via iRidium cloud.
Say voice commands to Amazon Echo and Alexa sends them to iRidium server and the server executes them according to the script.
You can use any emulator of Modbus TCP server, for example, this free one Modbus PLC Simulator to test a project.
You can register one Amazon Echo speaker in several iRidium objects. Keep in mind that voice commands are sent to all available (working) iRidium servers, thus control conflicts can happen. Remember to delete non-functional or test projects with Alexa from iRidium cloud.
Temperature measure units (degrees of Celcius or Farenheit) can be changed in the regional settings of Alexa App.