• Register
    • Login
    • Search

    Unsolved [Under-Writing] Installation of Gateway with SmartHome functionality

    Gateway
    1
    14
    357
    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.
    • bugsounet
      bugsounet Main Coder last edited by bugsounet

      SmartHome Installation

      I think do you know the Google Home app of your smartphone
      It is used to control the connected devices
      We are therefore going to create the extension in order to control Jatvis from this application!
      Naturally… when done, you can therefore control it by voice from another device that uses the google assistant 🙂

      Process

      SmartHome needs to receive and send data
      Send data it’s not a problem 😉
      Receive data in live from google Server in live get a little more complex
      And again… it’s use https protocal
      So I tried to simplify as much as possible (as usual) the installation

      PreRequire

      • Domaine name or DynDNS (or equivalentq) account
      • a Router
      • an Google Account: same like MMM-GoogleAssistant, Google Home app, SmartPhone account

      Screenshot

      Google Home Jarvis icon:

      e3b1925c-58e2-4c12-8a2a-dc9c5f934d55-image.png

      On the App:

      de922e18-9655-444c-a511-74de2ec33c47-image.png

      3780007a-8966-444c-a7e3-c7f1abeb9d62-image.png

      768a728d-dd06-441b-a987-cc0bf07e9073-image.png

      dc1389db-e7df-4f86-a4f4-1c2092b31099-image.png

      What can this plugin do?

      It’s able to control plugin 🙂

      • EXT-Screen: for Force turn on/off screen
      • EXT-Volume: for volume and mute/unMute control
      • EXT-Spotify: Play/previous/next/pause
      • EXT-CanvasLyrics: Force (or not) full screen lyrics
      • EXT-FreeboxTV: display FreeboxTV and control it with CH +/-
      • EXT-Pages: change the page with source
      • Naturally … stop command is available too !

      (… More features will be added (again) soon!)

      My place in France Top committers of Github:
      committers.top badge

      1 Reply Last reply Reply Quote 0
      • bugsounet
        bugsounet Main Coder last edited by bugsounet

        Installation

        Project_id

        You know to remember what is you project_id used when you create credentials.json file of MMM-GoogleAssistant

        I create a command line for discover it ! (so don’t have to search ahahah !)
        try this in a Terminal:

        cd ~/MagicMirror/modules/Gateway
        npm run project
        

        result will be something like this:

        ~/MagicMirror/modules/Gateway$ npm run project
        
        > Gateway@3.X.X project
        > installer/check_ProjectID.sh
        
        Your MMM-GoogleAssistant project_id is: XXXXXXXXX
        ---
        Your SmartHome project_id is: credentials not found!
        

        Open a note pad and past your MMM-GoogleAssistant project_id!

        Note: Don’t worry about credentials not found for SmartHome, we will create it later!

        It’s time to change default username and password of Gateway configuration

        why ?
        You will have access from internet to Gateway so, for security, it’s better to don’t use default username and password
        This part will help and replace it by your own !

        Domaine name with fixed WAN ip address or DynDNS

        What’s IP WAN /IP LAN ?

        IP WAN is your ip from Internet
        IP LAN is your device ip from your local network (inside your home)

        What’s a domain name and a sub-domain ?

        a domaine sample it’s like bugsounet.fr
        a sub-domain it’s like forum.bugsounet.fr (forum is the sub-domain)

        –> If you have a domaine name and an fixed WAN ip address:
        create a sub-domaine and redirect it to your WAN ip

        –> if you have a dyndns domain name, verify if really redirect to your WAN adress

        External connect port (from internet)

        SmartHome need 2 ports:

        • 80: for create http server and initialize https protocol
        • 443: for using https protocol with SmartHome and Google SmartHome

        Enter inside your router setting and redirect this 2 ports to your raspberry pi LAN ip address

        My Sample value used in this wiki

        sub-domaine name: demo.bugsounet.fr

        When routing done, check if this is configured correctly

        Open the webpage with your sub-domaine name (or dyn-dns)
        sample: http://demo.bugsounet.fr (replace demo.bugsounet.fr by yours)

        If works: You must have the nginx default page

        5ffb2298-208c-4f8e-891d-91dae9757247-image.png

        My place in France Top committers of Github:
        committers.top badge

        1 Reply Last reply Reply Quote 0
        • bugsounet
          bugsounet Main Coder last edited by bugsounet

          Google Actions
          Let’s configure google actions!

          Connect to Google Action Console

          Create a new Project

          1.png

          Name it MMM-GoogleAssisant (and make it in accord with your language and country)

          2.png

          /!\ it must be the same project name like when you create your credentials for MMM-GoogleAssistant there

          … and Create project or Import project

          Select Smart Home

          6.png
          … and click start Building

          4.png

          My place in France Top committers of Github:
          committers.top badge

          1 Reply Last reply Reply Quote 0
          • bugsounet
            bugsounet Main Coder last edited by bugsounet

            At this point you have to verify if this project is linked to your MMM-GoogleAssistant project ID

            Close your brower and reconnect to google actions

            Select your project

            Select 3 dots on the top right

            bda1cd92-7253-42da-a551-8057962e2beb-image.png

            Select Project setting

            56ad5b78-351b-41d4-9545-8d9f5649d8aa-image.png

            8831290b-cd51-4a4d-b8a1-d17edd5e2512-image.png

            It’s must match with npm run project result (copied in note pad)

            My place in France Top committers of Github:
            committers.top badge

            1 Reply Last reply Reply Quote 0
            • bugsounet
              bugsounet Main Coder last edited by bugsounet

              Configure Google Actions

              Select overview

              a6719a67-f2b2-46ac-90c8-da0a2f196ad7-image.png

              Quick Setup

              Select Name your Smart Home action
              138376f5-57a2-4ce1-8489-bcbe19a378c4-image.png

              Display Name set it to Jarvis
              54ad3a27-b91a-46f4-bcb2-7d6afad3a7b2-image.png
              … and Save

              Select Actions on the left

              382374a3-ac53-45de-84f0-4d37070c4d86-image.png

              Fulfillment URL

              2da84384-be7b-4bb6-bdd6-4d5be51aa78d-image.png
              /!\ Replace demo.bugsounet.fr by your sub-domaine or dyn-dns address

              Add capabilities

              13.png
              check Support local query
              … and Save it !

              Select Account linking on the left

              ed271af1-da43-4a50-a778-05311bcd0e0c-image.png

              OAuth Client Information

              Client ID issued by your Actions to Google: enter your prefered Client login (as you wish) and note it in your NotePad as Client ID
              Client secret: enter the password used in the config of Gateway (password field of the Gateway config)
              Authorization URL and Token URL:
              efe44330-8fde-4eb2-a755-9e3c973b7369-image.png

              Replace demo.bugsounet.fr by your sub-domain or your dyndns address

              Configure your client:
              35c6cbd8-d590-42a5-ae8d-b7751131b029-image.png
              check this:
              ca8274a0-3660-4d5e-8268-d928b6ffbc6a-image.png
              … And click Next and Save

              click on Deploy

              1166f304-6c28-4725-b63a-836698e68f77-image.png
              click on Directory information
              a739b4a6-a4ad-48f5-bf45-539dc9cb1781-image.png
              Fill in the fields Description, Images, contact details, Privacy and consent.
              When done: Save it

              click on Company details on the left

              953ceffc-9f44-45a5-b965-0159614d37a4-image.png
              Fill in the fields too

              click on Release the last step !

              305f79d5-413c-4b27-ae95-d155f17a1043-image.png

              f2906ae5-5618-4c3a-a352-c8560f11005e-image.png
              Create a new release
              Channel: choose alpha
              Release name: keep by default
              and … Submit
              1a5802c3-f016-4b16-b298-7fab1ce12fed-image.png

              Google Action is now configured !

              My place in France Top committers of Github:
              committers.top badge

              1 Reply Last reply Reply Quote 0
              • bugsounet
                bugsounet Main Coder last edited by bugsounet

                It’s time to reopen your note pad !

                You have 2 values:
                the first is the project_id and the second is the Client ID

                open the config of Gateway
                Your have a field named CLIENT_ID

                by default : CLIENT_ID is null
                replace null value by your own value of Client ID of the note pad

                sample:

                CLIENT_ID: "mypreferedlogin",
                

                My place in France Top committers of Github:
                committers.top badge

                1 Reply Last reply Reply Quote 0
                • bugsounet
                  bugsounet Main Coder last edited by bugsounet

                  Let’s configure HomeGraph for live update in Google Home App (optional but recommended!)

                  Enable HomeGraph API for your project in the Cloud Platform Console

                  select the same project as Smarthome !

                  Enable HomeGraph API

                  Make the same process like this
                  and search HomeGraph and enable it

                  create credentials

                  Select API & Services -> Credentials
                  a49aa5be-96a7-4d3f-9237-23f95d79e359-image.png

                  Create Credentials
                  20aef720-e9af-4772-a453-f3595db12471-image.png

                  Select Service Account
                  9858e810-d638-4319-9aa6-afae24d42117-image.png

                  step 1:
                  c0f0c99a-efbb-4606-985a-ca9c5c37cea8-image.png
                  Service account name: Gateway
                  Service account ID : it’s auto complete… don’t touch it !
                  Service account description: Gateway

                  And… Create and continue

                  step 2:
                  2c1d59a2-d39c-4082-a0df-c7eee68107eb-image.png
                  Select a role and search token
                  Note: translate token into your language, for example jeton in french

                  and select Service Account Token Creator
                  daefe031-16d5-43b5-999a-42439b428306-image.png

                  click on Continue and click Done

                  My place in France Top committers of Github:
                  committers.top badge

                  1 Reply Last reply Reply Quote 0
                  • bugsounet
                    bugsounet Main Coder last edited by bugsounet

                    Your credentials is now reated, let’s download it !

                    DownLoad credentials

                    Go back again to Credentials

                    Select Gateway account in Service Account section

                    54e53bca-470c-4a17-86ab-1746968ef0cd-image.png

                    Select KEYS

                    4ce27633-e67e-48e5-b94f-76bcd494e816-image.png

                    Click on ADD KEY and select Create new key

                    eb3095b0-47b7-4bf9-9fb9-ea27a2cf2a18-image.png

                    CREATE the key in JSON format

                    e46039c8-d739-41ae-ad98-cfb0cc323de3-image.png

                    The file will be generated and the download will start automatically

                    My place in France Top committers of Github:
                    committers.top badge

                    1 Reply Last reply Reply Quote 0
                    • bugsounet
                      bugsounet Main Coder last edited by bugsounet

                      Copy credentials to Gateway

                      Rename the downloaded file to credentials.json and past it to ~/MagicMirror/modules/Gateway directory

                      Warn: This credentials are NOT MMM-GoogleAssistant credentials !

                      Verify project_id of MMM-GoogleAssistant and SmarHome

                      Run again this script:

                      cd ~/MagicMirror/modules/Gateway/
                      npm run project
                      

                      You MUST have same value on each credentials!

                      Your MMM-GoogleAssistant project_id is: XXXXXX
                      ---
                      Your SmartHome project_id is: XXXXXX
                      

                      My place in France Top committers of Github:
                      committers.top badge

                      1 Reply Last reply Reply Quote 0
                      • bugsounet
                        bugsounet Main Coder last edited by bugsounet

                        Remove registration of MMM-GoogleAssistant from GoogleHome app

                        If you have an existing Jarvis in GoogleHome app: Let’s delete it

                        cd ~/MagicMirror/modules/MMM-GoogleAssistant
                        npm run delete
                        

                        Note: Don’t worry, we will create it again later !

                        My place in France Top committers of Github:
                        committers.top badge

                        1 Reply Last reply Reply Quote 0
                        • bugsounet
                          bugsounet Main Coder last edited by bugsounet

                          Let’s configure the webserver for https using

                          Require Warning:

                          • You have already configured and authorized your router in order to communicate from the internet on ports 80 and 443
                          • MagicMirror² is NOT launched
                          • For this sample I use demo.bugsounet.fr as sub-domaine name !

                          Try this prepared command:

                          cd ~/MagicMirror/modules/Gateway
                          npm run smarthome
                          
                          • [SMARTHOME]~What is your domain name?~
                            enter your sub-domaine name sample: demo.bugsounet.fr

                          • The prepared command will auto configure nginx

                          484228b7-411d-4a5b-9e8f-51ecaa38f30d-image.png

                          • [SMARTHOME] Router is ready ? [Y/n]
                            By respond Y: you have prepared your router and installation will continue and install https certificate

                          84287b8e-3a59-4bdb-a475-0bdc0fc1bebb-image.png

                          **Notes:

                          • Maybe It can ask you for information to fill in (registration to cerbot)**
                          • If failed prepared program will inform you, in RED with the reason above !

                          21b280a8-6b01-4ed4-bdfc-a989f81a0aa6-image.png

                          My place in France Top committers of Github:
                          committers.top badge

                          1 Reply Last reply Reply Quote 0
                          • bugsounet
                            bugsounet Main Coder last edited by bugsounet

                            It’s time to Start MagicMirror²

                            So … start MagicMirror and wait all is initialized !

                            Verify link of Gateway and smarthome

                            61341d6c-b5a2-42b1-8ea9-4189b57ad667-image.png

                            Test this 2 links and see if it’s ok 😉
                            Naturally change demo.bugsounet.fr by your own !

                            Yeah, You have now access to Gateway everywhere in the world !

                            My place in France Top committers of Github:
                            committers.top badge

                            1 Reply Last reply Reply Quote 0
                            • bugsounet
                              bugsounet Main Coder last edited by bugsounet

                              Make a link with Google Home app

                              [Under Writing]

                              My place in France Top committers of Github:
                              committers.top badge

                              1 Reply Last reply Reply Quote 0
                              • bugsounet
                                bugsounet Main Coder last edited by bugsounet

                                Make or Remake the link with MMM-GoogleAssistant

                                Just try this command:

                                cd ~/MagicMirror/modules/MMM-GoogleAssistant
                                npm run register
                                

                                MMM-GoogleAssistant configuration

                                Verify that deviceRegistred field is set to true

                                Restart again your MagicMirror

                                Look at your Google Home app

                                Jarvis is alive !

                                My place in France Top committers of Github:
                                committers.top badge

                                1 Reply Last reply Reply Quote 0
                                • First post
                                  Last post
                                Powered by NodeBB | @bugsounet ©2023