i8beef / HomeAutio.Mqtt.GoogleHome

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PIN and Acknowledge challenge not working in Google Home App but via voice in Google Assistant

fightforlife opened this issue · comments

Hello there,

this is more of a question than a real issue.
I tried to lock one of my devices OnOff-Trait with a PIN challenge.
Over Google Assistant via voice everything is working as expected. Google asks for my PIN before triggering the trait.
But in the Google Home App on Android I am not asked for a PIN. And the trait is never triggered, because "status":"ERROR","errorCode":"challengeNeeded","challengeNeeded":{"type":"pinNeeded"}}]}
(same for acknowledge)

To me this looks more like an issue on Googles side of things. Is there any expierence with this in the Google Home App?

Thanks in advance!

Well, Google says: Google Assistant uses dialog to issue the challenge, but if you use Google Assistant on non-voice surfaces, PIN and confirmations are done on-screen. (https://developers.google.com/assistant/smarthome/develop/two-factor-authentication)

That appears to be a lie though in the Google Home app. I can't make a challenge work on mine either.

Closing as a Google bug. You should report this to them on their bug tracker (if you can find it). Heres a few resources to help figure out where to report that (your guess is as good as mine, typical Google documentation / clarity).

https://developers.google.com/assistant/smarthome/support
https://developers.google.com/assistant/support

Hello,
I'm also looking for a way to secure some action with pincode.
Does it work now?
Would you have an example of a config entry to use so it can only be triggered after a valid pin code ?

Thanks :)

On any given trait there will be a "challenge type" option. Just change that to PIN and set the appropriate option that pops up.

Hello, thanks for the answer, but I still can't get it :(
I tried the following :
`
"traits": [
{
"trait": "action.devices.traits.OnOff",

    "commands": {
      "action.devices.commands.OnOff": {
        "on": "cmnd/tasmota-desktop-light/POWER"
      }
    },
    "state": {
      "on": {
        "topic": "cmnd/tasmota-desktop-light/POWER",
        "googleType": "bool",
        "valueMap": [
          {
            "mqtt": "ON",
            "type": "value",
            "google": "true"
          },
          {
            "mqtt": "OFF",
            "type": "value",
            "google": "false"
          }
        ]
      }
    },
  "challenge": "pinNeeded"

  }
],
"customData": null

}

`
But it doesn't work. I also tried quite few combinations but I can't make it work.
Could you share some code snippet to protect that trait with a pin code? Sorry if it's dumb question but already spent quite some time on it and lost quite few hairs ...

The interface makes this easier, but this is the JSON that would get output for an OpenClose trait

        "trait": "action.devices.traits.OpenClose",
        "attributes": {
          "openDirection": [
            "UP",
            "DOWN"
          ],
          "queryOnlyOpenClose": false
        },
        "commands": {
          "action.devices.commands.OpenClose": {
            "openPercent": "MQTT_TOPIC"
          }
        },
        "state": {
          "openPercent": {
            "topic": "MQTT_TOPIC",
            "valueMap": [
              {
                "google": "100",
                "mqtt": "255",
                "type": "value"
              },
              {
                "google": "0",
                "mqtt": "0",
                "type": "value"
              }
            ]
          }
        },
        "challenge": {
          "type": "pin",
          "pin": "1234"
        }

Thanks for your quick reply, it works. 👍
I still don't fully understand how the mapping works

If you need more help, open a new issue so we don't spam anyone else on unrelated stuff 😄