Project Alice core casing

Back to school and childhood, where we spent hours building whatever possible with cardboard.

When you want to test something, you need to prototype it, and cardboard comes very handy when trying to put a casing together! So yes, I spent hours cutting, shaping, hot gluing, taping pieces of cardboard to give Alice, core module, a housing, that holds her screen, speaker, mic array, leads, power supply and that let’s you access the components in case something goes wrong, access the SD card etc etc.

Well, I won’t do a long post about this one, but just give you a series of picture I made while having fun doing it! And a little video of course ūüôā

 

 

 

This is step one, before doing better, again with cardboard. Cardboard until good design is found then I’ll move to 3D printing.

Concerning the sound:
The confirmation sounds (“Yes?” after hotword and the chime after my commands) are played on device.

Alice then answers using my Sonos that is about 2m further away, explaining why you hear it lower. This is a mod I did for Snips to be able to use my Sonos as a speaker.

The music also comes from the Sonos 2m further away.

 

Dev safe!

Project Alice – From a dumb light to a smart light

You surely have some lights at home you wish you could control with your voice. Then you went on internet or your local store only to find out that the lamps you’d like to have are far from being smart. Of course, Philips Hue does nice lamps, but they don’t do everything. I like those hanging lamps, over my bar in my kitchen, so I thought “Hey, why not actually turn this one into a smart lamp?

So I planned the transformation…. Went online, bought a Philips Hue led strip and a remote (one more….), took the lamp off my ceiling and started the work, by unscrewing the nice glass plate that protects the inside, the original leds.

20180324_180938

Then I started taking the leds off, they were attached by 2 screws plus a funny plastic band that is not gluing but still holds tight…

20180324_181448

Took them all off, carefully, as they can still be of some use later

20180324_181957

Then I had to find a place for the Philips Hue receiver…. I could have hidden it in the lamp base but that was taking the risk of if not being controllable. And those hanging lamps can go up and down, the current is transmitted by both cables. Philips Hue led stripes need 6 cables (VCC, warm white, cold white, red, green, blue). Decided to glue it on top of the led base. Then came the painful moment, the moment when you cut your brand new hardware cable. At that point, you know there’s no going back…

20180324_183629

For that little receiver, I needed to get power, as the original, through the hanging cables. So, I had to make a little hole just beside it….

20180324_18411520180324_184123

Then connecting the receiver to the lamp cables was very simple

20180324_19011020180324_190119

Ok, this part was done, now, I needed to place the Philips power adapter and get rid of the 48v original supply

20180324_191200

Lucky me, the Philips power adapter come with the removable pins, to maximize compatibility across countries… So well, I decided not to use any pin, unsoldered the wires from the original power adapter, resoldered them on the Philips supply, before gluing it in the lamp base.

Now, powering the two lamp cables is done through very easily. I used the original Philips Hue cable that came with, the other end I had cut from the receiver and mounted the two metal pieces on them before placing them back on place. With the gravity, the metallic cables holding your lamp are always on contact with these little metal pieces, powering your lamp!

20180324_19345620180324_193804

Another hole later for the 6 cables of the Philips receiver, a whole bunch of soldering and some taping later, the led stripe is placed in the lamp!

 

Then came the first powering test… I unfortunately did not take any picture…. Why? Because, you know, Philips does mark where you can cut the stripe. But I seldom follow the rules and decided to cute where I wanted… Big mistake, never do that! A whole bunch of leds at the end weren’t working anymore…. So I started to rework the band and resoldering the missing resistance on the stripe…. And I turned the start connector around, to gain some more space

20180325_154607

A lot of Tesa tape later, the plastic shell of the led stripe removed, the stripe was finally placed in its shell. If you look carefully, the band is bent at the end, because I didn’t want to make the same mistake again and cut the band where I’m not supposed to…

First powering test! It works! Jumped on my phone and tried to detect the led strip, which I did almost instantly!

20180325_16095620180325_161007

The nice glass protection was originally screwed on the lamp, but I couldn’t go through the led stripe anymore, so… Tesa here we go again!!

20180325_16440320180325_164405

Placing the lamp back on it place…. Apart from the little white box, the Philips Hue Receiver and controller, it looks as it always did! And let there be light!

20180325_17314320180325_170827

 

Then of course, this topic is titled “Project Alice” so¬†it’s voice controlled! Here a very short video of it:

 

I hope you enjoyed this little hack! Dev safe!

 

Links? Links!

Project Alice – Invade Sonos!

What’s important with a voice assistant? The reaction, the functions, its understanding are one thing but the quality of its speech is also very important. The quality of its speech can be achieved by having a good TTS engine, but also by having a good sound output!

So I thought, “Hey, I have these perfect Sonos units scattered around in my house, why not make Snips speak through these?”

So I started to search for a solution, how to make Snips able to take over Sonos and use the hardware for sound output… But not by altering anything, I still want to be able to listen to some music!!

And so I found a solution, using Sonos playlists, NFS, my Synology, a custom TTS, a clever bash script and some python!

 

Of course this video just shows it working, but but but… There’s more! Of course, if you have Snips and some Sonos units, you most probably already implemented voice control for them… So, isn’t it wonderful to be able to set the volume? How about Snips speaking louder in a loud environment and maybe be more quiet in quieter environments? Or maybe speak a bit lower at night? All this is possible and very easy if you go through your Sonos!

If you are Sonos and live in many rooms, you most probably have more than one unit… How about Snips responding on the correct Sonos unit depending where it heard you? Very easy with the Sonos existing implementation!

I’m so excited about this I have to admit! The above ideas are already semi implemented (as I usually work in a “proof of concept” way), but I have many other ideas with this!

As usual, stay tuned for more and dev safe!

 

Few links?

Project Alice – Arbitrary text

Snips is great! You gotta admit it!

Even though it’s great, there’s something I was missing… The AI that will rule my house has to be able to understand whatever I say, without me adding every single and possible phrases I could tell it to its brain.

That’s exactly where most of us struggle: Snips being able to catch and treat arbitrary texts, strings that were never declared anywhere.

Why? Well, let’s say you have a shopping list module, you want to be able to add stuff to it without teaching Snips everything you could ever say.

Take that example:

Alice? Add an item to my shopping list
-> Sure! What shall I add to your shopping list?
Geforce 1080 ti OC 11GB Rog Strix from Asus

Who’s gonna tell me he did an intent with that phrase? Sure, the first one yes, but the item itself will most likely fall into: intentNotRecognised. And that’s exactly where I react! Using intentNotRecognised¬†we are able to return what was heard by the ASR (but not understood by the NLU) and use it!

The only trick behind this, is that Snips doesn’t load the session payload when triggering intentNotRecognised, but with¬†a couple of lines we can very easily keep a track of the sessions and their data! We end up having a functional shopping list, or in the example video, a functional reminder that can remind you whatever you want, without teaching it to Snips!

 

Sorry for my babbling and confusion in this video, I’m a bit off today, but I never do post processing! Yes, the hotword is still too sensitive, it’s still a WIP ūüôā

Hope you enjoyed! And as I said, let me know if you are interested for a guide! Dev safe!

 

The now traditional links:

 

logo with snips

 

Off topic

Yes, I know my table is a mess, I did not set it up for the video, I actually work daily on it and shoot natural videos whenever I feel like it!

Project Alice – Language hotswap

I live in Switzerland, in the french speaking part of it. My mother tongue is french. I have friends stoppping by at my home, speaking german, or swiss german, which I speak also. But then I grew up speaking a lot english and even spent some time in UK to learn it at school. My neighbours are Americans and 90% of my online chatting is in english. But hey, my wife is Finnish, so she speaks finnish and does understand some russian and Swedish, but we speak mostly english together, along with some french. Oh, I spent some time in the past in St-Petersburg, so russian isn’t totally unknown to me… And sometimes I talk to my cats, not that they understand though

Complicated hu? Well, try to explain that to Snips! Ok, let’s face it, we speak 99% of the time english with my wife, and I rather speak english to Alice. But I thought, what if my dad comes over? Well, let’s try to make Snips speak both french and english! The following video is step one:

I can ask Alice to change her language, by voice command! And it works pretty smoothly!

In the video I do demonstrate using only the getTime command, but it works on all my intents (38 as we see when I start Alice). The idea behind it is to have 2 assistants made on Snips, with the exact same intents and slots, but one in english, the other in french (apply to your languages). I downloaded them both, uploaded them on Project Alice, in different folders tagged with the language code. When the switchLanguage intent is detected, Alice removes the assistant actually in use under /usr/share/snips and copies the language selected one in that place, before restarting snips services and vocally confirm the switch in the new language. No dark magic here!

But then why step one? Because, my idea, step two, is to make it invisible to me, my wife and the persons usually hanging around at our place. How? Well, I want to use Piwho to identify who is speaking and make it possible to listen and answer in the predefined language! Oh well, that’s gonna be in a while! But it’s totally possible, I made some advance already, but not stable enough yet to demo.

Using Amazon Polly on your Pi is not that hard. I found the basic script on tschmidty69 Github repo (thank you btw!). I modified it just a little (a little more mabye, dunno) and it simply works!

And yes, stay tuned for the tutorial, I’m actually dumping all this to a Github repo with the instructions to make it work.

Cheers, code safe!

EDIT:
Repository: https://github.com/Psychokiller1888/snipslanghotswap

Oh, btw, wanna follow me? Twitter and Youtube

Some links?

Alice? Where’s my phone?

How many times did you ever ask yourself: “Where is my **** phone” or “where did I leave my phone?”. How many times did your wife / girlfriend / partner / kid ask you “Can you please call my phone, I can’t find it”. Of course you took your phone and called on their number, only to find out it’s actually ringing, but was left on mute…

Well, introducing Project Alice “Find my phone” module! It’s actually pretty simple, ask Alice to find your phone, she’ll confirm what phone you’re looking for, and call it! But instead of just calling it, she’ll make sur to unmute it before! How does that work? Well, the answer is simple: IFTTT applet! Alice recognizes your intend through Snips, if the name is unknow (my wife’s phone in the video) tries to find out who it is and asks for confirmation and then sends two requests to IFTTT, one to unmute and the other to call the phone. The very first time you’ll be asked by your Android device if IFTTT has rights to unmute your phone and go through “Do not Disturb”, past that it just works!

Yeah, I said “Android”. As sad as it sounds, I didn’t find any “Unmute” action for IOS on IFTTT. I’m an Android guy, so it’s ok for me, but for those looking for a solution of IOS, you’ll be able to call the phone, but I’m not sure you gonna be able to unmute it.

Enjoy the video and see you soon for another Project Alice module! There is a severe lag on the video, when the command is treated, I guess this was a bad internet connection day!

 

A few of links as usual: