Of course, the #CrewDay does not exclude colleagues from marketing. Therefore, it is important to find topics that are relevant for all departments. Against this background, a colleague had the idea some time ago to create a new host with the help of orcharhino using voice control. A perfect project for #CrewDay! So, it wasn’t long torchlighting, but teaching our rhino to speak. Rhino? Is that a colleague at ATIX? Almost – Rhino is the „mascot“ of our product „orcharhino„. With this, data centers can be further automated and the deployment, configuration and patch management of Linux servers can be implemented under a uniform user interface.
But back to our little Alexa project: First of all, we had to explore the available possibilities. Variant one would be to write your own Alexa Skill. Variant two is the one we initially chose: As a communication intermediary between Amazon Echo Dot and orcharhinowe used Node-RED. Node-RED was originally designed by IBM and is licensed under an open source license. This means that scenarios in the Internet of Things can be put together directly in the browser as if in a modular system. In addition to Alexa, other modules are available for Google services, IRC, social media platforms and for controlling Smart Home devices. A further idea came up: Why not build a new server with the help of a tweet via orcharhino?
After the installation of Node-RED with „npm“ you can access it directly with the browser via http://127.0.0.1:1880. Further modules can be searched for and installed using the „Manage Palette“ menu on the right-hand side next to „Deploy“. Here we have added the module node-red-contrib-alexa-home-skill[1]. This module uses a server[2] in the internet with which it communicates between Alexa and Node-RED. Actually, we wanted to avoid this and implement everything locally. But then we found out that other modules[3], which are content with the local network, are no longer available. Because Node-RED, Alexa and orcharhino are not in the same network. It took a few minutes until a successful communication between Alexa and Node-RED took place. Now we could receive the first voice commands via Node-RED. The next step was to bind orcharhino. A module for sending HTTP requests exists in Node-RED. The API of orcharhino allows you to control almost everything via API calls. This includes creating content views, deleting compute resources, and starting a deployment process for new hosts. This was soon done and we could ask Alexa with „Alexa, rhino ein“ (we use rhino instead of orcharhino, because we as developers know:““Keep it short and sweet““;)) to build a new host.
Now the resolution for all those who wonder why we used „orcharhino ein“ as a command: This node-red-contrib-alexa-home-skill internally maps Smart Home functionalities such as lamp control. Therefore, the skill of Sytax and voice commands is unsuitable for our application. But let me mention this only marginally, now back to the essential: Creating new hosts using Tweet and posting a message to an IRC channel as soon as a new host is available: -)
The finished Node-RED Flow looks like this:
To control the orcharhino API we had to define the header and HTTPS Post Body. We have used the following method for this:
//set headers and payload
var payload = { "host": {
"enabled": true,
"compute_resource_id":"1",
"hostgroup_id":"1",
"location_id":"2",
"organization_id":"1",
"compute_attributes": {
"start":"1"
},
"interfaces_attributes": {
"0":{
"subnet_id":"1"
}
}
}};
// construct the result
msg.payload= JSON.stringify(payload);
msg.headers = {};
msg.headers["Content-Type"] = "application/json";
msg.headers["Accept"] = "application/json";
return msg;
After the message has been sent via „Send orcharhino HTTPS Post“, Node-RED receives the response to the HTTPS Post Request in „Set New Host Msg“. In this Javascript function we extract the name of the new host:
// Set New Host Msg{
var hostname = msg.payload.match(/"name":"([a-zA-Z-\.]*).stage.atix"/);
var msg = {};
if (hostname !== null{
msg.payload = "New Host created: " + hostname[1];
}
return msg;
In the rest of the time we thought about how to design our own Alexa Skill in such a way that we can do without the remote server and give real commands à la „Alexa, build with orcharhino a medium-sized host“. Here again we had the problem with different network segments. Unfortunately, we ran out of time to find an adequate solution. At one of the next ATIX CrewDays we want to take this up again and design our own Alexa Skill.
What have we learned:
– the voice-control over Alexa is pretty good!
– Node-RED as a tool for networking Internet of things components is very powerful!
– It’s fun to realize unusual ideas with orcharhino!
[1] https://www.npmjs.com/package/node-red-contrib-alexa-home-skill
[2] https://alexa-node-red.bm.hardill.me.uk/
[3] https://www.npmjs.com/package/node-red-contrib-alexa-local
Amazon has set standards with Alexa and Echo (Dot). It is to be assumed that our project can also be implemented with other systems such as Google Home Assistant or Apple HomePod.
What is orcharhino?
orcharhino is THE tool for deploying servers automatically in a data center, performing configuration management and being always up to date with patch management. In orcharhino several open source technologies are combined to achieve the goals of automation and standardization. In addition, orcharhino offers three core functions: deployment, patch management, configuration management and much more. Of course, everything is Enterprise compatible.