MagicMirror Forum
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • 3rd-Party-Modules
    • Donate
    • Discord
    • Register
    • Login
    A New Chapter for MagicMirror: The Community Takes the Lead
    Read the statement by Michael Teeuw here.

    MMM-Assistant: Register your Mirror as Google Assistant related device invalid JSON

    Scheduled Pinned Locked Moved Solved Troubleshooting
    9 Posts 5 Posters 2.5k Views 5 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • J Offline
      jck
      last edited by

      Hi,

      I tried to get my Mirror to show in the Google Home app and followed the instructions here: https://github.com/eouia/MMM-AssistantMk2/blob/master/USAGE.md

      After i ran the command:

      curl -s -X POST -H "Content-Type: application/json" \
      -H "Authorization: Bearer $ACCESSTOKEN" -d @deviceInstance.json \
      https://embeddedassistant.googleapis.com/v1alpha2/projects/YOUR_PROJECT_ID/devices/
      

      (replacing the YOUR_PROJECT_ID with my project ID) I got an error:

      {
        "error": {
          "code": 400,
          "message": "Invalid JSON payload received. Expected a value.\n“magicmirror”,  \n^",
          "status": "INVALID_ARGUMENT"
        }
      }
      
      

      My best guess is that I didn’t use the correct value for my model_id or project_id but I tried different values and still run into dead ends.

      Any pointers?

      ? 1 Reply Last reply Reply Quote 0
      • ? Offline
        A Former User @jck
        last edited by

        @jck
        Show me the deviceInstance.json.

        1 Reply Last reply Reply Quote 0
        • J Offline
          jck
          last edited by

          Hi, thanks for replying!

          Here’s the file:

          
          {
              "id": “my_mirror_001”,
              "model_id": “mirror-5a142-magicmirror-nz3frj”,
              "nickname": “Magic Mirror”,
              "client_type": "SDK_SERVICE"
          }
          
          
          ? 1 Reply Last reply Reply Quote 0
          • ? Offline
            A Former User @jck
            last edited by

            @jck

            curl -s -X POST -H "Content-Type: application/json" \
            -H "Authorization: Bearer $ACCESSTOKEN" -d @deviceInstance.json \
            https://embeddedassistant.googleapis.com/v1alpha2/projects/YOUR_PROJECT_ID/devices/
            

            did you modified YOUR_PROJECT_ID for your real project?
            And in that project your model_id is registered? (not to other project?)

            J 1 Reply Last reply Reply Quote 0
            • J Offline
              jck @Guest
              last edited by

              @sean yes, I did.

              Just to be sure I just did the whole thing over again, trying to make sure I didn’t miss a step. But got the same results. As far as I can tell, it sends out the JSON alright, together with the right ACCESSTOKEN. But it seems to misread the value given at the id line.

              J 1 Reply Last reply Reply Quote 0
              • J Offline
                jck @jck
                last edited by

                @Sean

                I found the problem! As always, it was very simple as soon as you see it. The error did precisely report the problem but I was to blind to spot it! It said it expected a value, and it could’t read the one I provided.

                I used the wrong kind of " to make the input seen as STRING. If I had used the sample you provided in the module, all would have been good, but I copied the example on the github… and that one uses the slanted version of ".

                My mirror now shows up on the Google Home app! Thanks for all the hard work!

                B 1 Reply Last reply Reply Quote 0
                • B Offline
                  bachoo786 @jck
                  last edited by

                  @jck hello mate
                  did you follow any step by step tutorial to install google assistant? or can you write one up as I tried to install it but failed miserably.

                  thanks.

                  1 Reply Last reply Reply Quote 0
                  • M Offline
                    mattx38
                    last edited by

                    @jck said in MMM-Assistant: Register your Mirror as Google Assistant related device invalid JSON:

                    @Sean

                    I found the problem! As always, it was very simple as soon as you see it. The error did precisely report the problem but I was to blind to spot it! It said it expected a value, and it could’t read the one I provided.

                    I used the wrong kind of " to make the input seen as STRING. If I had used the sample you provided in the module, all would have been good, but I copied the example on the github… and that one uses the slanted version of ".

                    My mirror now shows up on the Google Home app! Thanks for all the hard work!

                    Hello,
                    Was the correction made in the deviceInstance.json file ?
                    Could you precise ?
                    I have the same kind of issue and I’m quite frustated.
                    Thank you

                    B 1 Reply Last reply Reply Quote 0
                    • B Offline
                      bubulle-mtp @mattx38
                      last edited by

                      @mattx38 salut, je suis dans la même galère, je n’ai pas trouver la solution et toi ?

                      1 Reply Last reply Reply Quote 0
                      • 1 / 1
                      • First post
                        Last post
                      Enjoying MagicMirror? Please consider a donation!
                      MagicMirror created by Michael Teeuw.
                      Forum managed by Sam, technical setup by Karsten.
                      This forum is using NodeBB as its core | Contributors
                      Contact | Privacy Policy