An Alexa skills kit that turns custom voice commands into entry points to an MQTT-based home automation system.
git clone https://github.com/mattmattmatt/alexa-iot.gitAn Alexa skills kit that turns custom voice commands into entry points to an MQTT-based home automation system.
No install command available. Check the GitHub repository for manual installation instructions.
git clone https://github.com/mattmattmatt/alexa-iotCopy the install command above and run it in your terminal.
Launch Claude Code, Cursor, or your preferred AI coding agent.
Use the prompt template or examples below to test the skill.
Adapt the skill to your specific use case and workflow.
Create an Alexa skill that allows users to control their home automation system via voice commands. The skill should integrate with an MQTT broker to send commands to devices. The skill should support commands for [DEVICE_TYPE] in [ROOM_NAME] such as 'turn on', 'turn off', 'set brightness to [VALUE]', and 'set temperature to [VALUE]'. Provide the necessary code and instructions for setting up the skill and connecting it to the MQTT broker.
## Alexa Skill for Home Automation
### Overview
This Alexa skill allows you to control your home automation system via voice commands. The skill integrates with an MQTT broker to send commands to your devices.
### Supported Commands
- Turn on/off devices
- Set brightness levels
- Set temperature
### Setup Instructions
1. **Prerequisites**: Ensure you have an MQTT broker set up and running. You will also need an Amazon Developer account to create the Alexa skill.
2. **Create the Alexa Skill**: Go to the Alexa Developer Console and create a new skill. Choose the 'Custom' model and 'Provision your own' backend.
3. **Define the Interaction Model**: Add the necessary intents and slots for your devices and commands. For example:
- Intent: `TurnOnIntent`
- Slot: `DeviceType`
- Slot: `RoomName`
- Intent: `SetBrightnessIntent`
- Slot: `DeviceType`
- Slot: `RoomName`
- Slot: `Value`
4. **Implement the Backend**: Use the Alexa Skills Kit SDK to handle the intents and send the appropriate MQTT commands. Here is a sample code snippet in Node.js:
```javascript
const Alexa = require('ask-sdk-core');
const mqtt = require('mqtt');
const client = mqtt.connect('mqtt://your-mqtt-broker');
const TurnOnIntentHandler = {
canHandle(handlerInput) {
return Alexa.getRequestType(handlerInput.requestEnvelope) === 'IntentRequest'
&& Alexa.getIntentName(handlerInput.requestEnvelope) === 'TurnOnIntent';
},
handle(handlerInput) {
const deviceType = Alexa.getSlot(handlerInput.requestEnvelope, 'DeviceType').value;
const roomName = Alexa.getSlot(handlerInput.requestEnvelope, 'RoomName').value;
client.publish(`home/${roomName}/${deviceType}/set`, 'ON');
return handlerInput.responseBuilder
.speak(`Turning on the ${deviceType} in the ${roomName}`)
.getResponse();
}
};
exports.handler = Alexa.SkillBuilders.custom()
.addRequestHandlers(TurnOnIntentHandler)
.lambda();
```
5. **Test and Deploy**: Test your skill using the Alexa Simulator in the Developer Console. Once tested, deploy your skill to the Alexa Skills Store.AI-powered recruiting for top talent
Your one-stop shop for church and ministry supplies.
Automate your browser workflows effortlessly
IronCalc is a spreadsheet engine and ecosystem
Enterprise workflow automation and service management platform
Automate your spreadsheet tasks with AI power
Take a free 3-minute scan and get personalized AI skill recommendations.
Take free scan