How do I build Google smart home action that only need to communicate with my IoT Gateway? - google-assistant-sdk

As I looked into Google's references about smart home, I got to know that Google Home connects directly with the end device. But I wanted to specifically connects it with my gateway and sync with it so Google Assistant would only need to send command to the gateway to fulfill a user's request like "Turn on the light". Is this possible or Google need to connect to every end devices for it to work?

If you want, you can create a Hub device that talks to the Cloud and acts as a gateway to smaller, low-powered devices. In that case, you would still return all of your devices in the SYNC response but then handle all of the EXECUTE requests in your Cloud by forwarding to the Hub. From there the Hub can handle it however is needed.

Related

Autodesk Forge API doesn't work behind firewalls

I followed the tutorial on learnforge.autodesk.io and was able to create a functioning app that accesses data from Construction Cloud and displays them using Forge viewer. The problem is, I'm not able to access Autodesk's login screen behind a firewall (which usually happens when sales team visits a client's office).
For what it's worth, I'm using ExpressJS for backend and have HTTPS enabled. The firewall at client's site also blocks access to virtual machine services like Parsec.
I don't even know exactly what the problem is (or how to troubleshoot), all I know is that this login link:
https://developer.api.autodesk.com/authentication/v1/authorize?response_type=code
&client_id=<client_id>
&redirect_uri=<callback_url>
&scope=<scope>
doesn't work behind a firewall (it works fine through mobile data hotspot though).
So is there anything I can do on my end to make it work?
If that's not possible, what must the client do in order to access my app from behind their firewall?

How to programmatically send a message to a Teams BOT

I have a BOT running which reponds to api/messages URL from the BOT Framework Emulator, and I can send text to it.
However what I need to do is write an application which sends text to the BOT over this URL. That is basically does what the BOT Framework Emulator does when I enter text and send it, probably over the graph API.
I am aware of information which demonstrates sending to a chat in a channel, but I just need to send to the BOT itself.
Can anyone advise how I can do this, or is there a suitable sample which demonstrates it.
Thanks
At the end of the day, your bot is really just a web api endpoint. If you set up a tunneling service like ngrok, you can use it's built-in web viewer to see the traffic that is sent to you bot, e.g. via the emulator or even via the azure bot registration page (there is a similar emulator built into the page in Azure). Once you've seen that traffic, you can essentially just mirror it from whatever you want to call from - it's essentially a json payload.
However, considering your bot is just a web api, I'm not sure why you want to "call" your bot from another app. Why not just make another endpoint that you can use for app-to-app communication (like a normal api endpoint). You can then refactor your code so that whatever you need to do can be done either via a bot message OR via the API call.

IOS mobile access to Google IOT Core REST API authentication authorization scope problem

一:I would like to ask some questions about our IOS mobile access to Google IOT Core permission scope authentication. We are planning to use API services from Google IOT Core to access device-specific data;
But we encountered the problem of OAuth authentication, requesting the scope of Google API, it may take up to several weeks, I wonder if this is the case?
OAuth image
My application will use the following request scopes: https://www.googleapis.com/auth/cloudiot, https://www.googleapis.com/ auth / cloud-platform I want to be able to view and manage and manage and Create a registered device.
https://www.googleapis.com/auth/pubsub Want to use this API to publish subscriptions / topics on your phone, receive device data, and assume: temperature, humidity, alarm values, etc. Mobile terminals can access IoT data through HTTPS (https://cloudiot.googleapis.com/v1/{name=projects//locations//registries/*}) nodes.
二:Use Google Cloud Functions to connect to the cloud platform to get device data from IOS;
Google Cloud and the device have been successfully bound and deployed through the console, but it is impossible to understand how to write the Google core API from the cloud function so that the device connects to the cloud, IAM grants permissions, or the private key to access the Google API (Purpose: IOS mobile phone calls Google API through cloud functions, implements JSON interface, and gets device data for IOS) Thank you in advance, thank you!
My article might be helpful for your problem if you're still having this issue, It shows how to connect to IoT Core using CocoaMQTT and SwiftJWT, you can do something similar but instead of connecting to the specific device you could register the device with a given ES256 public key.
Controlling you phone from the cloud

Sending email in Azure IoT edge using function

For the IoT edge function, input trigger is edgeHubTrigger and the output is edgeHub. How can we send email in IoT edge using function? And will this be suggested approach to do in IoT edge or we need to send to IoT Hub and the listener function (in the cloud) listens to IoT hub send email?
If your Edge device, and your Edge function, have access to a mail server (or a service like SendGrid), then sure, you should be able to send emails. You should be able to use any .NET SMTP client library (or again, something like Sendgrid with their SDK).
If I would consider it a great design to send mails from the Edge device? This depends a bit on your scenario I would say: If you want to use some on-premise mail server, which is reachable from your Edge device but not from the cloud, then this might be a valid approach.
But if you use a mail server that you reach over the internet or some cloud mail service, then I would probably rather send those messages from the Edge to the IoT Hub in Azure (and put a property on them for routing), route them to an Azure Function and send them from there. This way you avoid putting your send logic onto each and every Edge device. Plus you automatically benefit from the message caching of the Edge Hub in case your Edge device is offline for a while.

Use Google Places nearbySearch function in iOS

In Web API, use the nearbySearch function will return the results nearby the specific coordinate.
But I cannot find a similar function in iOS SDK.
I think the worst way is using REST API likes
https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=22.979468,112.544345&radius=100&key=API_KEY by Alamofire
But I have another problem, I don't know how to restrict my API key for iOS REST API only.
I tried to set it for iOS Application but it does not work.
Please give me some idea, thank you very much!
You cannot apply iOS app restriction on web service API key. The only supported restrictions for web services are IP address restrictions. This supposes that you are executing web service requests from your backend server and restrict an API key with IP address of your backend server.
In case of mobile iOS app that means you should create an intermediate server to execute web services and pass responses back to your app in order to protect an API key that you use with web service.
There is a feature request in the Google issue tracker to add nearby search as a part of Places API for iOS:
https://issuetracker.google.com/issues/35830334
Feel free to star this feature request to add your vote and subscribe to further notifications from Google.
Hope this resolves your doubt.

Resources