How to send direct command from Google Home to custom smart device without app name? - mqtt

I try to build my custom IoT device that will be controlled via Google Home device, and serve people with disabilities.
The device itself is Tiva C Launchpad, that I program from scratch, meaning I will have a full control on it.
In my vision, the user wil say something like: "Ok Google, press play button", and as a result, the Google Home device will send a direct command of press_play_button to the IoT device, preferably via the local network.
I found the Google Action SDK, alongside with the Local SDK extention, but if I understood correctly, I have to be in the app mode first ("OK Google, play {app_name}") before pronouncing the action I want, which is inconvenient.
Is there any way to achieve my requirement?
If not, I may give up on the local network control, and use sort of a webhook to send HTTP request to my smart device, and in that case I wonder if MQTT will be more suitable.
Thanks.

The Local SDK is an extension to the Smart Home API. If your device matches up with the device types and traits that the Smart Home API supports then you can use that to control your device.
It has support for media players so things like play/stop should be possible.
I have build generic Smart Home control using MQTT to reach the device, but you have to provide a HTTP endpoint for the Google System to interface with. This take a little thought as you have to map MQTT asynchronous approach to HTTP's synchronous nature.

Related

Cannot run Google Home assistant routines by conversation relay

I'm using google assistant relay (https://github.com/greghesp/assistant-relay/) on Raspberry PI. My objective is to allow my automation (jeedom) server to run Google actions. For basic instructions, everything is ok, such as switch on the light of a room. But when trying to run a Google Home routine command (for example, "lunch time" that should light on living room, light off tv room) assistant doesn't run routine but answer such as if routine was not existing, for example it tries to search for a restaurant named "lunch time".
I registered a device (obtaining model id and device id) and put reference of this device in the relay system but it does not work better, same result.
In Google Home app, I set for this device permission to execute with personal data but same result.
I expect to launch routines with my relay in order to allow my jeedom server to put some advanced tasks to Google.
Developer of Assistant Relay here.
I'm not sure if the triggering Routines is a SDK limitation or not. Some people seem to have had success with Hass.io's integration, however I've not managed to get it to work (not looked into it too much)
I'm working on V3 so will see if I can get it working

Smart home device integration with Google home and Alexa

I am trying to integrate smart home devices with Google home and Alexa but I am facing following issue.
Communication between Google Home/Alexa and our device cloud server is HTTP.
Communication between smart home device and our device cloud server is MQTT.
How do I keep track of synchronous request-response? Is there a better way to implement this system?
Perfectly possibly to do with HTTP to MQTT and back again.
I've done it for both Alexa & Google Home for my Node-RED nodes.
You just need to keep track of on going requests and include a unique id in the request/response MQTT messages while also running a timer to handle no response from the device.
The project gBridge (https://github.com/kservices/gBridge; https://about.gbridge.io) basically implements plain Google Assistant/ Alexa to MQTT bridging.
Regarding your questions, there are two points that help to implement these solutions:
Think in terms of devices or endpoints, rather than requests. When you just want to "translate" HTTP to MQTT, you are inducing a lot of issues like you've figured out. You probably want to implement a logic that allows MQTT topics to control/ query your actual deviecs - not ones that respond to HTTP requests. This makes thing a whole lot simpler.
Caching is essential. Allow your bridge to have a local copy of your device's states. When having the properly implemented cache, you won't need for any response. Just use the cached data.

See devices connect to my wifi router using Swift and allow/block wifi acces

In short i'm trying to build an App that will grant/block wifi access to my son's wifi for his Ipad and his PS4 remotely using an App. I researched the topic and can't figure out how this can be done. Ideally i'd like to be able to grant/block wifi access independently Ie. block wifi to the Ipad and allow PS4.
How can this be done, no need for the full code ( well if you insist i'll take it ) but just point me in the right direction.
Depending on the router you're using you're going to need to write something that interacts with the router's API, if it has one. If it doesn't, you will need to replace the firmware on your router with something like ddwrt that can be scripted. From there, you might be able to create an app that talks to the router's API.
TLDR: You're probably better off simply bookmarking the management page for the router and enabling/disabling access for the devices.
Edit:
It occurred to me that some mainstream consumer router/access point manufacturers (Linksys, Asus, etc) have companion apps for managing their devices from the LAN side. You should see if such an app exists for your router, and if not, perhaps consider getting a different router that supports such an app.

How to access calendar.readonly oauth-2.0 service from an IoT device?

I want to access private calendar content in read-only, from an IoT device.
This device is programmed in C, and has full REST capabilities meaning that I am able to build HTTP requests in the device, but I don't have any way of interracting with it (no screen, no keyboard).
I found a way to do this (using google data api), but it is completely deprecated.
What is the procedure to follow for doing this?

Does the Sony qx10 api support multiple simultaneous clients?

Apologies in advance for the general-ness of the question.
I'm writing a multiple client iOS app for viewing the video feed from a single camera. Can the QX10 api support two (or 3) iPad's discovering/viewing the same QX10 at the same time?
I've been looking QX10 sample code, the camera api docs, StackOverflow, and of course the dev website and haven't seen an answer. I'd just buy the bloody thing to test with, but there are none nearby and I was hoping to avoid having to mail order/return it if it didn't work.
....And we're not locked into HW. If there's a better option, I'm open....
I don't believe it does. For ios, the camera creates a network that the ios connects to. (In ios settings/wireless) Any further attempts to connect to the camera from another device fail. Since the API only works after a network connection is established, I don't see how the API could possibly allow 2 devices could connect at once.
(No extraneous words in this post b/c that will get edited which auto down votes the question.....ahhh internet)
I did not try it, but you could use a computer with nat. For example an openrwt router to open up multiple wifi interfaces, one to connect to the camera, using the 10.0.0.0 network the camera uses and then an other network to connect your clients with NAT.
The question would be when the API would start to get confused.
So depending on what you want, maybe some mapper on that helper-computer could
do some proxying of information.
So in theory with an external box, maybe, but as Oldmicah said, it seems that only
one device can connect at the time (at least my QX100 also behaves like that). :(

Resources