Smart Life + IFTTT + Google Assistant trigger via Webhooks - google-smart-home

Problem
I bought these LED's lights off Amazon that you setup with Smart Life, which has Google/Alexa/IFTTT integration. Which is great but when I go to IFTTT and I try to setup a webhooks to trigger the lights turning on IFTTT says the devices are not compatible and to check with the manufacturer (IFTTT has Smart Life compatibility but apparently not all devices are). I have sent out a request to the manufacturer about compatibility with IFTTT, but in the mean time I'm trying to brain storm of a way to get this to work.
Goal
I have an NFT scanner program running on Python that I would like to have the NFT scanner hit a webhook URL and it trigger changing these Smart Life lights to a certain color. Is there any other way to do this given that it does work with Google Assistant and is setup in my Google Home?
Lights for reference: https://www.amazon.com/gp/product/B07VZM3BJZ

The trick with the non-compatible SmartLife stuff is to create separate Tap-to-Run tasks in SmartLife for turning the equipment ON and OFF. IFTTT can access the Tap-to-Runs even when it cannot access the asset itself. Remember to update the link to SmartLife to include the newest additions.
Name the tasks in a logical manner because you will be getting a lot of them. Something like SL Porch ON works for me.

Related

Detect user location in React app, Can Fastly be used with Non Server Side Rendering react app?

this is my first task of detecting users' geo locations and I am a fairly new dev.
The app uses React and backend is node.js.
Currently we have some functions that calls an api which returns users' locations.( this takes a while)
But, two other options right now is use:
Geolocation API <--- this might need users' permission?
Fastly
For Fastly, I am asking
Does it work with non server side rendering app?
For production site, we have fastly set up in route53. but need to ask devops for staging environment. ( I got this info from others but do not know what that means )
Can someone even explains to me how fastly work and what needs to be set up?
Basically any information is appreciated. I do not know what should be googled to find out the answers.
Thanks.
If you have Fastly fronting your app, then YES you can definitely use Fastly to provide geolocation information.
Just to be clear (as you mentioned you were unfamiliar with Fastly and more generally are a "new dev"), when I say "fronting your app" I mean: when a client (e.g. a user's web browser) makes a request for https://yourapp.com/, does the request first get routed through Fastly? If it does, then Fastly will proxy the request through to your app and any data you send back through Fastly to the client will likely be cached to make future requests for all your users much quicker (this is one of the many functions Fastly provides).
Fastly has lots of products, but for your primary purposes there are two platform services Fastly offers:
Content Delivery (CDN) which is built on Varnish/VCL (if your ops team already has Fastly setup then this is likely what they have).
Compute#Edge which is built upon WebAssembly.
I would highly recommend reading the following resources to understand more about the Fastly platform options:
Content Delivery with VCL
Content Delivery with Compute#Edge
As far as using Fastly to handle geolocation information, I'll point you to the following resources:
https://developer.fastly.com/solutions/examples/geo-ip-api-at-the-edge
https://developer.fastly.com/solutions/examples/decorating-origin-requests-with-geoip
Also search the following page for references to "geolocation" as there are quite a few 'examples' that you might be interested in:
https://developer.fastly.com/solutions/examples/
I would also suggest having a play around with https://fiddle.fastly.dev which let's you use either VCL or any of the supported Compute#Edge languages to test out ideas without needing to have a real Fastly service setup. This will give you a chance to trial out some geolocation code.
Lastly, you can also have a read through the first half of https://www.integralist.co.uk/posts/fastly-varnish/ which covers some basics about Fastly's use of Varnish/VCL (but I'd suggest reading the official references, linked above, first).
Any other questions, then please feel free to reach out to support#fastly.com who will be happy to help.

Implementing google smart action with custom device trait

I have been trying for a while now to create a kind of "controller" for my windows pc which is integrated with google assistant.
I would like to have actions like "Turn off the internet", "Shutdown" or "Open program".
However in trying to implement this with Google smart action API I see that it "only" supports a set of traits. I know I can "reuse" different traits for different actions, like "OnOff" to control pc power, but how about starting programs on my pc?
I would like to use natural commands (Hey Google, open Word), instead of the conversational API which is (Hey Google, talk to my pc -> open Word), but I would understand if that is not possible, since the traits are how Google HomeGraph knows which devices supports the users query.
Am I going into a rabbithole of impossibilities and should I just bite the bullet and use the Conversational API?
Any open source projects which is doing this would also be appreciated, end goal is implementing something myself, but inspiration is always nice.
I previously built my own PC integration with the smart home platform and gave it a few commands.
Going through smart home means that you cannot add custom device traits. Whichever exist in the platform are it. However, there are quite a few traits available for use.
In your set of use cases, there is an AppSelector trait and a NetworkControl trait. You may be interested in using both of these.

Is it possible to restrict Alexa or an AVS device to a custom skill?

Is it possible to restrict and AVS device (a device running Alexa) to a single skill? So if I built an AI skill and have it running on a device, is it possible to keep the experience inside the custom skill so I don't have to keep saying Alexa, open
One trick you can do with AVS is to prepend every single request with a sound clip equivalent to: "ask to ..." It's definitely a hack, but I was able to use it with some success.
See my write-up here: https://www.linkedin.com/pulse/adding-context-alexa-will-blaschko-ma
The relevant parts (in case the link goes away).
Regular voice commands don't carry my extra information about the
user, but I wanted to find a way to tack on metadata to the voice
commands, and so I did just that--glued it right onto the end of the
command and updated my intents to know what the new structure would
be.
...
In addition to facial recognition, voice recognition could help
identify users, but let's not stop there. Any amount of context can be
added to a request based on available local data.
“Find frozen yogurt nearby" could silently become “Alexa open Yelp and
find frozen yogurt near 1st and Pine, Seattle” using some built in
geolocation in the device (phone, in this case).
I also use something similar in my open source Android Alexa library to send prerecorded commands: https://github.com/willblaschko/AlexaAndroid
I think you are looking for AWS Lex which allows you to write Alexa like skills without the rest of Alexa feature set.
http://docs.aws.amazon.com/lex/latest/dg/what-is.html

Angular Project Arcitectural Design

I'm new to Angular and MVC. My "Learn Angular" project is client for a home automation system. The system's server supports plug-ins (written in Python--something else to learn :-))
I have built the client with a responsive design (Bootstrap) and can get a list of all devices and their values using their RESTAPi (I'm using $http), so I'm reasonably comfortably with Angular basics now
Now I want to add functionality that will update the clients on a device statues change. (I don't want to do use polling) The plug-in architecture lets me create a plug-in that registers for changes in device states.
So here's my scenario:
I have 5 touch screen (mix of Android and iOS) around the house. All will be running my client
Let's assume they all have the lighting page shown, which has the
status of all lights (on/off/dim level).
Someone changes the living room light from 70% to 30%. This could be done by one of the clients, the native app on server or the light switch itself.
The device status on the server will change and generate a notification that my plug-in will receive
I need to update the state of the living room light on all 5 clients to show the living room light is now 30%
Not sure how I'd go about this. I'd like to do the minimum possible in Python and have no objections to using something like Node to send the notifications of that helps.
So I'm looking for suggestions on how to send this devices status change to all 5 clients (without a page refresh or polling). Can anyone help with some suggestions?
Regards
Mark

How to switch users in a smooth way in a Point-Of-Sale system?

I am designing a Point-Of-Sale system for a small shop. The shop just have one Point-Of-Sale but often they are one to three users (sellers) in the shop. Each user have their own user account in the system so they login and logout very often. How should I design the login/logout system in a good way?
For the moment the users don't use passwords, because it takes so long time to type the password each time they login.
The Platform is Windows Vista but I would like to support Windows 7 too. We use Active Directory on the Network. The system is developed in Java/Swing for the moment, but I'm thinking about to change to C#.NET/WPF.
I am thinking about an SmartCard solution, but I don't know if that fits my situation. It would be more secure (which I like) but I don't know if it will be easy to implement and smooth to use, i.e. can I have the POS-system running in the background or started very quickly when the users switch? Are SmartCard solutions very expensive? (My customers are small shops) Is it preferred to use .NET or Java in a SmartCard solution?
What other solutions do I have other than passwords/no passwords/smartcards?
How should I design the login/logout system in a good way?
Is there any good solution using SmartCards for this purpose?
I would like suggested solutions both for C#.NET/WPF and Java/Swing platforms.
I would like suggested solutions both for Active Directory solutions and solutions that only use one user profile in Windows.
How is this problem solved in similar products? I have only seen password-solutions, but they are clumsy.
An interesting solution is to use "Fast User Switching", i.e. the capability to have multiple user sessions open on the same PC. The POS software could be launched through the Startup folder of each seller account and would stay active in each seller session.
I thought that being in a domain (i.e. using Active Directory) disables Fast User Switching, but according to The old new thing, this was true on XP only. I just checked with my Win7 machine at work: it is in a domain but still has the "switch user" menu item.
The main advantage is that if your software is already multi-user aware, you don't need to change it.
I should have made the Fast User Switching check before writing what is below, because this seems to be the simplest solution. Here are other ideas, anyway.
Another solution is what you mention of having a single Windows user but several "virtual users" that your application manages. A smart card is a good way to implement a pseudo-login. In C++, the API allows detecting the removal or insertion of a card, so the application could detect this and read the card after insertion to know who's currently in front of the computer. .NET can easily call this API through P/Invoke; I don't know much of Java, except that JNI could be a solution to call the native API if there is no managed library that publishes this capability.
What should be done is researching the different types of card and how to talk to them, as your app should use a card that does not require a PIN to be accessed (or you are back to the slow login system, except if tying a 4-digit number is not considered too slow).
I've seen restaurants where waiters insert a key into the cash register in order to be identified. I googled "cash registers" but could only find a complete solution package, rather than the components like a key reader.
An almost idiotic question is: how much security do you need ? Does it make sense to have big buttons on the first screen of the app, where people click in order to tell the system who they are ? When they are done, they click on a "Finish" button and the app goes back to the "identify" screen. I've put this at the end because it is so simplistic that it has a low probability of being useful.
I'm not familiar with a broad range of smart card provider solutions, but I know Gemalto has a .Net friendly setup. Most others are geared to Java, but support is widening.
With regards to switching user sessions and your application, it depends on how "heavy" your application is. If your app requires quite a bit of start-up time / resources then you might consider creating the basic application as a service on the machine which can run in the background continuously and then you can load a light-weight UI to interact with the service with each user session (maybe launch via Startup menu).
There is a C# project on CodeProject which provides a framework for interacting with smart card services in windows - might be interesting reading.
I had a chance to work with the Open Source Computer Vision library (OpenCV)
in one of my past projects and its "Face-Recognition" is what you're after. It is written using native code, but can be easily used with Java, .NET, Android, iOS. All you need is a webcam and a button "Switch User" with the onClickListener that will take a picture and compare it with the images of your employees. Advantage? Once the picture's taken, it gets processed in less than 10ms. And as Timores mentioned earlier, once the face is recognised, you simply switch the session. Simple yet effective solution. Good luck!
maybe you want to think about using barcode scanner... probably you already have this device on POS ... my software for bars and restaurants use barcode scanner to recognize users. You have 2 options for using: first, user must log in with own barcode card, then he can use the application ... the second is better, everyone can use application, but to print the receipt user must use barcode card. After then he is responsible for that amount on this receipt.

Resources