Reputation: 511
I'm trying to replicate the functionality that was present in our sunsetted Conversational Actions into our Android app using Google Assistant for Android and App Actions.
We offer more advanced air conditioning controls than the current default models provided by the home integration, for instance we offer temperature controls for individual rooms which doesn't seem exist.
I've setup the following action using res/xml/shortcuts.xml
:
<?xml version="1.0" encoding="utf-8"?>
<shortcuts xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<capability android:name="custom.actions.intent.AIRCON_ON app:queryPatterns="@array/AirconQueries">
<intent
android:action="android.intent.action.VIEW"
android:targetClass="com.developer.validActivity"
android:targetPackage="com.developer">
<parameter
android:name="on_off"
android:key="on_off"
android:mimeType="https://schema.org/Text" />
</intent>
</capability>
</shortcuts>
Where the res/values/arrays.xml
contains AirconQueries
as
<string-array name="AirconQueries">
<item>Switch Aircon $on_off</item>
<item>Switch my Aircon $on_off</item>
<item>Switch the Aircon $on_off</item>
<item>Turn my Aircon $on_off</item>
<item>Turn Aircon $on_off</item>
<item>Turn the Aircon $on_off</item>
</string-array>
All this works fine in the App Actions simulator, which I assume is just calling the app intent directly but when we try and use the Assistant by typing:
Switch my Aircon on with **APP_NAME**
Switch my Aircon on in **APP_NAME**
Switch my Aircon on on **APP_NAME**
The Google Assistant seems to only want to give these commands to a registered smart thermometer, and isn't smart enough to pass it onto my app even if there is not a smart thermometer associated with the account.
We assumed that ending the request with/in/on **APP_NAME**
would trigger our custom actions.
If this is not the case is there an exhaustive list of phrases that are blocked from being used.
-- Update --
We've also tired the following invocation as per https://developer.android.com/guide/app-actions/custom-intents
Open **APP_NAME** and Switch my Aircon on
Still no luck, but at least we do not get the Smart Thermometer prompt.
-- Update --
We're based in Australia - maybe these features are not available for en-AU? The documentation is not clear.
Upvotes: 2
Views: 489