element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Home Automation
  • Challenges & Projects
  • Project14
  • Home Automation
  • More
  • Cancel
Home Automation
Blog Being Lazy - Home Automation
  • Blog
  • Forum
  • Documents
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Home Automation to participate - click to join for free!
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: vimarsh_
  • Date Created: 14 Mar 2019 9:25 AM Date Created
  • Views 2225 views
  • Likes 9 likes
  • Comments 8 comments
  • homeautomationch
  • matrix voice
  • rpiintermediate
  • rpibeginner
  • matrix labs
  • projects
  • homeautomation
  • javascript
  • raspberrypi_project
  • raspberrypi
  • rpiexpert
  • rpi
  • rpi 3a+
  • matrix creator
  • project14
  • raspberrypi_projects
Related
Recommended

Being Lazy - Home Automation

vimarsh_
vimarsh_
14 Mar 2019

Note: This project is for fun purposes only. Not a commercial solution as a whole.                                            Copyright CC BY-NC-SA

image

 

Idea:

What is Home Automation? It is a very big term meaning a lot of things nowadays. Literally, it is to automate your home. Like set timer for your devices, alarms and more. But it now means a method to communicate with your devices and also making it smart. But it is just equivalent to "Being Lazy". You need a way to turn on/off the lights because you are lazy to get up. Same to control other appliances! image So, this project is intended to make your job easier by making it difficult (actually easy) to make and then enjoy your result (of code). In this project we will make our own assistant that listens to us and controls lights/fans/appliances; sets alarm for a specific task; answer some basic questions.

 

Hardware Required:

  • Matrix Creator // A wonderful board, with sensors and microphone array(x8) and FPGA  //Matrix Voice will also use the same code
  • Raspberry Pi 3A + //Any RPi >2B will work
  • A USB cable, Keyboard, Mouse, Computer, etc.
  • Any WiFi connected board // for smart clock and alarm
  • Relay / LED / Light
  • Fan / Other Appliance

Software Required:

  • Matrix Core //OS: Lib for Creator
  • Raspbian Stretch Lite //OS of RPi
  • Snips Voice Assistant API // Snips provides Private-By-Design, Decentralized Voice Assistant Technology and Solutions.
  • NodeJS //Coding Language //MQTT required
  • Coding IDE // I used Visual Studio
  • Arduino IDE // for coding other connected devices (smart clock)
  • Matrix Malos OS //mostly not required but voice recognition problem on new one OS, So?

 

Schematics:

You just need to connect Matrix board to RPi, other connection of Relay and LED, etc. is pretty simple on a breadboard. And other co-controllers will be on a network.

You don't have permission to edit metadata of this video.
Edit media
x
image
Upload Preview
image

imageimageimage

All the different connections.

 

 

Features of Matrix Creator:

 

Explained in a video in extra brief: There are a lot more and more well documented. This is a short version>>

https://www.youtube.com/watch?v=OvsmHSGuSRg

More information: https://matrix-io.github.io/matrix-documentation/matrix-creator/overview/

 

Snips.ai

Why?

Snips is an offline assistant that you can make and then use. Recently it is gaining popularity and there are a lot of sources of information using it in the community.

It is pretty simple to use and the Website is also very great!

 

For setting alarm we can make a project like this with little tweaks to make it listen to our alarm request. It is getting NTP time so just add the local timezone and compare.

Smart Clock over Cloud  - the project by F. Yao

 

For the rest, functionality follow.

 

The headphone (connecting speaker is recommended) My speaker did not have an amplifier so RPi signal was not heard at all.

image

 

Installing Matrix Core on RPi

 

From Hackster - Matrix Labs

If you haven't already, be sure to setup your Raspberry Pi with your MATRIX Device.

You can follow a guide here which walks through the whole setup, including flashing your micro SD card with our custom image (for this project), enabling ssh, and connecting to your Raspberry Pi remotely, in detail.

Enabling SSH allows the SAM CLI tool to connect to your Pi from your personal computer.

If you don't want to install our custom image, you will need to follow the steps below in order for Snips to work on your Raspberry Pi.

  • Install MATRIX Core
  • Setup JavaScript (ensure that MATRIX Core is working by running the example JS app)

 

Back

We are using JavaScript to develop our project but for other language and/or exploring the features and backed working visit

https://matrix-io.github.io/matrix-documentation/matrix-creator/device-setup/

https://matrix-io.github.io/matrix-documentation/matrix-core/getting-started/  //For Matrix Core

https://matrix-io.github.io/matrix-documentation/matrix-core/getting-started/core-installation/  //Installation guide - 2

 

Probably the Matrix Core may give errors with Audio related things which based on my experience can be fixed with Matrix Malos Installation again.

 

Setting up Snips

 

Setting up snips is very simple:

Go to https://snips.ai/  and click on sign up (if new).

image

Fill in the required data

And log into the console. You will not see any assistants if new.

image

Select Create New and the fill the details and press Create

image

To fully configure the snips follow the images below.

 

{gallery} Snips || Start-to-End

image

Add the Apps to the Assistant.

Click on add App and add apps Calculations and Weather_en. You will have to make a custom two Apps.

imageimage

Select the new App and fill in details and click on create. Then select Edit App and you will see no intents added yet.

image

Create new intents lightVal and fanVal.

image

Create a new slot named power (you can make other but change it in the code) and add training examples.

image

Add a few training examples and then double click on the variable word and select the slot. Here on and off must be selected for power. Do this for fanVal also.

See the next images for configuration.

After doing all the app must have lightVal and fanVal.image

image

Info on than intents.

image

lightVal configuration.

Making a custom slot type and slot.

image

Alarm Set application for setting the alarms.image
Details of AlarmSetimage
Time Set intent in AlarmSet App.image

 

 

Configuration

After making the assistant you need to first set up snips on your RPi. So follow Configure Snips.ai

After installing and testing with the installation of snips cli you need to deploy your assistant.

Make sure SSH is enabled on your Pi.

 

Connect to the RPi on SAM CLI on a terminal of your computer with

sam connect <RPi IP>

You will need to enter your credentials.

image

 

Then check if all services are working with

sam status

You should see that all services are working. The "snips-analytics" may not work but that is fine as it just handles some errors. If not refer to https://docs.snips.ai/additional-resources/troubleshooting

image

 

 

It will take some time to configure and then ask for credentials i.e., API Key and local region etc for the Calculations and Weather_en app.

image

Go to https://openweathermap.org/  Click on sign up and then login. Go to API Keys and "Generate" a new one and take note of that or put it in SAM CTL when asked.

image

 

Credintials of Calculatations (Currency Conversion)

image

Go to https://www.exchangerate-api.com/  Select start now after putting your details and you will get the API Key

image

Take a note of that and enter into SAM CTL when asked.

 

Then you need to deploy your assistant.

Go to snips console and select your assistant on bottom right click on "Deploy Assistant"

You will get a cmmand like this, copy and paste in your terminal os SAM CLI

imageimage

 

Now enter all the API keys and other information and your assistant is good to go.

Type

sam watch

to see how your assistant performs the job.

 

Coding

 

The code is written in JavaScript. The Matrix Core supports both Py and JS but there are more examples in JS so that is the preffered language.

Take the code from Github repo and then paste it into RPi's specific folder.

Don't forget to change the username in assistant.js and pins in other code if using a different config.

Also, change the paths to intent if changed.

Look at Matrix Documentation for working of ZeroMQ and its core and more details.

Github Repo: https://github.com/vimarsh244/Being-Lazy---Home-Automation

 

After all, is done ssh into your Pi (with Putty) and "cd" to your folder and run assistant script with

node assistant.js

 

And your assistant will be working

You can see the processing in SAM CTL and see the triggers in Putty.

 

Working

 

Demonstration and Live Example+Problems:

 

You don't have permission to edit metadata of this video.
Edit media
x
image
Upload Preview
image

 

Satisfactory Slow Motion Footage of that everloop leds:

You don't have permission to edit metadata of this video.
Edit media
x
image
Upload Preview
image

 

An earlier video with custom wake word on a simple task:

You don't have permission to edit metadata of this video.
Edit media
x
image
Upload Preview
image

 

Conclusion

This project turned out to be better than I expected and that it works. The only problem with me is that Snips needs a lot of practice to understand Indian/Asian accent and when there is more than one intent it causes a lot of problems.

But what I learned is: Home Automation projects are fun. There are long and sometimes boring but when you have a deadline they turn out to be pretty awesome.

 

<<Thanks for Reading image>>

  • Sign in to reply

Top Comments

  • jw0752
    jw0752 over 6 years ago +1
    Hi Vimarsh, Very nice and well done project. I understand the difficulty with getting voice recognition to work. I have a vocal handicap and I always have to fight with the voice recognition. I applaud…
  • aspork42
    aspork42 over 6 years ago +1
    Great job! I'm going to have to look into using Snips - it seems very useful.
  • ruchir1674
    ruchir1674 over 6 years ago +1
    I have updated version of controlling various lights using snips and matrix voice. Will soon post it.
  • ruchir1674
    ruchir1674 over 6 years ago in reply to merriam1

    Hey,

     

    I already posted that please have a look

    Home Automation Using Raspberry Pi Matrix Voice and Snips

     

    Regards

    Ruchir

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • merriam1
    merriam1 over 6 years ago
    This comment was deleted.
    • Cancel
    • More
    • Cancel
  • ruchir1674
    ruchir1674 over 6 years ago

    I have updated version of controlling various lights using snips and matrix voice. Will soon post it.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • vimarsh_
    vimarsh_ over 6 years ago in reply to aspork42

    Thanks aspork42

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • aspork42
    aspork42 over 6 years ago

    Great job! I'm going to have to look into using Snips - it seems very useful.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
>
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube